Skip to content

[Code Quality] Replace inline lipgloss.NewStyle() in compile_schedule_calendar.go with centralized pkg/styles vars #48217

Description

@github-actions

Description

pkg/cli/compile_schedule_calendar.go contains an intensityStyle(count int, isTerminal bool) function that creates lipgloss.NewStyle() inline for the schedule heatmap renderer. This duplicates logic already centralized in pkg/styles/theme.go (which provides ScheduleCalendar* style variables) and bypasses the colorwriter.Degrade() path used by the rest of the codebase for NO_COLOR and COLORTERM compliance.

Terminal Stylist analysis of 1,151 Go source files found only 2 files using Lipgloss directly outside the pkg/styles / pkg/console infrastructure — compile_schedule_calendar.go is one of them.

Suggested Changes

  • In pkg/cli/compile_schedule_calendar.go, replace the inline lipgloss.NewStyle() calls in intensityStyle with references to the centralized styles.ScheduleCalendar* variables from pkg/styles/theme.go
  • Remove the isTerminal bool parameter if style application can be handled by the centralized TTY-aware path
  • Verify NO_COLOR and COLORTERM degradation is handled correctly after the change

Files Affected

  • pkg/cli/compile_schedule_calendar.go — remove inline lipgloss usage
  • pkg/styles/theme.go — reference (read-only; only add new ScheduleCalendar* vars if any are missing)

Success Criteria

  • No direct lipgloss.NewStyle() calls remain in compile_schedule_calendar.go
  • Calendar rendering still works correctly in both TTY and non-TTY environments
  • NO_COLOR=1 suppresses color output from the calendar renderer
  • go test ./pkg/cli/... passes

Source

Extracted from Terminal Stylist: Console Output Analysis Report

Priority

Medium — consistency and NO_COLOR compliance; low risk since change is localized

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · sonnet46 · 41.7 AIC · ⌖ 8.4 AIC · ⊞ 7.2K ·

  • expires on Jul 27, 2026, 11:11 AM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions