Documentation
¶
Index ¶
- type StatusBarModel
- type StatusBarStyles
- type TableModel
- func (m *TableModel) MoveDown()
- func (m *TableModel) MoveUp()
- func (m *TableModel) SelectedSession() *TableSession
- func (m *TableModel) SetSessions(sessions []TableSession)
- func (m *TableModel) SetSize(width, height int)
- func (m TableModel) Update(msg tea.Msg) (TableModel, tea.Cmd)
- func (m TableModel) View() string
- type TableSession
- type TableStyles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatusBarModel ¶
type StatusBarModel struct {
Width int
Counts map[string]int
Total int
LastRefresh time.Time
Filter string // active state filter, empty = none
SearchTerm string // active search query
// contains filtered or unexported fields
}
StatusBarModel is the Bubble Tea model for the bottom status bar.
func NewStatusBar ¶
func NewStatusBar(badgeFn func(string, int) string) StatusBarModel
NewStatusBar creates a new status bar model.
func (*StatusBarModel) SetSize ¶
func (m *StatusBarModel) SetSize(width int)
SetSize updates the status bar width.
func (StatusBarModel) Update ¶
func (m StatusBarModel) Update(msg tea.Msg) (StatusBarModel, tea.Cmd)
Update handles messages for the status bar. Currently a no-op passthrough.
type StatusBarStyles ¶
type StatusBarStyles struct {
Bar lipgloss.Style
Key lipgloss.Style
Value lipgloss.Style
Divider string
BadgeFn func(state string, count int) string
Separator string
}
StatusBarStyles holds the styles for the status bar.
func DefaultStatusBarStyles ¶
func DefaultStatusBarStyles(badgeFn func(string, int) string) StatusBarStyles
DefaultStatusBarStyles returns the default styling for the status bar.
type TableModel ¶
type TableModel struct {
// Data
Sessions []TableSession
ProjectView bool // true = grouped by project, false = flat list
// State
Cursor int
Offset int // scroll offset for viewport
Height int // visible row count
Width int
// contains filtered or unexported fields
}
TableModel is the Bubble Tea model for the session table.
func NewTable ¶
func NewTable(stateIconFn func(string) string) TableModel
NewTable creates a new table model.
func (*TableModel) MoveDown ¶
func (m *TableModel) MoveDown()
MoveDown moves the cursor down by one row, scrolling if needed.
func (*TableModel) MoveUp ¶
func (m *TableModel) MoveUp()
MoveUp moves the cursor up by one row, scrolling if needed.
func (*TableModel) SelectedSession ¶
func (m *TableModel) SelectedSession() *TableSession
SelectedSession returns the currently selected session, or nil.
func (*TableModel) SetSessions ¶
func (m *TableModel) SetSessions(sessions []TableSession)
SetSessions replaces the session list and clamps cursor/offset.
func (*TableModel) SetSize ¶
func (m *TableModel) SetSize(width, height int)
SetSize updates the table dimensions and re-clamps the scroll offset.
func (TableModel) Update ¶
func (m TableModel) Update(msg tea.Msg) (TableModel, tea.Cmd)
Update handles messages for the table.
type TableSession ¶
type TableSession struct {
ID string
PID int
State string
Project string
StartedAt time.Time
WorkingOn string
LastLine string
TranscriptPath string
GitBranch string // current git branch (empty if not a repo)
GitDirty bool // true if working tree has uncommitted changes
}
TableSession is the data needed to render a session row.
type TableStyles ¶
type TableStyles struct {
ProjectHeader lipgloss.Style
RowNormal lipgloss.Style
RowSelected lipgloss.Style
StateIcon func(string) string
Subtle lipgloss.Style
Truncated lipgloss.Style
}
TableStyles holds styles for the table.
func DefaultTableStyles ¶
func DefaultTableStyles(stateIconFn func(string) string) TableStyles
DefaultTableStyles returns the default table styles.