tui

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package tui renders the board.

The TUI is a peer of the CLI, not a wrapper around it: both link the same core packages directly. Shelling out to the binary for every keypress would add process overhead to an interaction that must feel instant, and would mean two different paths into the store — exactly the drift the single-write-path rule exists to prevent. Every mutation here goes through the same core calls the CLI uses, so the gates apply identically.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Home

type Home struct {

	// Chosen is the board the user picked; the caller opens it.
	Chosen string
	// Quit is set when the user asked to leave rather than pick.
	Quit bool
	// contains filtered or unexported fields
}

Home is the launcher: the icon, and every board with what it is doing.

func NewHome

func NewHome(extraRoots []string) (*Home, error)

NewHome builds the launcher from the registry plus anything discovered below the working directory.

func (*Home) Init

func (h *Home) Init() tea.Cmd

func (*Home) Update

func (h *Home) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Home) View

func (h *Home) View() tea.View

type HomeEntry

type HomeEntry struct {
	Root  string
	Name  string
	Open  int // tickets not in a terminal lane
	Total int

	// Agents is how many sessions are actively working this board, and Waiting
	// how many tickets sit at a human checkpoint. Those are the two states worth
	// colouring: one means work is happening without you, the other means it has
	// stopped for you.
	Agents  int
	Waiting int

	// Logged is this board's logbook entries per day over the last
	// logbookDays, oldest first, today last. Counted from the dated folder
	// names, so listing a board costs no ticket read.
	Logged []int

	Err error
}

HomeEntry is one project on the home screen, with enough state to answer the question the screen exists for: which of my boards needs me.

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the board's state.

func New

func New(s *ticket.Store) (*Model, error)

New builds a board model.

func (*Model) Close

func (m *Model) Close()

Close releases the watcher.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init satisfies tea.Model.

func (*Model) Update

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

Update satisfies tea.Model.

func (*Model) View

func (m *Model) View() tea.View

View satisfies tea.Model, and is where every screen is clamped to the terminal.

The clamp lives here, once, rather than being trusted to each screen. A line wider than the terminal does not spill — it wraps, silently pushing everything below it down a line, so one long warning could shove a footer off the bottom of a screen that had carefully measured its own height. Screens that already fit themselves lose nothing to this; the ones that never did stop being able to break the layout at all.

Jump to

Keyboard shortcuts

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