board

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 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
	Status quest.Status
	Quests []quest.Quest
}

Group is one labelled section of the board.

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.

func (Model) AttachableQuests

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

AttachableQuests is the selectable set for spawn/attach: active only. wip and done are excluded even though they show on the board.

func (Model) Groups

func (m Model) Groups() []Group

Groups returns the board's three sections in display order, omitting empties.

func (Model) Init

func (m Model) Init() tea.Cmd

Init satisfies tea.Model.

func (Model) Selected

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

Selected returns the 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(questID string) quest.Runtime

RuntimeFunc returns the derived runtime (sessions on the quest) for a quest id. 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