[terminal-stylist] Terminal Stylist: Console Output Analysis Report #39047
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-06-14T09:50:02.486Z.
|
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.
-
Analysis of 913 non-test
.gofiles inpkg/for console output patterns, Lipgloss styling, and Huh form implementations.Summary
pkg/pkg/consolepkg/stylesdirectlyhuhdirectlylipglossdirectlypkg/styles/Status: ✅ Strong overall consistency — 6 targeted improvements identified.
Architecture
Clear 3-layer terminal UI stack:
pkg/styles/— Centralized Lipgloss color palette + Huh themingpkg/console/— High-level UI components (Format*,Render*, forms, spinner, progress)pkg/cli/+pkg/workflow/— Consumers (199 files)✅ Strengths
compat.AdaptiveColorwith Dracula-inspired light/dark hex values; Windows-safeinit().WithTheme(styles.HuhTheme).WithAccessible(console.IsAccessibleMode())applyStyle()conditionally applies Lipgloss — no ANSI leaking into pipesconfirm.go,list.goprovide text-based fallbacks for non-TTY environmentsdoc.go)Format*= pure string,Render*= structured output (documented)Issue 1: Direct huh callers in `pkg/cli/` skip the TTY pre-check (8 of 9 callers)
Console wrappers (
confirm.go,list.go,input.go) all calltty.IsStderrTerminal()before running forms and provide text fallbacks. Direct callers inpkg/cli/skip this:interactive.go,add_interactive_auth.go,add_interactive_workflow.go,add_interactive_orchestrator.goadd_interactive_engine.go,add_interactive_schedule.go,add_interactive_git.go,engine_secrets.goOnly
run_interactive.gohas the TTY check. Recommendation: Add TTY pre-check at command entry point or document the assumption.Issue 2: Bare `fmt.Fprintf(os.Stderr, ...)` in several `pkg/cli/` files
trial_confirmation.gotoken_usage.gooutcomes_history.govscode_config.gocompile_stats.goRecommendation: Replace with
console.FormatInfoMessage(),console.FormatWarningMessage(), etc.Issue 3: `ShowWelcomeBanner()` emits unstyled welcome text
pkg/console/terminal.golines 43–46 use barefmt.Fprintln(os.Stderr, ...)for the welcome header and description whilePrintBanner()nearby correctly usesapplyStyle(). Recommendation: Applystyles.Headerto the title and a style viaapplyStyle()to the description.Issue 4: `RunForm([]FormField)` has only a wasm stub
console_types.godefinesFormField;form_wasm.gostubsRunForm()with an error. No native implementation exists. The 16+ directhuh.NewForm(...)usages inpkg/cli/build forms inline. Recommendation: Implement the native version or removeFormFieldand the stub.Issue 5: `intensityStyle()` allocates new `lipgloss.Style` per call
pkg/cli/compile_schedule_calendar.gocallslipgloss.NewStyle()insideintensityStyle()for every cell in a 168-cell grid. Recommendation: Pre-define the 5 intensity styles as package-level vars (consistent withpkg/styles/theme.go).Issue 6: `styles/theme.go` doc examples use stdout
Lines 39–46 show
fmt.Println(styles.Error.Render(...))in doc comments. Perdoc.goconvention, diagnostic output goes to stderr. Recommendation: Change examples tofmt.Fprintln(os.Stderr, ...).Lipgloss Summary
pkg/styles/theme.gopkg/styles/huh_theme.gopkg/console/console.goapplyStyle()TTY guard,lipgloss/tablepkg/logger/logger.gopkg/cli/compile_schedule_calendar.goHuh Summary
pkg/console/confirm.go,input.go,list.gopkg/cli/run_interactive.gopkg/cli/add_interactive_*.go,interactive.go,engine_secrets.goRecommendations (Priority)
fmt.Fprintf(os.Stderr, ...)with console formatters (Issue 2)ShowWelcomeBanner()text with Lipgloss (Issue 3)RunForm()(Issue 4)intensityStylevariants (Issue 5)styles/theme.godoc examples to use stderr (Issue 6)References: §27463157795
Beta Was this translation helpful? Give feedback.
All reactions