Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmd/chief/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,18 @@ func resolveProvider(flagAgent, flagPath string) loop.Provider {
}

func runTUIWithOptions(opts *TUIOptions) {
cwd, err := os.Getwd()
if err == nil {
if cfg, err := config.Load(cwd); err == nil && cfg.Theme != "" {
theme, ok := tui.ThemeByName(cfg.Theme)
if !ok {
fmt.Fprintf(os.Stderr, "Warning: unknown theme %q, falling back to \"catppuccin-mocha\"\n", cfg.Theme)
}
tui.ActiveTheme = theme
}
}
tui.InitStyles()

provider := resolveProvider(opts.Agent, opts.AgentPath)

prdPath := opts.PRDPath
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const configFile = ".chief/config.yaml"

// Config holds project-level settings for Chief.
type Config struct {
Theme string `yaml:"theme"`
Worktree WorktreeConfig `yaml:"worktree"`
OnComplete OnCompleteConfig `yaml:"onComplete"`
Agent AgentConfig `yaml:"agent"`
Expand Down
14 changes: 5 additions & 9 deletions internal/tui/confetti.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,8 @@ import (
var confettiChars = []string{"✦", "★", "●", "◆", "♦", "▲", "■", "♥", "✧", "⬥"}

// confettiColors are the colors used for confetti particles.
var confettiColors = []lipgloss.Color{
SuccessColor,
PrimaryColor,
WarningColor,
ErrorColor,
lipgloss.Color("#FF6AC1"), // Pink
lipgloss.Color("#FFD700"), // Gold
lipgloss.Color("#FF8C00"), // Dark orange
}
// Populated by InitStyles() so they reflect the active theme.
var confettiColors []lipgloss.Color

// Particle represents a single confetti particle.
type Particle struct {
Expand All @@ -45,6 +38,9 @@ func (c *Confetti) SetSize(width, height int) {

// NewConfetti creates a new confetti system with particles spread across the screen.
func NewConfetti(width, height int) *Confetti {
if len(confettiColors) == 0 {
InitStyles()
}
c := &Confetti{
width: width,
height: height,
Expand Down
Loading