Documentation
¶
Overview ¶
Package sidebar renders the left-hand run list for the squad TUI: a vertical, grouped, selectable list of active and recent agent runs.
Each row encodes two orthogonal signals via shape and color:
shape — process liveness (▶ alive, ◇ alive-paused, ∙ exited) color — run state (cyan working, green completed, red failed)
The renderer is pure: a Snapshot in, a styled string out. Tests use fixed-width fixtures plus ANSI stripping for stable goldens; the app layer handles input routing and state transitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Group ¶
Group is a named bucket of rows. The default grouping function buckets runs into Working / Needs input / Recent based on State + Alive; callers can pass a custom Group slice to override.
type Run ¶
type Run struct {
ID string // session ID — opaque key for selection
Agent string // e.g. "go-review" or "bug-hunt:fix-bug"
State State
Alive bool // is the subprocess still running?
Elapsed time.Duration
LastEvent string // optional one-liner; rendered dim on selected row
}
Run is one row's worth of data. Designed to be cheap to construct from a session.Meta + a liveness probe.
type Snapshot ¶
type Snapshot struct {
Groups []Group // pre-bucketed; if nil, derive via Bucket(Runs, ...)
Runs []Run // used when Groups is nil
Selected string // session ID of the currently selected row
Width int // terminal column width for this pane
// MaxPerGroup truncates each group with a "… N more" footer. 0 = no
// truncation.
MaxPerGroup int
}
Snapshot is the input to Render.