Documentation
¶
Overview ¶
Package board is the quests app: the standalone TUI "board" launched in a shell pane. It groups the store's quests (on the board / drafts / turned in), renders each row with the terminal renderer's RenderListRow and the selected quest with RenderDetail in a scrollable viewport, and drives the human-only actions (check / edit / open / approve / done). It is modelled on internal/picker. wip rows are shown but excluded from the attachable set.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Commands ¶
type Commands struct {
// Open opens the quest's HTML in the browser; Edit edits its JSON; Check
// runs its auto gates and writes the sidecar. Each returns a tea.Cmd that
// should emit ReloadCmd when the board needs to refresh.
Open func(id string) tea.Cmd
Edit func(id string) tea.Cmd
Check func(id string) tea.Cmd
ResolveComment func(id, commentID string) tea.Cmd
DeleteComment func(id, commentID string) tea.Cmd
Now func() time.Time
Author func() string
// OpenURL opens a related entry's url with the OS opener (read-only).
OpenURL func(url string) tea.Cmd
}
Commands are the board's injected side effects. Any may be nil in tests that only exercise grouping/selection/transitions.
type Group ¶
Group is one labelled section of the board: a project (the section header) and the quests under it, in row order.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubble Tea model for the quests board.
func NewModel ¶
func NewModel(s store, runtimeFor RuntimeFunc, cmds Commands) Model
NewModel builds a board model. The default tab is Active (the middle tab).
func (Model) AttachableQuests ¶
AttachableQuests is the selectable set for spawn/attach: active only. It reads the FULL store set, not the visible tab, so attach works no matter which tab is showing.
func (Model) Groups ¶
Groups returns the current tab's project sections in display order. The visible set is already filtered to the tab's status; this maps the shared grouping onto the board's display type.
func (Model) View ¶
View renders the two-pane board: a grouped list on the left, the selected quest's detail (RenderDetail) in a scrollable viewport on the right.
The frame is cached (B1): a poll tick or a no-op message re-enters View with identical state, and recomputing both panes every time is the board's main per-frame cost. The cache key pairs contentVersion (bumped by reload only on real change) with the view-state that the panes depend on. The composer is never cached — its textarea repaints on every keystroke without a reload.
type RuntimeFunc ¶
RuntimeFunc returns the derived runtime (sessions on the quest, their live activity, observed gate results) for a set of quest ids in one pass. Injected so the board never imports the session-scan layer directly and stays unit-testable.