Skip to content

[plan] Implement custom Huh theme using pkg/styles color palette #21469

Description

@github-actions

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

  1. Create pkg/styles/huh_theme.go
  2. Use huh.ThemeCharm() or huh.ThemeBase() as the starting point and override with project-specific colors
  3. Map styles.ColorPrimary, styles.ColorSuccess, styles.ColorError, styles.ColorWarning, etc. to the appropriate Huh theme fields
  4. Export a HuhTheme() function that returns *huh.Theme
  5. 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

  • pkg/styles/huh_theme.go exists with exported HuhTheme() function
  • Theme uses colors from pkg/styles (not hardcoded hex values)
  • All huh.NewForm() calls in pkg/console/ and pkg/cli/ apply the theme
  • make fmt && make lint && make test-unit pass

Generated by Plan Command for issue #discussion #21455 ·

  • expires on Mar 19, 2026, 11:44 PM UTC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions