Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyModeAll(bindings []HintBinding)
- func ColumnsFit(cols []table.Column, width int) bool
- func CycleTheme() string
- func GradientText(text string, colors []color.Color) string
- func HuhTheme() huh.ThemeFunc
- func RebuildStyles()
- func RenderGradientLine(width int) string
- func RenderHeader(data HeaderData) string
- func RenderStatusBar(data StatusBarData) string
- func SortKeyBytes(size int64) string
- func StateColor(state string) string
- type AppKeyMap
- type CommandBar
- func (c *CommandBar) AddHistory(cmd string)
- func (c *CommandBar) Hide()
- func (c *CommandBar) Show(commands []CommandEntry, width int)
- func (c CommandBar) Update(msg tea.Msg) (CommandBar, tea.Cmd)
- func (c CommandBar) ViewInput(width int) string
- func (c CommandBar) ViewSuggestions() string
- func (c CommandBar) Visible() bool
- type CommandBarResultMsg
- type CommandEntry
- type Confirm
- type ConfirmResultMsg
- type ContentFormat
- type ContentLink
- type ContentLinkActivatedMsg
- type ContentView
- func (cv *ContentView) CancelVisual()
- func (cv ContentView) HasLinkAtCursor() bool
- func (cv ContentView) InVisualMode() bool
- func (cv ContentView) OpenInEditorCmd() tea.Cmd
- func (cv ContentView) Raw() string
- func (cv *ContentView) SetContent(title, content string, format ContentFormat)
- func (cv *ContentView) SetEmbedded(v bool)
- func (cv *ContentView) SetLinks(links map[int]ContentLink)
- func (cv *ContentView) SetSize(w, h int)
- func (cv *ContentView) ToggleLineNumbers()
- func (cv *ContentView) ToggleWrap()
- func (cv ContentView) Update(msg tea.Msg) (ContentView, tea.Cmd)
- func (cv ContentView) View() string
- type ContentViewKeyMap
- type Detail
- type DetailField
- type EditorFinishedMsg
- type Filter
- func (f *Filter) Activate()
- func (f Filter) Active() bool
- func (f *Filter) Deactivate()
- func (f *Filter) DeactivateKeepValue()
- func (f *Filter) SetValue(v string)
- func (f *Filter) SetWidth(w int)
- func (f Filter) Update(msg tea.Msg) (Filter, tea.Cmd)
- func (f Filter) Value() string
- func (f *Filter) View() string
- type FilterChangedMsg
- type FormView
- type HeaderData
- type HelpOverlay
- type HintBinding
- type HintMode
- type Picker
- type PickerOption
- type PickerResultMsg
- type ServiceIcon
- type SortDirection
- type Spinner
- type StatusBarData
- type Styles
- type TabInput
- type TabbedPanel
- func (tp TabbedPanel) ActiveTab() int
- func (tp TabbedPanel) OpenInEditorCmd() tea.Cmd
- func (tp *TabbedPanel) SetSize(w, h int)
- func (tp TabbedPanel) TabCount() int
- func (tp TabbedPanel) TabData() []TabInput
- func (tp TabbedPanel) Update(msg tea.Msg) (TabbedPanel, tea.Cmd)
- func (tp TabbedPanel) View() string
- type Table
- func (t *Table) ClearSort()
- func (t Table) Columns() []table.Column
- func (t *Table) DeselectAll()
- func (t *Table) Filter(text string)
- func (t Table) FilteredIndices() []int
- func (t Table) IsSelected(allRowIdx int) bool
- func (t Table) RowCount() (int, int)
- func (t *Table) SelectAll()
- func (t Table) SelectedAllRowIndex() int
- func (t Table) SelectedIndex() int
- func (t Table) SelectedIndices() []int
- func (t Table) SelectedRow() table.Row
- func (t Table) SelectionCount() int
- func (t *Table) SetColumns(columns []table.Column)
- func (t *Table) SetCursor(n int)
- func (t *Table) SetRows(rows []table.Row)
- func (t *Table) SetRowsWithSortKeys(rows []table.Row, sortKeys []table.Row)
- func (t *Table) SetSize(w, h int)
- func (t *Table) Sort(col int)
- func (t Table) SortColumnNames() ([]string, int)
- func (t *Table) SortNext()
- func (t *Table) SortReverse()
- func (t *Table) ToggleSelect()
- func (t *Table) ToggleSelectAll()
- func (t Table) Update(msg tea.Msg) (Table, tea.Cmd)
- func (t Table) View() string
- type Theme
- type Toast
- type ToastDismissMsg
- type ToastLevel
- type ToastManager
- type WidthTier
- type YankedMsg
Constants ¶
const MinTableRows = 5
MinTableRows is the minimum number of rows a table should display. If the terminal is too short, hide the header or status bar before shrinking the table below this threshold.
Variables ¶
var ( IconS3 = ServiceIcon{Nerd: "\U000f01bc", Fallback: "◇"} // nf-md-bucket IconEC2 = ServiceIcon{Nerd: "\U000f01c4", Fallback: "◈"} // nf-md-server IconCloud = ServiceIcon{Nerd: "\U000f015f", Fallback: "☁"} // nf-md-cloud IconShield = ServiceIcon{Nerd: "\U000f0498", Fallback: "🛡"} // nf-md-shield IconSQS = ServiceIcon{Nerd: "\U000f01ee", Fallback: "≡"} // nf-md-message_text // State indicators IconRunning = ServiceIcon{Nerd: "\U000f012c", Fallback: "●"} // nf-md-check_circle IconStopped = ServiceIcon{Nerd: "\U000f0156", Fallback: "○"} // nf-md-close_circle IconPending = ServiceIcon{Nerd: "\U000f0e4e", Fallback: "◌"} // nf-md-clock )
Service icons
var ( ErrorStyle = lipgloss.NewStyle().Foreground(ActiveTheme.Error) WarningStyle = lipgloss.NewStyle().Foreground(ActiveTheme.Warning) SuccessStyle = lipgloss.NewStyle().Foreground(ActiveTheme.Success) )
var ActiveTheme = DefaultTheme
ActiveTheme is the currently active theme. Set at startup.
var Catppuccin = Theme{ Name: "Catppuccin Mocha", Primary: lipgloss.Color("#cba6f7"), Secondary: lipgloss.Color("#585b70"), Accent: lipgloss.Color("#a6e3a1"), Error: lipgloss.Color("#f38ba8"), Warning: lipgloss.Color("#f9e2af"), Success: lipgloss.Color("#a6e3a1"), Info: lipgloss.Color("#89b4fa"), Base: lipgloss.Color("#1e1e2e"), Surface: lipgloss.Color("#313244"), Overlay: lipgloss.Color("#45475a"), Muted: lipgloss.Color("#6c7086"), Text: lipgloss.Color("#cdd6f4"), SubText: lipgloss.Color("#a6adc8"), BrightText: lipgloss.Color("#ffffff"), GradientFrom: lipgloss.Color("#cba6f7"), GradientTo: lipgloss.Color("#89b4fa"), ChromaStyle: "catppuccin-mocha", StateRunning: lipgloss.Color("#a6e3a1"), StateStopped: lipgloss.Color("#f38ba8"), StatePending: lipgloss.Color("#f9e2af"), }
var DefaultTheme = Catppuccin
DefaultTheme is the default theme.
var Dracula = Theme{ Name: "Dracula", Primary: lipgloss.Color("#bd93f9"), Secondary: lipgloss.Color("#6272a4"), Accent: lipgloss.Color("#50fa7b"), Error: lipgloss.Color("#ff5555"), Warning: lipgloss.Color("#f1fa8c"), Success: lipgloss.Color("#50fa7b"), Info: lipgloss.Color("#8be9fd"), Base: lipgloss.Color("#282a36"), Surface: lipgloss.Color("#44475a"), Overlay: lipgloss.Color("#6272a4"), Muted: lipgloss.Color("#6272a4"), Text: lipgloss.Color("#f8f8f2"), SubText: lipgloss.Color("#bfbfbf"), BrightText: lipgloss.Color("#ffffff"), GradientFrom: lipgloss.Color("#bd93f9"), GradientTo: lipgloss.Color("#ff79c6"), ChromaStyle: "dracula", StateRunning: lipgloss.Color("#50fa7b"), StateStopped: lipgloss.Color("#ff5555"), StatePending: lipgloss.Color("#f1fa8c"), }
var Nord = Theme{ Name: "Nord", Primary: lipgloss.Color("#88c0d0"), Secondary: lipgloss.Color("#4c566a"), Accent: lipgloss.Color("#a3be8c"), Error: lipgloss.Color("#bf616a"), Warning: lipgloss.Color("#ebcb8b"), Success: lipgloss.Color("#a3be8c"), Info: lipgloss.Color("#81a1c1"), Base: lipgloss.Color("#2e3440"), Surface: lipgloss.Color("#3b4252"), Overlay: lipgloss.Color("#434c5e"), Muted: lipgloss.Color("#4c566a"), Text: lipgloss.Color("#eceff4"), SubText: lipgloss.Color("#d8dee9"), BrightText: lipgloss.Color("#ffffff"), GradientFrom: lipgloss.Color("#88c0d0"), GradientTo: lipgloss.Color("#5e81ac"), ChromaStyle: "nord", StateRunning: lipgloss.Color("#a3be8c"), StateStopped: lipgloss.Color("#bf616a"), StatePending: lipgloss.Color("#ebcb8b"), }
var ReadOnly = true
ReadOnly controls whether mutating operations are blocked. Always starts true; toggled at runtime via the mode picker.
var S = NewStyles(ActiveTheme)
S is the global computed styles instance. Initialized from ActiveTheme.
var ThemeOrder = []string{"catppuccin", "dracula", "nord", "tokyonight"}
ThemeOrder defines the cycle order for theme switching.
var Themes = map[string]Theme{ "catppuccin": Catppuccin, "dracula": Dracula, "nord": Nord, "tokyonight": TokyoNight, }
Themes maps theme names to themes.
var TokyoNight = Theme{ Name: "Tokyo Night", Primary: lipgloss.Color("#7aa2f7"), Secondary: lipgloss.Color("#565f89"), Accent: lipgloss.Color("#9ece6a"), Error: lipgloss.Color("#f7768e"), Warning: lipgloss.Color("#e0af68"), Success: lipgloss.Color("#9ece6a"), Info: lipgloss.Color("#7aa2f7"), Base: lipgloss.Color("#1a1b26"), Surface: lipgloss.Color("#24283b"), Overlay: lipgloss.Color("#414868"), Muted: lipgloss.Color("#565f89"), Text: lipgloss.Color("#c0caf5"), SubText: lipgloss.Color("#a9b1d6"), BrightText: lipgloss.Color("#ffffff"), GradientFrom: lipgloss.Color("#7aa2f7"), GradientTo: lipgloss.Color("#bb9af7"), ChromaStyle: "tokyonight-night", StateRunning: lipgloss.Color("#9ece6a"), StateStopped: lipgloss.Color("#f7768e"), StatePending: lipgloss.Color("#e0af68"), }
var UseNerdFonts = true
UseNerdFonts controls whether Nerd Font icons are used. Set to true if the user's terminal has a Nerd Font patched font.
Functions ¶
func ApplyModeAll ¶ added in v0.2.0
func ApplyModeAll(bindings []HintBinding)
ApplyModeAll applies mode logic to a slice of HintBindings.
func ColumnsFit ¶ added in v0.2.0
ColumnsFit reports whether the given columns fit within the available width, accounting for the bubbles table's default cell padding (1 char each side).
func CycleTheme ¶
func CycleTheme() string
CycleTheme advances to the next theme and rebuilds styles. Returns the new theme name.
func GradientText ¶
GradientText renders text with a horizontal gradient using the theme's gradient colors.
func HuhTheme ¶ added in v0.4.0
HuhTheme returns a huh theme derived from the active LazyCloud theme.
func RebuildStyles ¶
func RebuildStyles()
RebuildStyles rebuilds the global styles from the active theme.
func RenderGradientLine ¶ added in v0.2.0
RenderGradientLine creates a thin horizontal gradient line.
func RenderHeader ¶
func RenderHeader(data HeaderData) string
RenderHeader renders the top bar with gradient branding and profile/region badges.
func RenderStatusBar ¶
func RenderStatusBar(data StatusBarData) string
RenderStatusBar renders the bottom bar with contextual keybindings. Hints that don't fit the available width are progressively dropped from the right (lowest priority), since currentKeyHints() orders view-specific hints first and global hints last.
func SortKeyBytes ¶
SortKeyBytes returns a zero-padded string suitable for numeric byte sorting.
func StateColor ¶
StateColor returns a styled state string with the appropriate color and icon.
Types ¶
type AppKeyMap ¶ added in v0.2.0
type AppKeyMap struct {
Quit HintBinding
ThemePicker HintBinding
ProfilePicker HintBinding
RegionPicker HintBinding
ModePicker HintBinding
EventLog HintBinding
CommandBar HintBinding
Help HintBinding
TabToggle HintBinding
PanelClose HintBinding
PanelEditor HintBinding
PanelGrow HintBinding
PanelShrink HintBinding
PanelReset HintBinding
}
AppKeyMap holds all app-level keybindings (global, navigation, panel).
func DefaultAppKeyMap ¶ added in v0.2.0
func DefaultAppKeyMap() AppKeyMap
DefaultAppKeyMap returns the default app-level keybindings.
type CommandBar ¶ added in v0.2.0
type CommandBar struct {
// contains filtered or unexported fields
}
CommandBar is a vim/k9s-style text input at the bottom of the screen with autocomplete suggestions and command history.
func NewCommandBar ¶ added in v0.2.0
func NewCommandBar() CommandBar
NewCommandBar creates a hidden command bar.
func (*CommandBar) AddHistory ¶ added in v0.2.0
func (c *CommandBar) AddHistory(cmd string)
AddHistory adds a command to history, deduplicating.
func (*CommandBar) Hide ¶ added in v0.2.0
func (c *CommandBar) Hide()
Hide dismisses the command bar.
func (*CommandBar) Show ¶ added in v0.2.0
func (c *CommandBar) Show(commands []CommandEntry, width int)
Show activates the command bar with the given commands.
func (CommandBar) Update ¶ added in v0.2.0
func (c CommandBar) Update(msg tea.Msg) (CommandBar, tea.Cmd)
Update handles input when the command bar is visible.
func (CommandBar) ViewInput ¶ added in v0.2.0
func (c CommandBar) ViewInput(width int) string
ViewInput renders the command input line (replaces the status bar).
func (CommandBar) ViewSuggestions ¶ added in v0.2.0
func (c CommandBar) ViewSuggestions() string
ViewSuggestions renders the suggestion dropdown. Returns "" if no suggestions.
func (CommandBar) Visible ¶ added in v0.2.0
func (c CommandBar) Visible() bool
Visible returns whether the command bar is currently shown.
type CommandBarResultMsg ¶ added in v0.2.0
type CommandBarResultMsg struct {
Value string // the command text entered
Cancelled bool // true if dismissed without executing
}
CommandBarResultMsg is emitted when the user executes or cancels the command bar.
type CommandEntry ¶ added in v0.2.0
CommandEntry is a single command available in the command bar.
type Confirm ¶
type Confirm struct {
// contains filtered or unexported fields
}
Confirm is a confirmation dialog. In normal mode, the user must type "confirm" and press enter. In quick mode, a single y/n keypress suffices.
func (*Confirm) Show ¶
Show displays the type-to-confirm dialog with the given message and action ID.
func (*Confirm) ShowQuick ¶ added in v0.4.0
ShowQuick displays a y/n confirmation dialog for non-destructive actions.
type ConfirmResultMsg ¶
ConfirmResultMsg is emitted when the user responds to a confirmation dialog.
type ContentFormat ¶
type ContentFormat string
ContentFormat identifies the content type.
const ( FormatJSON ContentFormat = "json" FormatYAML ContentFormat = "yaml" FormatMarkdown ContentFormat = "markdown" FormatHCL ContentFormat = "hcl" FormatShell ContentFormat = "bash" FormatGo ContentFormat = "go" FormatPython ContentFormat = "python" FormatText ContentFormat = "text" FormatAuto ContentFormat = "auto" )
type ContentLink ¶ added in v0.2.0
ContentView displays syntax-highlighted, scrollable content with a cursor, visual line selection, and yank-to-clipboard. ContentLink maps a line to a navigation target for cross-resource navigation.
type ContentLinkActivatedMsg ¶ added in v0.2.0
ContentLinkActivatedMsg is emitted when the user presses Enter on a linked line.
type ContentView ¶
type ContentView struct {
// contains filtered or unexported fields
}
func NewContentView ¶
func NewContentView(title, content string, format ContentFormat) ContentView
NewContentView creates a content viewer with the given title, content, and format.
func (*ContentView) CancelVisual ¶
func (cv *ContentView) CancelVisual()
CancelVisual exits visual mode without yanking.
func (ContentView) HasLinkAtCursor ¶ added in v0.2.0
func (cv ContentView) HasLinkAtCursor() bool
HasLinkAtCursor reports whether the current cursor line has a navigation link.
func (ContentView) InVisualMode ¶
func (cv ContentView) InVisualMode() bool
InVisualMode returns whether visual line selection is active.
func (ContentView) OpenInEditorCmd ¶
func (cv ContentView) OpenInEditorCmd() tea.Cmd
OpenInEditorCmd returns a tea.Cmd that opens the content in $EDITOR.
func (ContentView) Raw ¶
func (cv ContentView) Raw() string
Raw returns the original unhighlighted content.
func (*ContentView) SetContent ¶
func (cv *ContentView) SetContent(title, content string, format ContentFormat)
SetContent replaces the content.
func (*ContentView) SetEmbedded ¶ added in v0.2.0
func (cv *ContentView) SetEmbedded(v bool)
SetEmbedded marks this ContentView as embedded inside a TabbedPanel, hiding the footer (which duplicates the app-level status bar hints).
func (*ContentView) SetLinks ¶ added in v0.2.0
func (cv *ContentView) SetLinks(links map[int]ContentLink)
SetLinks sets navigable line links. Lines with links show a visual indicator and emit NavigateMsg when Enter is pressed on them.
func (*ContentView) SetSize ¶
func (cv *ContentView) SetSize(w, h int)
SetSize sets the viewer dimensions.
func (*ContentView) ToggleLineNumbers ¶
func (cv *ContentView) ToggleLineNumbers()
ToggleLineNumbers toggles line number display.
func (*ContentView) ToggleWrap ¶ added in v0.2.0
func (cv *ContentView) ToggleWrap()
ToggleWrap toggles word wrapping. When off, the viewport enables horizontal scrolling via h/l keys and ANSI-aware line clipping.
func (ContentView) Update ¶
func (cv ContentView) Update(msg tea.Msg) (ContentView, tea.Cmd)
Update handles cursor movement, visual selection, yank, and viewport scrolling.
type ContentViewKeyMap ¶ added in v0.2.0
type ContentViewKeyMap struct {
CursorDown key.Binding
CursorUp key.Binding
GotoTop key.Binding
GotoBottom key.Binding
HalfPageDown key.Binding
HalfPageUp key.Binding
VisualToggle key.Binding
Yank key.Binding
Enter key.Binding
LineNumbers key.Binding
WrapToggle key.Binding
ScrollLeft key.Binding
ScrollRight key.Binding
}
ContentViewKeyMap holds keybindings for the content viewer (panel).
func DefaultContentViewKeyMap ¶ added in v0.2.0
func DefaultContentViewKeyMap() ContentViewKeyMap
DefaultContentViewKeyMap returns the default content viewer keybindings.
type Detail ¶
type Detail struct {
// contains filtered or unexported fields
}
Detail renders a scrollable key-value detail pane.
func NewDetail ¶
func NewDetail(title string, fields []DetailField) Detail
NewDetail creates a Detail pane with the given title and fields.
func (*Detail) SetFields ¶
func (d *Detail) SetFields(fields []DetailField)
SetFields updates the displayed fields.
type DetailField ¶
DetailField represents a key-value pair in a detail pane.
type EditorFinishedMsg ¶
type EditorFinishedMsg struct {
Err error
}
EditorFinishedMsg is sent when the external editor exits.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter provides an inline search input activated by a keybinding.
func NewFilter ¶
func NewFilter() Filter
NewFilter creates an inactive filter with the default "/" prompt.
func NewFilterWithPrompt ¶ added in v0.2.0
NewFilterWithPrompt creates an inactive filter with a custom prompt and placeholder.
func (*Filter) Deactivate ¶
func (f *Filter) Deactivate()
Deactivate hides the filter and clears its value.
func (*Filter) DeactivateKeepValue ¶
func (f *Filter) DeactivateKeepValue()
DeactivateKeepValue hides the filter but keeps the text applied.
type FilterChangedMsg ¶
type FilterChangedMsg struct {
Text string
}
FilterChangedMsg is emitted when the filter text changes.
type FormView ¶ added in v0.4.0
type FormView struct {
// contains filtered or unexported fields
}
FormView wraps a huh.Form as a nav.View, providing a reusable multi-field form that integrates with the app's message routing and theme system.
func NewFormView ¶ added in v0.4.0
func NewFormView(req msg.RequestFormMsg) *FormView
NewFormView creates a FormView from a RequestFormMsg.
func (*FormView) KeyMap ¶ added in v0.4.0
func (f *FormView) KeyMap() []HintBinding
type HeaderData ¶
type HeaderData struct {
Profile string
Region string
Mode string // "RO" or "RW"
Breadcrumbs []string
Width int
}
HeaderData holds the values needed to render the header bar.
type HelpOverlay ¶ added in v0.2.0
type HelpOverlay struct {
// contains filtered or unexported fields
}
HelpOverlay is a scrollable, filterable overlay that displays keybindings grouped by category.
func NewHelpOverlay ¶ added in v0.2.0
func NewHelpOverlay() HelpOverlay
NewHelpOverlay creates a hidden help overlay.
func (*HelpOverlay) Hide ¶ added in v0.2.0
func (h *HelpOverlay) Hide()
Hide dismisses the help overlay.
func (*HelpOverlay) Show ¶ added in v0.2.0
func (h *HelpOverlay) Show(hints []HintBinding, width, height int)
Show opens the help overlay with the given hints.
func (HelpOverlay) Update ¶ added in v0.2.0
func (h HelpOverlay) Update(msg tea.Msg) (HelpOverlay, tea.Cmd)
Update handles input when the help overlay is visible.
func (HelpOverlay) View ¶ added in v0.2.0
func (h HelpOverlay) View() string
View renders the help overlay as a bordered popup.
func (HelpOverlay) Visible ¶ added in v0.2.0
func (h HelpOverlay) Visible() bool
Visible returns whether the help overlay is currently shown.
type HintBinding ¶ added in v0.2.0
type HintBinding struct {
key.Binding
Mode HintMode // ModeAny, ModeReadOnly, ModeReadWrite
Category string // for help overlay grouping; empty = "Current View"
}
HintBinding wraps key.Binding with metadata for the help overlay and status bar. It carries HintMode (ReadOnly/ReadWrite filtering) and Category (help overlay grouping) that key.Binding alone does not provide.
func NewHintBinding ¶ added in v0.2.0
func NewHintBinding(keys []string, helpKey, helpDesc string) HintBinding
NewHintBinding creates a HintBinding with ModeAny and no category.
func (*HintBinding) ApplyMode ¶ added in v0.2.0
func (h *HintBinding) ApplyMode()
ApplyMode enables or disables this binding based on the current ReadOnly state. ModeReadWrite bindings are disabled when ReadOnly is true; ModeReadOnly bindings are disabled when ReadOnly is false.
func (HintBinding) WithCategory ¶ added in v0.2.0
func (h HintBinding) WithCategory(cat string) HintBinding
WithCategory returns a copy with the given category.
func (HintBinding) WithMode ¶ added in v0.2.0
func (h HintBinding) WithMode(m HintMode) HintBinding
WithMode returns a copy with the given HintMode.
type HintMode ¶ added in v0.2.0
type HintMode int
HintMode controls when a keybinding hint is shown based on ReadOnly state.
type Picker ¶
type Picker struct {
// contains filtered or unexported fields
}
Picker is a popup selection dialog with j/k navigation and fuzzy search.
func (*Picker) Show ¶
func (p *Picker) Show(id, title string, options []PickerOption, initialIdx int)
Show displays the picker with the given options. The cursor starts on initialIdx.
type PickerOption ¶
PickerOption is a single selectable item in the picker.
type PickerResultMsg ¶
type PickerResultMsg struct {
ID string // picker identifier
Selected int // -1 if cancelled
Value string // selected option value, empty if cancelled
}
PickerResultMsg is emitted when the user selects an option or cancels.
type ServiceIcon ¶
type ServiceIcon struct {
Nerd string // Nerd Font glyph
Fallback string // plain Unicode fallback
}
ServiceIcon holds a Nerd Font icon and a Unicode fallback.
func (ServiceIcon) Icon ¶
func (i ServiceIcon) Icon() string
Icon returns the Nerd Font icon if enabled, otherwise the fallback.
type SortDirection ¶
type SortDirection int
SortDirection controls table column sort order.
const ( SortAsc SortDirection = iota SortDesc )
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner wraps a bubbles spinner with show/hide and a label.
func NewSpinner ¶
NewSpinner creates a Spinner with the given label.
type StatusBarData ¶
type StatusBarData struct {
Keys []HintBinding
Error string
Width int
}
StatusBarData holds the values needed to render the status bar.
type Styles ¶
type Styles struct {
// Header
HeaderStyle lipgloss.Style
HeaderAccent lipgloss.Style
Breadcrumb lipgloss.Style
BreadcrumbSep lipgloss.Style
HeaderGradient []color.Color
// Status bar
StatusBar lipgloss.Style
StatusKey lipgloss.Style
StatusDesc lipgloss.Style
StatusBarBase lipgloss.Style
// Table
TableHeader lipgloss.Style
TableSelected lipgloss.Style
TableCell lipgloss.Style
// Detail
DetailKey lipgloss.Style
DetailValue lipgloss.Style
// Messages
Error lipgloss.Style
Warning lipgloss.Style
Success lipgloss.Style
Info lipgloss.Style
// Filter
FilterPrompt lipgloss.Style
FilterBar lipgloss.Style
// Content border
ContentBorder lipgloss.Style
// Tabs
TabActive lipgloss.Style
TabInactive lipgloss.Style
// Content view
FormatBadge lipgloss.Style
LineNumber lipgloss.Style
LinkIndicator lipgloss.Style
PositionInfo lipgloss.Style
ModeIndicator lipgloss.Style
// Dialogs
DialogBorder lipgloss.Style
DialogErrorBorder lipgloss.Style
// Picker / suggestions
PickerOption lipgloss.Style
PickerOptionSelected lipgloss.Style
SuggestionName lipgloss.Style
SuggestionDesc lipgloss.Style
SuggestionSelected lipgloss.Style
// Help overlay
HelpGroupHeader lipgloss.Style
HelpKeyColumn lipgloss.Style
ReadWriteBadge lipgloss.Style
// Command bar
CommandCursor lipgloss.Style
// General
Muted lipgloss.Style
Title lipgloss.Style
}
Styles holds all computed lipgloss styles derived from the active theme.
type TabInput ¶ added in v0.2.0
type TabInput struct {
Title string
Content string
Format string
Links map[int]ContentLink // optional: navigable lines
}
TabInput describes the data for one tab, passed to NewTabbedPanel.
type TabbedPanel ¶ added in v0.2.0
type TabbedPanel struct {
// contains filtered or unexported fields
}
TabbedPanel displays multiple content tabs with a tab bar and lazy viewer creation.
func NewTabbedPanel ¶ added in v0.2.0
func NewTabbedPanel(title string, tabs []TabInput) TabbedPanel
NewTabbedPanel creates a tabbed panel. The first tab's viewer is created eagerly.
func (TabbedPanel) ActiveTab ¶ added in v0.2.0
func (tp TabbedPanel) ActiveTab() int
ActiveTab returns the 0-indexed active tab.
func (TabbedPanel) OpenInEditorCmd ¶ added in v0.2.0
func (tp TabbedPanel) OpenInEditorCmd() tea.Cmd
OpenInEditorCmd delegates to the active tab's viewer.
func (*TabbedPanel) SetSize ¶ added in v0.2.0
func (tp *TabbedPanel) SetSize(w, h int)
SetSize sets the panel dimensions and resizes the active viewer.
func (TabbedPanel) TabCount ¶ added in v0.2.0
func (tp TabbedPanel) TabCount() int
TabCount returns the number of tabs.
func (TabbedPanel) TabData ¶ added in v0.3.0
func (tp TabbedPanel) TabData() []TabInput
TabData returns the stored tab entries for saving/restoring panel state.
func (TabbedPanel) Update ¶ added in v0.2.0
func (tp TabbedPanel) Update(msg tea.Msg) (TabbedPanel, tea.Cmd)
Update handles input. Number keys 1-9 switch tabs; all else forwarded to active viewer.
func (TabbedPanel) View ¶ added in v0.2.0
func (tp TabbedPanel) View() string
View renders the tab bar and active viewer content.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table wraps bubbles/table with sort, filter, and multi-select support.
func (*Table) ClearSort ¶
func (t *Table) ClearSort()
ClearSort removes any active sort, restoring the original row order.
func (Table) FilteredIndices ¶
FilteredIndices returns the allRows indices of all currently visible (filtered) rows.
func (Table) IsSelected ¶
IsSelected returns whether the given allRows index is selected.
func (*Table) SelectAll ¶
func (t *Table) SelectAll()
SelectAll selects all currently visible (filtered) rows.
func (Table) SelectedAllRowIndex ¶
SelectedAllRowIndex returns the allRows index for the current cursor position. Returns -1 if no valid mapping exists.
func (Table) SelectedIndex ¶
SelectedIndex returns the cursor position in the filtered view.
func (Table) SelectedIndices ¶
SelectedIndices returns the allRows indices of all selected rows.
func (Table) SelectedRow ¶
SelectedRow returns the currently highlighted row.
func (Table) SelectionCount ¶
SelectionCount returns the number of selected rows.
func (*Table) SetColumns ¶ added in v0.2.0
SetColumns swaps the column set without recreating the table. Clears rows and resets sort state since column indices may have changed. Selections are preserved — callers repopulate rows with the same data.
func (*Table) SetRows ¶
SetRows replaces the table data and reapplies sort/filter. Selections are preserved for indices that remain valid.
func (*Table) SetRowsWithSortKeys ¶
SetRowsWithSortKeys replaces the table data with parallel sort keys. Sort keys must be the same length as rows; each sort key row provides string values that sort correctly for each column. Selections are preserved for indices that remain valid.
func (Table) SortColumnNames ¶
SortColumnNames returns the base column titles and the currently sorted column index.
func (*Table) SortNext ¶
func (t *Table) SortNext()
SortNext advances to the next sort column (ascending), or clears sort after the last column.
func (*Table) SortReverse ¶
func (t *Table) SortReverse()
SortReverse reverses the current sort direction. No-op if no column is sorted.
func (*Table) ToggleSelect ¶
func (t *Table) ToggleSelect()
ToggleSelect toggles selection on the current row and re-renders markers.
func (*Table) ToggleSelectAll ¶
func (t *Table) ToggleSelectAll()
ToggleSelectAll selects all if none are selected, otherwise deselects all.
type Theme ¶
type Theme struct {
Name string
// Core palette
Primary color.Color
Secondary color.Color
Accent color.Color
Error color.Color
Warning color.Color
Success color.Color
Info color.Color
// Surfaces
Base color.Color // main background-ish tone
Surface color.Color // elevated surface (panels)
Overlay color.Color // overlays, dialogs
Muted color.Color // subtle text
Text color.Color // primary text
SubText color.Color // secondary text
BrightText color.Color // emphasized text
// Gradient stops for header
GradientFrom color.Color
GradientTo color.Color
// Syntax highlighting
ChromaStyle string // Chroma library style name (e.g., "catppuccin-mocha", "dracula")
// State colors
StateRunning color.Color
StateStopped color.Color
StatePending color.Color
}
Theme holds all colors for the application. Themes adapt to dark/light terminals.
type Toast ¶
type Toast struct {
Text string
Level ToastLevel
CreatedAt time.Time
Duration time.Duration
ID int
}
Toast is a single timed notification.
type ToastDismissMsg ¶
type ToastDismissMsg struct {
ID int
}
ToastDismissMsg is sent when a toast's duration expires.
type ToastLevel ¶
type ToastLevel int
ToastLevel controls the color of a toast notification.
const ( ToastInfo ToastLevel = iota ToastSuccess ToastError )
type ToastManager ¶
type ToastManager struct {
// contains filtered or unexported fields
}
ToastManager manages a queue of auto-dismissing notifications.
func NewToastManager ¶
func NewToastManager() ToastManager
NewToastManager creates a toast manager with a default max of 3 visible toasts.
func (*ToastManager) Add ¶
func (tm *ToastManager) Add(text string, level ToastLevel, duration time.Duration) (int, tea.Cmd)
Add creates a new toast and returns its ID and a dismiss command.
func (*ToastManager) Cleanup ¶
func (tm *ToastManager) Cleanup()
Cleanup removes toasts that have exceeded their duration. This is a fallback for cases where the dismiss command may not fire (e.g., when toasts originate from view closures routed through the message loop). Call from Update periodically.
func (*ToastManager) Dismiss ¶
func (tm *ToastManager) Dismiss(id int)
Dismiss removes a toast by ID.
func (ToastManager) HasActive ¶
func (tm ToastManager) HasActive() bool
HasActive returns whether any non-expired toasts exist.
func (ToastManager) View ¶
func (tm ToastManager) View(width int) string
View renders the toast stack as a bordered block. Skips expired toasts that haven't been cleaned up yet.
type WidthTier ¶ added in v0.2.0
type WidthTier int
WidthTier represents a terminal width category for responsive layout.
func GetWidthTier ¶ added in v0.2.0
GetWidthTier returns the layout tier for a given terminal width.