Documentation
¶
Overview ¶
Package tui provides the Bubbletea TUI for interactive Claude sessions.
Index ¶
- func ComputeUnifiedDiff(path, oldContent, newContent string) string
- func RenderDiff(diff string, theme Theme) string
- type ApprovalDialog
- type KeyMap
- type Model
- type State
- type StatusBar
- type Theme
- func (t Theme) AccentStyle() lipgloss.Style
- func (t Theme) ChromaStyle() *chroma.Style
- func (t Theme) DiffAddStyle() lipgloss.Style
- func (t Theme) DiffHeaderStyle() lipgloss.Style
- func (t Theme) DiffRemoveStyle() lipgloss.Style
- func (t Theme) ErrorStyle() lipgloss.Style
- func (t Theme) HighlightStyle() lipgloss.Style
- func (t Theme) MutedStyle() lipgloss.Style
- func (t Theme) SuccessStyle() lipgloss.Style
- func (t Theme) TextStyle() lipgloss.Style
- func (t Theme) WarningStyle() lipgloss.Style
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeUnifiedDiff ¶
ComputeUnifiedDiff creates a simple unified diff between old and new content.
func RenderDiff ¶
RenderDiff colorizes a unified diff string using the theme.
Types ¶
type ApprovalDialog ¶
type ApprovalDialog struct {
Request claude.EventToolRequest
Selected int // 0 = Accept, 1 = Reject
Theme Theme
Width int
}
ApprovalDialog renders a tool approval prompt.
func (ApprovalDialog) View ¶
func (a ApprovalDialog) View() string
View renders the approval dialog.
type KeyMap ¶
type KeyMap struct {
Quit key.Binding
AutoAccept key.Binding
Approve key.Binding
Reject key.Binding
ScrollUp key.Binding
ScrollDown key.Binding
}
KeyMap defines all keybindings for the TUI.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root Bubbletea model for the Claude session TUI.
type Theme ¶
type Theme struct {
Bg lipgloss.Color
Fg lipgloss.Color
Accent lipgloss.Color
Success lipgloss.Color
Error lipgloss.Color
Warning lipgloss.Color
Muted lipgloss.Color
Highlight lipgloss.Color
}
Theme holds the color scheme for the TUI.
func LoadTheme ¶
func LoadTheme() Theme
LoadTheme loads colors with the following priority (highest to lowest):
- ~/.hydra.yml colors (explicit user override)
- pywal ~/.cache/wal/colors.json
- DefaultTheme() hardcoded values
func (Theme) AccentStyle ¶
AccentStyle returns a style for accented text.
func (Theme) ChromaStyle ¶
ChromaStyle returns a chroma syntax-highlighting style derived from the theme. When pywal is active (~/.cache/wal/colors.json exists), the style automatically uses the pywal palette via LoadTheme. The mapping is:
color1 (Error) → keywords, operators color2 (Success) → strings, attributes color3 (Warning) → literals, dates color4 (Accent) → tags, builtins, headings color5 (Highlight) → numbers color8 (Muted) → comments
func (Theme) DiffAddStyle ¶
DiffAddStyle returns a style for added diff lines.
func (Theme) DiffHeaderStyle ¶
DiffHeaderStyle returns a style for diff headers.
func (Theme) DiffRemoveStyle ¶
DiffRemoveStyle returns a style for removed diff lines.
func (Theme) ErrorStyle ¶
ErrorStyle returns a style for error text.
func (Theme) HighlightStyle ¶
HighlightStyle returns a style for highlighted text.
func (Theme) MutedStyle ¶
MutedStyle returns a style for muted/secondary text.
func (Theme) SuccessStyle ¶
SuccessStyle returns a style for success text.
func (Theme) WarningStyle ¶
WarningStyle returns a style for warning text.