You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scanned all non-test .go files under pkg/ for console output patterns (fmt.Print*, console.*, lipgloss.*, huh.*). Overall, the codebase already has a mature, centralized styling system and follows it consistently.
What's working well
Centralized console package (pkg/console/): console.go, print.go, format.go, list.go, confirm.go, spinner.go, prompt_form.go provide Format*Message, Print*Message, RenderTable, RenderStruct, RenderTitleBox, etc. Nearly all user-facing output in pkg/cli/* goes through these helpers rather than raw fmt.Print*.
Adaptive colors (pkg/styles/theme.go): a custom adaptiveColor type wraps light/dark hex pairs (ColorError, ColorWarning, ColorSuccess, ColorInfo, ColorPurple, ColorYellow, ColorComment, etc.) implementing RGBA(), so all styles adapt to terminal background automatically — no hardcoded non-adaptive colors found outside pkg/styles/.
Huh forms: All interactive forms (pkg/cli/interactive.go, pkg/cli/run_interactive.go, pkg/console/prompt_form.go) are constructed via console.NewForm / NewInputForm / NewSelectForm / NewConfirmForm, which uniformly apply styles.HuhTheme and .WithAccessible(IsAccessibleMode()). No direct huh.NewForm(...) calls bypass this wrapper.
Theme parity: pkg/styles/huh_theme.go maps the same Dracula-inspired palette (colorPurpleLight/Dark, colorSuccessLight/Dark, etc.) used by theme.go into huh's ThemeFunc via lipgloss.LightDark, giving forms and static output one visual identity.
TTY-awareness: style application is routed through applyStyleWithTTY / applyStdoutStyleWithTTY / applyStderrStyleWithTTY, which take a ttyCheck func() bool — output degrades gracefully (no ANSI) when piped or redirected. pkg/tty and console/terminal.go/accessibility.go implement TTY and accessibility-mode detection used consistently by ShowInteractiveList and huh-based flows.
Accessibility: IsAccessibleMode() (env-var driven) is wired into every form via console.NewForm, and ShowInteractiveList falls back to a plain text list when tty.IsStderrTerminal() is false.
Minor observations (not blocking, low priority)
Two remaining raw fmt.Print calls for final rendered content:
pkg/cli/view_command.go:168 — fmt.Print(output) for a pre-rendered timeline stream.
pkg/cli/status_command.go:295 — fmt.Print(console.RenderStruct(statuses)).
Both print already-styled strings produced by console renderers (not raw literals), so this is an acceptable/expected terminal pattern (final flush of a fully-rendered buffer) rather than a bypass of the console package. No action needed.
Legitimate raw ANSI usage: pkg/console/terminal.go defines ansiClearScreen/ansiClearLine constants used for spinner/progress redraws — appropriate low-level use case that Lipgloss doesn't abstract, and pkg/stringutil/ansi.go implements ANSI-stripping for log sanitization (unrelated to output styling).
No manual table formatting outside console.RenderTable/RenderStruct and no simple prompts that should be "upgraded" to huh — the two remaining plain confirms/inputs already route through the themed wrappers.
Recommendation
No code changes are required. The codebase already enforces the intended pattern: all styled output flows through pkg/console + pkg/styles, adaptive colors are used throughout, huh forms are uniformly themed and accessibility-aware, and TTY detection gates ANSI output. The two direct fmt.Print calls are printing pre-rendered content and are stylistically fine as-is.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
Scanned all non-test
.gofiles underpkg/for console output patterns (fmt.Print*,console.*,lipgloss.*,huh.*). Overall, the codebase already has a mature, centralized styling system and follows it consistently.What's working well
pkg/console/):console.go,print.go,format.go,list.go,confirm.go,spinner.go,prompt_form.goprovideFormat*Message,Print*Message,RenderTable,RenderStruct,RenderTitleBox, etc. Nearly all user-facing output inpkg/cli/*goes through these helpers rather than rawfmt.Print*.pkg/styles/theme.go): a customadaptiveColortype wraps light/dark hex pairs (ColorError,ColorWarning,ColorSuccess,ColorInfo,ColorPurple,ColorYellow,ColorComment, etc.) implementingRGBA(), so all styles adapt to terminal background automatically — no hardcoded non-adaptive colors found outsidepkg/styles/.pkg/cli/interactive.go,pkg/cli/run_interactive.go,pkg/console/prompt_form.go) are constructed viaconsole.NewForm/NewInputForm/NewSelectForm/NewConfirmForm, which uniformly applystyles.HuhThemeand.WithAccessible(IsAccessibleMode()). No directhuh.NewForm(...)calls bypass this wrapper.pkg/styles/huh_theme.gomaps the same Dracula-inspired palette (colorPurpleLight/Dark,colorSuccessLight/Dark, etc.) used bytheme.gointo huh'sThemeFuncvialipgloss.LightDark, giving forms and static output one visual identity.applyStyleWithTTY/applyStdoutStyleWithTTY/applyStderrStyleWithTTY, which take attyCheck func() bool— output degrades gracefully (no ANSI) when piped or redirected.pkg/ttyandconsole/terminal.go/accessibility.goimplement TTY and accessibility-mode detection used consistently byShowInteractiveListand huh-based flows.IsAccessibleMode()(env-var driven) is wired into every form viaconsole.NewForm, andShowInteractiveListfalls back to a plain text list whentty.IsStderrTerminal()is false.Minor observations (not blocking, low priority)
fmt.Printcalls for final rendered content:pkg/cli/view_command.go:168—fmt.Print(output)for a pre-rendered timeline stream.pkg/cli/status_command.go:295—fmt.Print(console.RenderStruct(statuses)).Both print already-styled strings produced by console renderers (not raw literals), so this is an acceptable/expected terminal pattern (final flush of a fully-rendered buffer) rather than a bypass of the console package. No action needed.
pkg/console/terminal.godefinesansiClearScreen/ansiClearLineconstants used for spinner/progress redraws — appropriate low-level use case that Lipgloss doesn't abstract, andpkg/stringutil/ansi.goimplements ANSI-stripping for log sanitization (unrelated to output styling).console.RenderTable/RenderStructand no simple prompts that should be "upgraded" to huh — the two remaining plain confirms/inputs already route through the themed wrappers.Recommendation
No code changes are required. The codebase already enforces the intended pattern: all styled output flows through
pkg/console+pkg/styles, adaptive colors are used throughout, huh forms are uniformly themed and accessibility-aware, and TTY detection gates ANSI output. The two directfmt.Printcalls are printing pre-rendered content and are stylistically fine as-is.All reactions