docs/UI_PHILOSOPHY.md
Beads CLI follows Tufte-inspired design principles for terminal output, using semantic color tokens with adaptive light/dark mode support via Lipgloss.
Only color what demands attention. Every colored element should serve a purpose:
Anti-pattern: Coloring everything defeats the purpose and creates cognitive overload.
Use meaning-based tokens, not raw colors:
| Token | Semantic Meaning | Use Cases |
|---|---|---|
Pass | Success, completion, ready | Checkmarks, completed items, healthy status |
Warn | Attention needed, caution | Warnings, in-progress items, action required |
Fail | Error, blocked, critical | Errors, blocked items, failures |
Accent | Navigation, emphasis | Headers, links, key information |
Muted | De-emphasized, secondary | Defaults, closed items, metadata |
Command | Interactive elements | Command names, flags |
Lipgloss AdaptiveColor ensures optimal contrast in both terminal modes:
ColorPass = lipgloss.AdaptiveColor{
Light: "#86b300", // Darker green for light backgrounds
Dark: "#c2d94c", // Brighter green for dark backgrounds
}
Why this matters:
Let whitespace and position do most of the work:
| Situation | Style | Rationale |
|---|---|---|
| Navigation landmarks | Accent | Helps users orient in output |
| Command/flag names | Bold | Creates vertical scan targets |
| Success indicators | Pass (green) | Immediate positive feedback |
| Warnings | Warn (yellow) | Draws attention without alarm |
| Errors | Fail (red) | Demands immediate attention |
| Closed/done items | Muted | Visually recedes, "done" |
| High priority (P0/P1) | Semantic color | Only urgent items deserve color |
| Normal priority (P2+) | Plain | Most items don't need highlighting |
All colors use the Ayu theme for consistency:
// Semantic colors with light/dark adaptation
ColorPass = AdaptiveColor{Light: "#86b300", Dark: "#c2d94c"} // Green
ColorWarn = AdaptiveColor{Light: "#f2ae49", Dark: "#ffb454"} // Yellow
ColorFail = AdaptiveColor{Light: "#f07171", Dark: "#f07178"} // Red
ColorAccent = AdaptiveColor{Light: "#399ee6", Dark: "#59c2ff"} // Blue
ColorMuted = AdaptiveColor{Light: "#828c99", Dark: "#6c7680"} // Gray
All styling is centralized in internal/ui/styles.go:
// Render functions for semantic styling
ui.RenderPass("✓") // Success indicator
ui.RenderWarn("⚠") // Warning indicator
ui.RenderFail("✗") // Error indicator
ui.RenderAccent("→") // Accent/link
ui.RenderMuted("...") // Secondary info
ui.RenderBold("name") // Emphasis
ui.RenderCommand("bd") // Command reference
Following Tufte's principle of layered information:
Flags:, Examples:) - Accent color for navigation--file) - Bold for scannabilitystring) - Muted, reference info(default: ...)) - Muted, secondary