tui

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package tui implements `focus tui`: a Bubble Tea TUI over the same internal/board layer the CLI and MCP server use.

Layout: a split-pane board view. Nav (the card list) sits on the left when the terminal is wide enough; otherwise nav stacks on top of the preview. Cursor movement in the nav loads the highlighted card into the preview pane on every keystroke. There's no separate "detail view" mode — `e` and `enter` jump straight to $EDITOR.

Vim keybindings are first-class per wiki/decisions/focus-tui-keybinds.md. Arrows still work for users who don't speak vim.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(b *board.Board) error

Run boots the TUI program against the given board and runs until the user quits. Caller is responsible for board resolution; this matches the CLI handler shape (open the board, hand it to the TUI).

We pass the color profile via tea.WithColorProfile based on TERM/COLORTERM. v2 dropped lipgloss's global default renderer so the program-level option is now the way to pin profile detection in tmux/screen contexts where auto-detection returns Ascii.

Types

type KeyMap added in v0.1.3

type KeyMap struct {
	// Pane focus
	FocusNext, FocusPrev key.Binding

	// Nav movement (also re-used for preview when preview is focused)
	Up, Down, Top, Bottom key.Binding
	JumpDown, JumpUp      key.Binding

	// Preview-only scroll (full-page)
	ScrollPgDown, ScrollPgUp key.Binding

	// Filter cycle
	FilterNext, FilterPrev key.Binding

	// Layout cycle
	LayoutCycle key.Binding

	// Actions
	Edit, Activate, Park, Done, Kill, Revive key.Binding

	// Modes
	Search, Command, Help, Quit key.Binding
}

KeyMap collects every keystroke the TUI responds to. The router dispatches via key.Matches against this struct rather than switching on raw key strings, and bubbles/help renders the help view from the same struct so the two can never drift.

func DefaultKeyMap added in v0.1.3

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the canonical keybinding set, matching the contract in wiki/decisions/focus-tui-keybinds.md.

func (KeyMap) FullHelp added in v0.1.3

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp added in v0.1.3

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp / FullHelp implement help.KeyMap so bubbles/help renders the keybind table directly from the KeyMap struct above.

type Model

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

Model is the root Bubble Tea model. Holds the resolved board, the current view + input modes, and references to each sub-model.

func (*Model) Init

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

Init is Bubble Tea's startup hook. We use it to fire off the first board reload so the screen has data before any keystroke.

func (*Model) Update

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

Update routes messages to handlers. Cursor movement in the board triggers a preview reload as a side effect.

func (*Model) View

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

View renders the screen. Help overlays everything; otherwise we render the bordered split board layout above a bordered status bar.

Jump to

Keyboard shortcuts

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