Documentation
¶
Index ¶
- Constants
- Variables
- func CreatePaneStyle(isActive bool, width, height int) lipgloss.Style
- func FillTerminal(content string, width, height int) string
- func FormatShortDateTime(t time.Time) string
- func LoadOmarchyTheme() error
- func RenderPaneTitle(title string, isActive bool) string
- func RenderSizeError(minW, minH, curW, curH int) string
- type ButtonRegion
- type ChatLayout
- type KeyBinding
- type KeyBindingSet
- type Theme
- func (t Theme) AccentStyle() lipgloss.Style
- func (t Theme) ActionButtonStyle(width int) lipgloss.Style
- func (t Theme) ButtonStyle() lipgloss.Style
- func (t Theme) ChannelHeaderStyle(width, height int, borderColor color.Color) lipgloss.Style
- func (t Theme) ErrorStyle() lipgloss.Style
- func (t Theme) HeaderStyle(width int) lipgloss.Style
- func (t Theme) HeaderTitleStyle() lipgloss.Style
- func (t Theme) KeyDescStyle() lipgloss.Style
- func (t Theme) KeyStyle() lipgloss.Style
- func (t Theme) ListMentionStyle() lipgloss.Style
- func (t Theme) ListNormalStyle() lipgloss.Style
- func (t Theme) ListSelectedStyle() lipgloss.Style
- func (t Theme) ListUnreadStyle() lipgloss.Style
- func (t Theme) MentionCountStyle() lipgloss.Style
- func (t Theme) MentionDot() string
- func (t Theme) MessageNameStyle() lipgloss.Style
- func (t Theme) MessageTimeStyle() lipgloss.Style
- func (t Theme) ModalBoxStyle(width int) lipgloss.Style
- func (t Theme) ModalHintStyle() lipgloss.Style
- func (t Theme) ModalLabelStyle() lipgloss.Style
- func (t Theme) ModalTitleStyle() lipgloss.Style
- func (t Theme) MutedStyle() lipgloss.Style
- func (t Theme) OfflineDot() string
- func (t Theme) OnlineDot() string
- func (t Theme) PrimaryStyle() lipgloss.Style
- func (t Theme) ScrollThumbStyle() lipgloss.Style
- func (t Theme) ScrollTrackStyle() lipgloss.Style
- func (t Theme) SecondaryStyle() lipgloss.Style
- func (t Theme) SuccessStyle() lipgloss.Style
- func (t Theme) TabActiveStyle() lipgloss.Style
- func (t Theme) TabBaseStyle() lipgloss.Style
- func (t Theme) TabInactiveStyle() lipgloss.Style
- func (t Theme) TextDimStyle() lipgloss.Style
- func (t Theme) TextStyle() lipgloss.Style
- func (t Theme) UnreadCountStyle() lipgloss.Style
- func (t Theme) UnreadDot() string
Constants ¶
const ( MinWidth = 40 MinHeight = 12 SkinnyWidth = 96 // below this, sidebar and help bar buttons are hidden SidebarRatio = 0.25 MinSidebarW = 48 HeaderHeight = 3 ChannelHeaderH = 3 // channel name box above messages HelpHeight = 3 PaneGap = 1 // gap between sidebar and message pane PaneTitleH = 2 // title line + 1 blank line )
Variables ¶
var CurrentTheme = Theme{ Primary: lipgloss.Color("#D4A04A"), Secondary: lipgloss.Color("#5A5E6B"), Muted: lipgloss.Color("#3E4250"), Accent: lipgloss.Color("#E8B84B"), Text: lipgloss.Color("#C8CCD4"), TextDim: lipgloss.Color("#6B7080"), BgDark: lipgloss.Color("#1A1C24"), Error: lipgloss.Color("#E05252"), Success: lipgloss.Color("#50C878"), }
CurrentTheme is the active application theme.
Functions ¶
func CreatePaneStyle ¶
CreatePaneStyle returns a bordered style for active or inactive panes.
func FillTerminal ¶
FillTerminal places content centered in the terminal dimensions.
func FormatShortDateTime ¶
FormatShortDateTime formats a time in local timezone.
func LoadOmarchyTheme ¶
func LoadOmarchyTheme() error
LoadOmarchyTheme reads the Omarchy system theme and applies it to CurrentTheme. Returns an error if the file cannot be found or parsed; callers should ignore the error to fall back to the default theme on non-Omarchy systems.
func RenderPaneTitle ¶
RenderPaneTitle renders a pane title with theme styling.
func RenderSizeError ¶
RenderSizeError renders a centered error box when the terminal is too small.
Types ¶
type ButtonRegion ¶
ButtonRegion describes the horizontal hit area of a rendered button.
type ChatLayout ¶
type ChatLayout struct {
SidebarW int
MessageW int
ContentH int // Height available for sidebar and message pane
HelpH int
TotalW int
TotalH int
Skinny bool // true when terminal is too narrow for sidebar/help buttons
}
ChatLayout holds calculated dimensions for the chat UI.
func CalculateChatLayout ¶
func CalculateChatLayout(termW, termH int) ChatLayout
CalculateChatLayout computes panel dimensions from terminal size.
func CalculateChatLayoutWithSidebar ¶
func CalculateChatLayoutWithSidebar(termW, termH, sidebarOverride int) ChatLayout
CalculateChatLayoutWithSidebar computes panel dimensions with an optional sidebar width override. Pass 0 to use the default ratio-based calculation.
type KeyBinding ¶
type KeyBinding struct {
Key string // Display name (e.g., "Ctrl+j")
Keys []string // Actual key strings to match (e.g., "ctrl+j")
Description string
}
KeyBinding represents a single key binding with its display info.
type KeyBindingSet ¶
type KeyBindingSet struct {
Bindings []KeyBinding
}
KeyBindingSet is an ordered collection of key bindings.
func (KeyBindingSet) ButtonRegions ¶
func (kbs KeyBindingSet) ButtonRegions() []ButtonRegion
ButtonRegions returns the X start/end positions for each button in the rendered help bar. Used for mouse click hit testing.
func (KeyBindingSet) Contains ¶
func (kbs KeyBindingSet) Contains(key string) *KeyBinding
Contains checks if a keypress string matches any binding in the set.
func (KeyBindingSet) Render ¶
func (kbs KeyBindingSet) Render() string
Render formats the key binding set as bordered buttons.
type Theme ¶
type Theme struct {
Primary color.Color // Active elements, selection
Secondary color.Color // Borders, inactive text
Muted color.Color // Dimmed elements, help text
Accent color.Color // Unread indicators, alerts
Text color.Color // Primary text
TextDim color.Color // Secondary text
BgDark color.Color // Dark background areas
Error color.Color // Error states, recording, disconnected
Success color.Color // Success states, online indicators
}
Theme holds the application color palette and provides all style builders.