Documentation
¶
Index ¶
- func CycleTheme() tea.Cmd
- func GetThemeList(manager *ThemeManager) tea.Cmd
- func NotifyThemeChange(oldTheme, newTheme *Theme) tea.Msg
- func RegisterBuiltinThemes(manager *ThemeManager) error
- func SwitchTheme(name string) tea.Cmd
- func ThemeError(err error) tea.Msg
- type BorderSet
- type ColorPalette
- type CycleThemeMsg
- type ErrInvalidTheme
- type RenderHelpers
- func (r *RenderHelpers) BorderStyle() lipgloss.Style
- func (r *RenderHelpers) CenteredTextStyle() lipgloss.Style
- func (r *RenderHelpers) DisabledStyle() lipgloss.Style
- func (r *RenderHelpers) ErrorStyle() lipgloss.Style
- func (r *RenderHelpers) FormatAssistantMessage(content string) string
- func (r *RenderHelpers) FormatError(err error) string
- func (r *RenderHelpers) FormatInfo(message string) string
- func (r *RenderHelpers) FormatSuccess(message string) string
- func (r *RenderHelpers) FormatSystemMessage(content string) string
- func (r *RenderHelpers) FormatThemeIndicator() string
- func (r *RenderHelpers) FormatUserMessage(content string) string
- func (r *RenderHelpers) FormatWarning(message string) string
- func (r *RenderHelpers) GetTheme() *Theme
- func (r *RenderHelpers) HelpHintStyle() lipgloss.Style
- func (r *RenderHelpers) InputPromptStyle() lipgloss.Style
- func (r *RenderHelpers) LSPConnectedStyle() lipgloss.Style
- func (r *RenderHelpers) LSPConnectingStyle() lipgloss.Style
- func (r *RenderHelpers) LSPDisconnectedStyle() lipgloss.Style
- func (r *RenderHelpers) LSPErrorStyle() lipgloss.Style
- func (r *RenderHelpers) LoadingStyle() lipgloss.Style
- func (r *RenderHelpers) PlaceholderStyle() lipgloss.Style
- func (r *RenderHelpers) QuitStyle() lipgloss.Style
- func (r *RenderHelpers) ReadyStyle() lipgloss.Style
- func (r *RenderHelpers) ScrollIndicatorStyle() lipgloss.Style
- func (r *RenderHelpers) SeparatorStyle() lipgloss.Style
- func (r *RenderHelpers) SetTheme(theme *Theme)
- func (r *RenderHelpers) StatusBarStyle() lipgloss.Style
- func (r *RenderHelpers) StreamingIndicatorStyle() lipgloss.Style
- func (r *RenderHelpers) ThemeIndicatorStyle() lipgloss.Style
- type SpacingSet
- type StyleSet
- type SwitchThemeMsg
- type Theme
- type ThemeChangeListener
- type ThemeChangeMsg
- type ThemeConfig
- type ThemeErrorMsg
- type ThemeListMsg
- type ThemeManager
- func (tm *ThemeManager) AddListener(listener ThemeChangeListener)
- func (tm *ThemeManager) ClearListeners()
- func (tm *ThemeManager) CurrentTheme() *Theme
- func (tm *ThemeManager) CycleTheme() error
- func (tm *ThemeManager) GetTheme(name string) (*Theme, error)
- func (tm *ThemeManager) GetThemeCount() int
- func (tm *ThemeManager) HasTheme(name string) bool
- func (tm *ThemeManager) ListThemes() []string
- func (tm *ThemeManager) LoadConfig() error
- func (tm *ThemeManager) LoadFromFile(path string) error
- func (tm *ThemeManager) RegisterTheme(theme *Theme) error
- func (tm *ThemeManager) RemoveListener(listener ThemeChangeListener)
- func (tm *ThemeManager) ResetToDefault() error
- func (tm *ThemeManager) SaveConfig() error
- func (tm *ThemeManager) SaveToFile(path string) error
- func (tm *ThemeManager) SetTheme(name string) error
- func (tm *ThemeManager) UnregisterTheme(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CycleTheme ¶
CycleTheme creates a command to cycle to the next theme
func GetThemeList ¶
func GetThemeList(manager *ThemeManager) tea.Cmd
GetThemeList creates a command to get the list of available themes
func NotifyThemeChange ¶
NotifyThemeChange creates a theme change message
func RegisterBuiltinThemes ¶
func RegisterBuiltinThemes(manager *ThemeManager) error
RegisterBuiltinThemes registers all built-in themes with a theme manager
func SwitchTheme ¶
SwitchTheme creates a command to switch to a specific theme
Types ¶
type BorderSet ¶
type BorderSet struct {
Normal lipgloss.Border
Rounded lipgloss.Border
Thick lipgloss.Border
Double lipgloss.Border
Hidden lipgloss.Border
}
BorderSet contains border styles for different contexts
type ColorPalette ¶
type ColorPalette struct {
// Base colors
Background lipgloss.Color
Foreground lipgloss.Color
// Semantic colors
Primary lipgloss.Color
Secondary lipgloss.Color
Accent lipgloss.Color
// Status colors
Success lipgloss.Color
Warning lipgloss.Color
Error lipgloss.Color
Info lipgloss.Color
// UI element colors
Border lipgloss.Color
Selection lipgloss.Color
Cursor lipgloss.Color
Highlight lipgloss.Color
Muted lipgloss.Color
Disabled lipgloss.Color
// Component-specific
StatusBar lipgloss.Color
DialogBackdrop lipgloss.Color
ButtonActive lipgloss.Color
ButtonInactive lipgloss.Color
InputBorder lipgloss.Color
InputFocus lipgloss.Color
// Code syntax highlighting
CodeKeyword lipgloss.Color
CodeString lipgloss.Color
CodeComment lipgloss.Color
CodeFunction lipgloss.Color
CodeNumber lipgloss.Color
CodeType lipgloss.Color
CodeVariable lipgloss.Color
CodeOperator lipgloss.Color
// Thinking blocks
ThinkingBorder lipgloss.Color
ThinkingBackground lipgloss.Color
ThinkingText lipgloss.Color
ThinkingHeader lipgloss.Color
// Help system
HelpTitle lipgloss.Color
HelpCategory lipgloss.Color
HelpKey lipgloss.Color
HelpDesc lipgloss.Color
HelpHint lipgloss.Color
}
ColorPalette contains all semantic colors used throughout the application
type ErrInvalidTheme ¶
type ErrInvalidTheme struct {
Reason string
}
ErrInvalidTheme represents an invalid theme error
func (ErrInvalidTheme) Error ¶
func (e ErrInvalidTheme) Error() string
type RenderHelpers ¶
type RenderHelpers struct {
// contains filtered or unexported fields
}
RenderHelpers provides theme-aware rendering utilities
func NewRenderHelpers ¶
func NewRenderHelpers(theme *Theme) *RenderHelpers
NewRenderHelpers creates a new render helpers instance
func (*RenderHelpers) BorderStyle ¶
func (r *RenderHelpers) BorderStyle() lipgloss.Style
BorderStyle returns a border style using theme colors
func (*RenderHelpers) CenteredTextStyle ¶
func (r *RenderHelpers) CenteredTextStyle() lipgloss.Style
CenteredTextStyle returns a centered text style
func (*RenderHelpers) DisabledStyle ¶
func (r *RenderHelpers) DisabledStyle() lipgloss.Style
DisabledStyle returns a disabled style using theme colors
func (*RenderHelpers) ErrorStyle ¶
func (r *RenderHelpers) ErrorStyle() lipgloss.Style
ErrorStyle returns an error style using theme colors
func (*RenderHelpers) FormatAssistantMessage ¶
func (r *RenderHelpers) FormatAssistantMessage(content string) string
FormatAssistantMessage formats an assistant message using theme colors
func (*RenderHelpers) FormatError ¶
func (r *RenderHelpers) FormatError(err error) string
FormatError formats an error message using theme colors
func (*RenderHelpers) FormatInfo ¶
func (r *RenderHelpers) FormatInfo(message string) string
FormatInfo formats an info message using theme colors
func (*RenderHelpers) FormatSuccess ¶
func (r *RenderHelpers) FormatSuccess(message string) string
FormatSuccess formats a success message using theme colors
func (*RenderHelpers) FormatSystemMessage ¶
func (r *RenderHelpers) FormatSystemMessage(content string) string
FormatSystemMessage formats a system message using theme colors
func (*RenderHelpers) FormatThemeIndicator ¶
func (r *RenderHelpers) FormatThemeIndicator() string
FormatThemeIndicator formats the current theme name for display
func (*RenderHelpers) FormatUserMessage ¶
func (r *RenderHelpers) FormatUserMessage(content string) string
FormatUserMessage formats a user message using theme colors
func (*RenderHelpers) FormatWarning ¶
func (r *RenderHelpers) FormatWarning(message string) string
FormatWarning formats a warning message using theme colors
func (*RenderHelpers) GetTheme ¶
func (r *RenderHelpers) GetTheme() *Theme
GetTheme returns the current theme
func (*RenderHelpers) HelpHintStyle ¶
func (r *RenderHelpers) HelpHintStyle() lipgloss.Style
HelpHintStyle returns a help hint style using theme colors
func (*RenderHelpers) InputPromptStyle ¶
func (r *RenderHelpers) InputPromptStyle() lipgloss.Style
InputPromptStyle returns an input prompt style using theme colors
func (*RenderHelpers) LSPConnectedStyle ¶
func (r *RenderHelpers) LSPConnectedStyle() lipgloss.Style
LSPConnectedStyle returns an LSP connected indicator style
func (*RenderHelpers) LSPConnectingStyle ¶
func (r *RenderHelpers) LSPConnectingStyle() lipgloss.Style
LSPConnectingStyle returns an LSP connecting indicator style
func (*RenderHelpers) LSPDisconnectedStyle ¶
func (r *RenderHelpers) LSPDisconnectedStyle() lipgloss.Style
LSPDisconnectedStyle returns an LSP disconnected indicator style
func (*RenderHelpers) LSPErrorStyle ¶
func (r *RenderHelpers) LSPErrorStyle() lipgloss.Style
LSPErrorStyle returns an LSP error indicator style
func (*RenderHelpers) LoadingStyle ¶
func (r *RenderHelpers) LoadingStyle() lipgloss.Style
LoadingStyle returns a loading message style
func (*RenderHelpers) PlaceholderStyle ¶
func (r *RenderHelpers) PlaceholderStyle() lipgloss.Style
PlaceholderStyle returns a placeholder text style
func (*RenderHelpers) QuitStyle ¶
func (r *RenderHelpers) QuitStyle() lipgloss.Style
QuitStyle returns a quit message style
func (*RenderHelpers) ReadyStyle ¶
func (r *RenderHelpers) ReadyStyle() lipgloss.Style
ReadyStyle returns a ready indicator style
func (*RenderHelpers) ScrollIndicatorStyle ¶
func (r *RenderHelpers) ScrollIndicatorStyle() lipgloss.Style
ScrollIndicatorStyle returns a scroll indicator style
func (*RenderHelpers) SeparatorStyle ¶
func (r *RenderHelpers) SeparatorStyle() lipgloss.Style
SeparatorStyle returns a separator style using theme colors
func (*RenderHelpers) SetTheme ¶
func (r *RenderHelpers) SetTheme(theme *Theme)
SetTheme updates the theme
func (*RenderHelpers) StatusBarStyle ¶
func (r *RenderHelpers) StatusBarStyle() lipgloss.Style
StatusBarStyle returns a status bar style using theme colors
func (*RenderHelpers) StreamingIndicatorStyle ¶
func (r *RenderHelpers) StreamingIndicatorStyle() lipgloss.Style
StreamingIndicatorStyle returns a streaming indicator style
func (*RenderHelpers) ThemeIndicatorStyle ¶
func (r *RenderHelpers) ThemeIndicatorStyle() lipgloss.Style
ThemeIndicatorStyle returns a theme name indicator style
type SpacingSet ¶
SpacingSet contains spacing values for consistent layout
type StyleSet ¶
type StyleSet struct {
// Text styles
Title lipgloss.Style
Subtitle lipgloss.Style
Body lipgloss.Style
Code lipgloss.Style
Muted lipgloss.Style
Bold lipgloss.Style
Italic lipgloss.Style
// Button styles
Button lipgloss.Style
ButtonFocused lipgloss.Style
ButtonActive lipgloss.Style
// Status styles
StatusBar lipgloss.Style
Success lipgloss.Style
Warning lipgloss.Style
Error lipgloss.Style
Info lipgloss.Style
// Dialog styles
Dialog lipgloss.Style
DialogTitle lipgloss.Style
DialogDesc lipgloss.Style
DialogBackdrop lipgloss.Style
InputField lipgloss.Style
InputFieldFocus lipgloss.Style
// List styles
ListItem lipgloss.Style
ListItemSelected lipgloss.Style
ListItemHover lipgloss.Style
// Thinking styles
ThinkingBlock lipgloss.Style
ThinkingHeader lipgloss.Style
ThinkingCollapsed lipgloss.Style
ThinkingExpanded lipgloss.Style
// Help styles
HelpBox lipgloss.Style
HelpTitle lipgloss.Style
HelpCategory lipgloss.Style
HelpKey lipgloss.Style
HelpDesc lipgloss.Style
}
StyleSet contains pre-built lipgloss.Style objects for common UI elements
type SwitchThemeMsg ¶
type SwitchThemeMsg struct {
ThemeName string
}
SwitchThemeMsg triggers a theme switch by name
type Theme ¶
type Theme struct {
Name string
Colors ColorPalette
Styles StyleSet
Borders BorderSet
Spacing SpacingSet
}
Theme defines all colors, styles, and visual properties for the TUI
func AINativeTheme ¶
func AINativeTheme() *Theme
AINativeTheme returns the branded AINative purple theme (DEFAULT) This theme showcases the AINative brand with purple accents and dark background
func DarkTheme ¶
func DarkTheme() *Theme
DarkTheme returns the default dark theme Classic dark theme with blue accents, inspired by popular terminals
func GetAllBuiltinThemes ¶
func GetAllBuiltinThemes() []*Theme
GetAllBuiltinThemes returns all built-in themes
func LightTheme ¶
func LightTheme() *Theme
LightTheme returns a clean light theme for daytime use Professional light theme with good contrast and readability
func NewTheme ¶
func NewTheme(name string, colors ColorPalette) *Theme
NewTheme creates a new theme with the given name and color palette
type ThemeChangeListener ¶
type ThemeChangeListener interface {
OnThemeChange(oldTheme, newTheme *Theme)
}
ThemeChangeListener is notified when the theme changes
type ThemeChangeMsg ¶
ThemeChangeMsg is sent when the theme changes Components should listen for this message and rebuild their styles
type ThemeConfig ¶
type ThemeConfig struct {
CurrentTheme string `json:"current_theme"`
Version string `json:"version"`
}
ThemeConfig represents the persisted theme configuration
type ThemeErrorMsg ¶
type ThemeErrorMsg struct {
Err error
}
ThemeErrorMsg indicates a theme-related error
type ThemeListMsg ¶
type ThemeListMsg struct {
Themes []string
}
ThemeListMsg returns the list of available themes
type ThemeManager ¶
type ThemeManager struct {
// contains filtered or unexported fields
}
ThemeManager handles theme registration, switching, and persistence
func NewThemeManager ¶
func NewThemeManager() *ThemeManager
NewThemeManager creates a new theme manager
func (*ThemeManager) AddListener ¶
func (tm *ThemeManager) AddListener(listener ThemeChangeListener)
AddListener registers a theme change listener
func (*ThemeManager) ClearListeners ¶
func (tm *ThemeManager) ClearListeners()
ClearListeners removes all theme change listeners
func (*ThemeManager) CurrentTheme ¶
func (tm *ThemeManager) CurrentTheme() *Theme
CurrentTheme returns the currently active theme
func (*ThemeManager) CycleTheme ¶
func (tm *ThemeManager) CycleTheme() error
CycleTheme switches to the next theme in the list
func (*ThemeManager) GetTheme ¶
func (tm *ThemeManager) GetTheme(name string) (*Theme, error)
GetTheme returns a theme by name
func (*ThemeManager) GetThemeCount ¶
func (tm *ThemeManager) GetThemeCount() int
GetThemeCount returns the number of registered themes
func (*ThemeManager) HasTheme ¶
func (tm *ThemeManager) HasTheme(name string) bool
HasTheme checks if a theme is registered
func (*ThemeManager) ListThemes ¶
func (tm *ThemeManager) ListThemes() []string
ListThemes returns a list of all registered theme names
func (*ThemeManager) LoadConfig ¶
func (tm *ThemeManager) LoadConfig() error
LoadConfig loads theme configuration from default location
func (*ThemeManager) LoadFromFile ¶
func (tm *ThemeManager) LoadFromFile(path string) error
LoadFromFile loads theme configuration from a file
func (*ThemeManager) RegisterTheme ¶
func (tm *ThemeManager) RegisterTheme(theme *Theme) error
RegisterTheme registers a new theme
func (*ThemeManager) RemoveListener ¶
func (tm *ThemeManager) RemoveListener(listener ThemeChangeListener)
RemoveListener unregisters a theme change listener
func (*ThemeManager) ResetToDefault ¶
func (tm *ThemeManager) ResetToDefault() error
ResetToDefault resets to the first registered theme (usually the default)
func (*ThemeManager) SaveConfig ¶
func (tm *ThemeManager) SaveConfig() error
SaveConfig saves theme configuration to default location
func (*ThemeManager) SaveToFile ¶
func (tm *ThemeManager) SaveToFile(path string) error
SaveToFile saves the current theme configuration to a file
func (*ThemeManager) SetTheme ¶
func (tm *ThemeManager) SetTheme(name string) error
SetTheme switches to a different theme by name
func (*ThemeManager) UnregisterTheme ¶
func (tm *ThemeManager) UnregisterTheme(name string) error
UnregisterTheme removes a theme from the manager