Objective
Refactor the two files that call styles.X.Render() directly — pkg/cli/compile_schedule_calendar.go and pkg/cli/compile_stats.go — to use applyStyleWithTTY (or the appropriate exported/internal variant) consistently with the rest of the codebase.
Context
Identified in Terminal Stylist analysis: discussion #43520. Both callsites are already guarded by isTerminal / tty.IsStderrTerminal() checks, so they are functionally correct. The issue is stylistic/architectural inconsistency: the rest of the codebase uses applyStyle/applyStyleWithTTY from pkg/console/, not naked styles.X.Render().
Implementation Plan
Files to Modify
pkg/cli/compile_schedule_calendar.go lines 252, 264: styles.TableHeader.Render(header) and styles.TableHeader.Render(label)
pkg/cli/compile_stats.go lines 302–303: styles.Error.Render("✗ ")
Approach
- Check whether
applyStyleWithTTY is exported from pkg/console/. If it is unexported, either:
- Add a thin exported
ApplyStyleWithTTY(style lipgloss.Style, s string) string function to pkg/console/console.go, or
- Move the rendering calls to use
console.FormatErrorMessage / console.RenderTable where applicable.
- Replace each
styles.X.Render(...) callsite with the chosen pattern.
- Run
make build and existing tests.
Notes
- The existing TTY guard in each file is correct and should be preserved (or superseded by the console helper's built-in guard).
- For
compile_stats.go, consider whether console.FormatErrorMessage already produces the right prefix, making the direct styles.Error.Render redundant.
Acceptance Criteria
Generated by 📋 Plan Command · 25.5 AIC · ⌖ 8.2 AIC · ⊞ 4.9K · ◷
Comment /plan to run again
Objective
Refactor the two files that call
styles.X.Render()directly —pkg/cli/compile_schedule_calendar.goandpkg/cli/compile_stats.go— to useapplyStyleWithTTY(or the appropriate exported/internal variant) consistently with the rest of the codebase.Context
Identified in Terminal Stylist analysis: discussion #43520. Both callsites are already guarded by
isTerminal/tty.IsStderrTerminal()checks, so they are functionally correct. The issue is stylistic/architectural inconsistency: the rest of the codebase usesapplyStyle/applyStyleWithTTYfrompkg/console/, not nakedstyles.X.Render().Implementation Plan
Files to Modify
pkg/cli/compile_schedule_calendar.golines 252, 264:styles.TableHeader.Render(header)andstyles.TableHeader.Render(label)pkg/cli/compile_stats.golines 302–303:styles.Error.Render("✗ ")Approach
applyStyleWithTTYis exported frompkg/console/. If it is unexported, either:ApplyStyleWithTTY(style lipgloss.Style, s string) stringfunction topkg/console/console.go, orconsole.FormatErrorMessage/console.RenderTablewhere applicable.styles.X.Render(...)callsite with the chosen pattern.make buildand existing tests.Notes
compile_stats.go, consider whetherconsole.FormatErrorMessagealready produces the right prefix, making the directstyles.Error.Renderredundant.Acceptance Criteria
compile_schedule_calendar.gono longer callsstyles.TableHeader.Render()directlycompile_stats.gono longer callsstyles.Error.Render()directly