tui

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package tui is ovdb's terminal UI: one root Model with named screens (Home, OVDB server, Settings, Result, Problem) that call internal/client.Local exactly as the CLI does — client.Local is the single place that decides server-vs-files and mismatch rules, and every screen here goes through it rather than duplicating that logic. See spec/features/first-run-onboarding (Home IA, sizes, the problem pattern) and spec/features/configuration-parity (copy catalogue, capability registry, REQ:increments-keep-parity).

Index

Constants

View Source
const (
	ScreenHome      = "home"
	ScreenServer    = "server"
	ScreenSettings  = "settings"
	ScreenResult    = "result"
	ScreenProblem   = "problem"
	ScreenCreate    = "create"
	ScreenDatabases = "databases"
	ScreenBrowse    = "browse"
	ScreenDemo      = "demo"
	ScreenConnect   = "connect"
	ScreenSkills    = "skills"
	ScreenExplore   = "explore"
)

Screen ids named by the capability registry (internal/parity); dropping one of these from the registered set fails that package's existence test naming the row and "TUI".

Variables

This section is empty.

Functions

func ScreenIDs

func ScreenIDs() []string

ScreenIDs lists every screen id the TUI registers.

Types

type Model

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

Model is the root bubbletea model. It owns the current screen and the one *client.Local every screen calls.

func New

func New(ctx context.Context, local *client.Local, openBrowser func(string) error, width, height int) Model

New creates the root model on Home. local's Notices field is redirected from cmd.ErrOrStderr() (internal/cli's default) to a buffer this model drains, because writing straight to stderr would corrupt bubbletea's alt-screen. openBrowser launches a URL for the Server screen's "Open in browser" — the same internal/browser.Opener the CLI's `ovdb open` uses — or a fake a caller injects for tests; nil defaults to the real opener.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

Update is update plus telemetry bookkeeping: the step's events, the prompt on the first successful Result, and a flush at each step's end.

func (Model) View

func (m Model) View() tea.View

Jump to

Keyboard shortcuts

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