Files
gastown/internal/style/style.go
Ryan Snodgrass e1f2bb8b4b feat(ui): import comprehensive UX system from beads
Import beads' UX design system into gastown:

- Add internal/ui/ package with Ayu theme colors and semantic styling
  - styles.go: AdaptiveColor definitions for light/dark mode
  - terminal.go: TTY detection, NO_COLOR/CLICOLOR support
  - markdown.go: Glamour rendering with agent mode bypass
  - pager.go: Smart paging with GT_PAGER support

- Add colorized help output (internal/cmd/help.go)
  - Group headers in accent color
  - Command names styled for scannability
  - Flag types and defaults muted

- Add gt thanks command (internal/cmd/thanks.go)
  - Contributor display with same logic as bd thanks
  - Styled with Ayu theme colors

- Update gt doctor to match bd doctor UX
  - Category grouping (Core, Infrastructure, Rig, Patrol, etc.)
  - Semantic icons (✓ ⚠ ✖) with Ayu colors
  - Tree connectors for detail lines
  - Summary line with pass/warn/fail counts
  - Warnings section at end with numbered issues

- Migrate existing styles to use ui package
  - internal/style/style.go uses ui.ColorPass etc.
  - internal/tui/feed/styles.go uses ui package colors

Co-Authored-By: SageOx <ox@sageox.ai>
2026-01-09 22:46:06 -08:00

59 lines
1.5 KiB
Go

// Package style provides consistent terminal styling using Lipgloss.
// Uses the Ayu theme colors from internal/ui for semantic consistency.
package style
import (
"fmt"
"github.com/charmbracelet/lipgloss"
"github.com/steveyegge/gastown/internal/ui"
)
var (
// Success style for positive outcomes (green)
Success = lipgloss.NewStyle().
Foreground(ui.ColorPass).
Bold(true)
// Warning style for cautionary messages (yellow)
Warning = lipgloss.NewStyle().
Foreground(ui.ColorWarn).
Bold(true)
// Error style for failures (red)
Error = lipgloss.NewStyle().
Foreground(ui.ColorFail).
Bold(true)
// Info style for informational messages (blue)
Info = lipgloss.NewStyle().
Foreground(ui.ColorAccent)
// Dim style for secondary information (gray)
Dim = lipgloss.NewStyle().
Foreground(ui.ColorMuted)
// Bold style for emphasis
Bold = lipgloss.NewStyle().
Bold(true)
// SuccessPrefix is the checkmark prefix for success messages
SuccessPrefix = Success.Render(ui.IconPass)
// WarningPrefix is the warning prefix
WarningPrefix = Warning.Render(ui.IconWarn)
// ErrorPrefix is the error prefix
ErrorPrefix = Error.Render(ui.IconFail)
// ArrowPrefix for action indicators
ArrowPrefix = Info.Render("→")
)
// PrintWarning prints a warning message with consistent formatting.
// The format and args work like fmt.Printf.
func PrintWarning(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
fmt.Printf("%s %s\n", Warning.Render(ui.IconWarn+" Warning:"), msg)
}