[terminal-stylist] Terminal Stylist Analysis: Console Output Patterns in pkg/ #39209
Closed
Replies: 2 comments 1 reply
-
|
/plan |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
This discussion has been marked as outdated by Terminal Stylist. A newer discussion is available at Discussion #39355. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
Analysis of console output patterns across 915 non-test Go files in
pkg/, covering Lipgloss (charm.land/lipgloss/v2), Huh (charm.land/huh/v2), and internalpkg/console+pkg/stylesabstractions.Key Metrics
pkg/fmt.Print*calls inpkg/cli/console.*calls inpkg/cli/lipglossimportArchitecture
Layered output system:
pkg/styles/theme.go— 11 adaptivecompat.AdaptiveColorconstants (Dracula-inspired dark / high-contrast light) + 24 pre-configured Lipgloss stylespkg/styles/huh_theme.go— Custom HuhThemeFuncmapping the shared palette to form field stylespkg/console/— Abstraction layer (26 files): TTY detection, format helpers, progress bar, spinner, table renderer, interactive promptspkg/cli/— 319 primary consumer files✅ Strengths
Expand
compat.AdaptiveColorconstants with distinct light/dark hex values; auto-adapts to terminal background.applyStyle()inconsole.gogates all Lipgloss rendering. ANSI codes interminal.gogated bytty.IsStderrTerminal().styles.Error,styles.TableHeader, etc.) prevent ad-hoc color choices..WithTheme(styles.HuhTheme).WithAccessible(console.IsAccessibleMode()).IsAccessibleMode()detectsACCESSIBLE,TERM=dumb,NO_COLORenv vars.ConfirmActionfalls back to text prompt;ProgressBarrenders plain-text percentages.FormatInfoMessage: 643 calls;FormatWarningMessage: 469;FormatSuccessMessage: 214.theme.goskips terminal probing on Windows for redirected handles.console.RenderTable()wrapslipgloss/tablewith TTY-awarestyleFunc.bubbles/progresswith adaptiveColorPurple→ColorInfogradient + non-TTY fallback.High: Unstyled Error Report Output —
compile_stats.go20 raw
fmt.Fprintf(os.Stderr, ...)calls for failure lists and recovery steps bypass the console package:Surrounding code already uses
console.FormatErrorMessage(), creating inconsistent visual hierarchy.High: No Styling at All —
outcomes_history.go10 plain
fmt.Fprintf(os.Stderr, ...)calls — zero use of the console package. The bucket table is a prime candidate forconsole.RenderTable()and the source heading forconsole.FormatSectionHeader().Medium: Mixed Styled/Unstyled Sub-items —
trial_confirmation.goTop-level plan steps use
console.FormatInfoMessage()but nested sub-items (a., b.) are raw:Medium: Verbose Debug Without Flag —
token_usage.go4+ debug messages written unconditionally, no verbose gate, no
console.FormatVerboseMessage():Low: Inline Lipgloss in CLI —
compile_schedule_calendar.go6 inline
lipgloss.NewStyle()calls inintensityStyle()bypasspkg/styles. These should be named constants inpkg/styles/theme.go.Low: Unstyled Welcome Banner —
terminal.goShowWelcomeBanner()emits plain emoji text; should useapplyStyle(styles.Header, ...)for consistency.Huh Form Usage Summary
All 13 Huh-using files apply
WithTheme(styles.HuhTheme)andWithAccessible(console.IsAccessibleMode())consistently. ✅Lipgloss Usage Summary
pkg/styles/theme.gopkg/console/console.goapplyStyle()pkg/cli/compile_schedule_calendar.golipgloss.NewStyle()pkg/stylespkg/cli/status_command.golipgloss/treepkg/cli/mcp_inspect.golipgloss/treeReferences:
Beta Was this translation helpful? Give feedback.
All reactions