Documentation
¶
Overview ¶
Package components hosts shared bubbletea components used by view modules.
Index ¶
- func StatusBar(s StatusBarState) string
- type Column
- type Command
- type ConnState
- type Palette
- func (p Palette) Close() Palette
- func (p Palette) Cursor() int
- func (p Palette) HasHistory(name string) bool
- func (p Palette) HistorySize() int
- func (p Palette) IsActive() bool
- func (p Palette) Open() Palette
- func (p Palette) Update(msg tea.Msg) (Palette, tea.Cmd)
- func (p Palette) View() string
- func (p Palette) VisibleMatches() []Command
- type PaletteSelectedMsg
- type ReasonModal
- type StatusBarState
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StatusBar ¶
func StatusBar(s StatusBarState) string
StatusBar renders the status bar as a styled string sized to s.Width. Pure function — no internal state.
Types ¶
type Column ¶
Column is the squad-side type for a table column. View modules don't import bubbles/table directly so the underlying widget stays swappable.
type ConnState ¶
type ConnState int
ConnState is the connection-state indicator shown in the status bar.
type Palette ¶
type Palette struct {
// contains filtered or unexported fields
}
func NewPalette ¶
func (Palette) HasHistory ¶
func (Palette) HistorySize ¶
func (Palette) VisibleMatches ¶
type PaletteSelectedMsg ¶
type PaletteSelectedMsg struct {
Command string
}
type ReasonModal ¶
type ReasonModal struct {
// contains filtered or unexported fields
}
func NewReasonModal ¶
func NewReasonModal() ReasonModal
func (ReasonModal) Cancelled ¶
func (m ReasonModal) Cancelled() bool
func (ReasonModal) Error ¶
func (m ReasonModal) Error() string
func (ReasonModal) Init ¶
func (m ReasonModal) Init() tea.Cmd
func (ReasonModal) Submitted ¶
func (m ReasonModal) Submitted() bool
func (ReasonModal) Update ¶
func (m ReasonModal) Update(msg tea.Msg) (ReasonModal, tea.Cmd)
func (ReasonModal) Value ¶
func (m ReasonModal) Value() string
func (ReasonModal) View ¶
func (m ReasonModal) View() string
type StatusBarState ¶
type StatusBarState struct {
Scope string
View string
Conn ConnState
Notify int
Lag int // milliseconds; 0 means "no lag"
Hints []string
Width int
}
StatusBarState carries the data the bar needs each render. View modules (specifically the root model) populate it before invoking StatusBar.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table wraps bubbles/table.Model with squad's theme and a substring filter. View modules embed it inside their own bubbletea Model.
func (Table) Cursor ¶
Cursor returns the index of the currently selected row in the visible (filtered) row set.
func (Table) SelectedRow ¶
SelectedRow returns the cells of the currently selected row, or nil if there are no rows.
func (Table) SetFilter ¶
SetFilter narrows the visible rows to those whose any cell contains the given substring (case-insensitive). Empty filter restores all.
func (Table) SetRows ¶
SetRows replaces the source row set, preserving the active filter. Cursor resets to 0.
func (Table) Update ¶
Update forwards key/window messages to the inner table, translating vim-style movement keys into directional KeyMsgs first.
func (Table) VisibleRows ¶
VisibleRows returns the count of currently displayed rows after filter.