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 ¶
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 ¶
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.