Objective
Create a custom Huh theme in pkg/styles/huh_theme.go that maps the existing pkg/styles color palette into a huh.Theme, giving interactive forms the same Dracula-inspired visual identity as the rest of the CLI output.
Context
From the Terminal Stylist audit (discussion #21455), all 11 Huh forms use the default Huh theme. The project has a rich pkg/styles theme with adaptive colors that could be applied via huh.Theme customization for a cohesive UX.
Approach
- Create
pkg/styles/huh_theme.go
- Use
huh.ThemeCharm() or huh.ThemeBase() as the starting point and override with project-specific colors
- Map
styles.ColorPrimary, styles.ColorSuccess, styles.ColorError, styles.ColorWarning, etc. to the appropriate Huh theme fields
- Export a
HuhTheme() function that returns *huh.Theme
- Apply the theme in
pkg/console/confirm.go and pkg/console/input.go (centralized form wrappers), and update interactive.go's huh.NewForm() calls to use .WithTheme(styles.HuhTheme())
Example
// pkg/styles/huh_theme.go
func HuhTheme() *huh.Theme {
t := huh.ThemeCharm()
t.Focused.Base = t.Focused.Base.BorderForeground(ColorPrimary)
t.Focused.Title = lipgloss.NewStyle().Foreground(ColorPrimary).Bold(true)
t.Focused.ErrorMessage = lipgloss.NewStyle().Foreground(ColorError)
// ...
return t
}
Files to Modify
- Create:
pkg/styles/huh_theme.go
- Update:
pkg/console/confirm.go — add .WithTheme(styles.HuhTheme())
- Update:
pkg/console/input.go — add .WithTheme(styles.HuhTheme())
- Update:
pkg/cli/interactive.go — add .WithTheme(styles.HuhTheme())
Acceptance Criteria
Generated by Plan Command for issue #discussion #21455 · ◷
Objective
Create a custom Huh theme in
pkg/styles/huh_theme.gothat maps the existingpkg/stylescolor palette into ahuh.Theme, giving interactive forms the same Dracula-inspired visual identity as the rest of the CLI output.Context
From the Terminal Stylist audit (discussion #21455), all 11 Huh forms use the default Huh theme. The project has a rich
pkg/stylestheme with adaptive colors that could be applied viahuh.Themecustomization for a cohesive UX.Approach
pkg/styles/huh_theme.gohuh.ThemeCharm()orhuh.ThemeBase()as the starting point and override with project-specific colorsstyles.ColorPrimary,styles.ColorSuccess,styles.ColorError,styles.ColorWarning, etc. to the appropriate Huh theme fieldsHuhTheme()function that returns*huh.Themepkg/console/confirm.goandpkg/console/input.go(centralized form wrappers), and updateinteractive.go'shuh.NewForm()calls to use.WithTheme(styles.HuhTheme())Example
Files to Modify
pkg/styles/huh_theme.gopkg/console/confirm.go— add.WithTheme(styles.HuhTheme())pkg/console/input.go— add.WithTheme(styles.HuhTheme())pkg/cli/interactive.go— add.WithTheme(styles.HuhTheme())Acceptance Criteria
pkg/styles/huh_theme.goexists with exportedHuhTheme()functionpkg/styles(not hardcoded hex values)huh.NewForm()calls inpkg/console/andpkg/cli/apply the thememake fmt && make lint && make test-unitpass