board

package
v0.3.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 8 Imported by: 0

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

func ErrCmd

func ErrCmd(err error) tea.Msg

ErrCmd wraps an error as the tea.Msg the board surfaces in its footer. Injected open/check commands return it (instead of ReloadCmd) when their side effect fails — e.g. `check` on an unattached quest with no worktree.

func ReloadCmd

func ReloadCmd() tea.Msg

ReloadCmd is the tea.Msg that asks the board to re-read the store. Injected open/edit commands return it after their side effect so the board refreshes.

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
	// 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

type Group struct {
	Label  string
	Quests []quest.Quest
}

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

func (m Model) AttachableQuests() []quest.Quest

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

func (m Model) Groups() []Group

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) Init

func (m Model) Init() tea.Cmd

Init arms the periodic monitor refresh.

func (Model) Selected

func (m Model) Selected() (quest.Quest, bool)

Selected returns the visible quest under the cursor.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles input and reload messages.

func (Model) View

func (m Model) View() string

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.

type RuntimeFunc

type RuntimeFunc func(questIDs []string) map[string]quest.Runtime

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL