feat: crush-inspired TUI improvements, activity bar polish, startup fresh session
TUI improvements: - semantic icon constants (✓ ◆ ▣ ✕ ⌘ ◌ ◔ ◉) - pill-style metadata bar with model/provider/session/context - fuzzy command palette with deterministic subsequence scoring - input history navigation (ctrl+p / ctrl+n) - structured tool log cards (▣ tool_name + args preview) - no-background activity indicator and meta bar for cleaner rendering Startup behavior: - default startup creates a fresh session - explicit --resume <id> restores saved context - added main_test.go for initializeSession coverage
This commit is contained in:
+71
-5
@@ -15,6 +15,17 @@ const (
|
||||
ThemeDark ThemeMode = "dark"
|
||||
)
|
||||
|
||||
const (
|
||||
iconReady = "✓"
|
||||
iconWorking = "◆"
|
||||
iconTool = "▣"
|
||||
iconError = "✕"
|
||||
iconCommand = "⌘"
|
||||
iconSession = "◌"
|
||||
iconContext = "◔"
|
||||
iconModel = "◉"
|
||||
)
|
||||
|
||||
func ParseThemeMode(value string) (ThemeMode, error) {
|
||||
switch ThemeMode(strings.ToLower(strings.TrimSpace(value))) {
|
||||
case "", ThemeLight:
|
||||
@@ -48,11 +59,23 @@ type styles struct {
|
||||
App lipgloss.Style
|
||||
Muted lipgloss.Style
|
||||
Activity lipgloss.Style
|
||||
Header lipgloss.Style
|
||||
ModelMeta lipgloss.Style
|
||||
Footer lipgloss.Style
|
||||
Viewport lipgloss.Style
|
||||
InputBox lipgloss.Style
|
||||
CommandHint lipgloss.Style
|
||||
StatusReady lipgloss.Style
|
||||
StatusWarn lipgloss.Style
|
||||
StatusError lipgloss.Style
|
||||
StatusInfo lipgloss.Style
|
||||
Pill lipgloss.Style
|
||||
PillAccent lipgloss.Style
|
||||
Palette lipgloss.Style
|
||||
PaletteMatch lipgloss.Style
|
||||
ToolName lipgloss.Style
|
||||
ToolKey lipgloss.Style
|
||||
ToolValue lipgloss.Style
|
||||
UserLabel lipgloss.Style
|
||||
ToolLabel lipgloss.Style
|
||||
ErrorLabel lipgloss.Style
|
||||
@@ -116,14 +139,15 @@ func (t theme) styles() styles {
|
||||
Foreground(lipgloss.Color(t.Muted)),
|
||||
|
||||
Activity: lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color(t.Background)).
|
||||
Background(lipgloss.Color(t.Title)).
|
||||
Foreground(lipgloss.Color(t.Muted)).
|
||||
Padding(0, 1),
|
||||
|
||||
Header: lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color(t.Title)),
|
||||
|
||||
ModelMeta: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Text)).
|
||||
Background(lipgloss.Color(t.SurfaceAlt)).
|
||||
Foreground(lipgloss.Color(t.Muted)).
|
||||
Padding(0, 1),
|
||||
|
||||
Footer: lipgloss.NewStyle().
|
||||
@@ -141,9 +165,51 @@ func (t theme) styles() styles {
|
||||
|
||||
CommandHint: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Muted)).
|
||||
Padding(0, 1),
|
||||
|
||||
StatusReady: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Assistant)),
|
||||
|
||||
StatusWarn: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Tool)),
|
||||
|
||||
StatusError: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Error)),
|
||||
|
||||
StatusInfo: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.User)),
|
||||
|
||||
Pill: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Text)).
|
||||
Background(lipgloss.Color(t.SurfaceAlt)).
|
||||
Padding(0, 1),
|
||||
|
||||
PillAccent: lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color(t.Title)).
|
||||
Background(lipgloss.Color(t.SurfaceAlt)).
|
||||
Padding(0, 1),
|
||||
|
||||
Palette: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Text)).
|
||||
Border(lipgloss.ThickBorder()).
|
||||
BorderForeground(lipgloss.Color(t.Border)).
|
||||
Padding(0, 2),
|
||||
|
||||
PaletteMatch: lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color(t.User)),
|
||||
|
||||
ToolName: lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color(t.Tool)),
|
||||
|
||||
ToolKey: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Muted)),
|
||||
|
||||
ToolValue: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color(t.Text)),
|
||||
|
||||
UserLabel: labelStyle(t.User),
|
||||
ToolLabel: labelStyle(t.Tool),
|
||||
ErrorLabel: labelStyle(t.Error),
|
||||
|
||||
Reference in New Issue
Block a user