tui

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is the root tea.Model. It owns the world, theme, keymap, and which screen is active. Screens read from the shared world; they don't mutate it.

func New

func New() (*App, error)

New builds a root App. Returns an error if systems can't load.

func (*App) Init

func (a *App) Init() tea.Cmd

Init kicks off the tick loop.

func (*App) Update

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

Update routes every tea.Msg. Globals handled here; screen-scoped keys delegate to the active screen.

func (*App) View

func (a *App) View() string

View delegates to the active screen, then overlays a transient status line at the bottom for ~3s after a save / load.

type Keymap

type Keymap struct {
	Quit         key.Binding
	Help         key.Binding
	BodyInfo     key.Binding
	Maneuver     key.Binding
	NextBody     key.Binding
	PrevBody     key.Binding
	NextSystem   key.Binding
	WarpUp       key.Binding
	WarpDown     key.Binding
	Pause        key.Binding
	ZoomIn       key.Binding
	ZoomOut      key.Binding
	Back         key.Binding
	FocusNext    key.Binding
	FocusPrev    key.Binding
	FocusReset   key.Binding
	PlanNode     key.Binding
	ClearNodes   key.Binding
	PlanTransfer key.Binding
	Porkchop     key.Binding
	Save         key.Binding
	Load         key.Binding
	RefinePlan   key.Binding
}

Keymap centralises every binding the root model cares about. Screens that need additional keys define them locally.

func DefaultKeymap

func DefaultKeymap() Keymap

type Theme

type Theme struct {
	Primary lipgloss.Style
	Warning lipgloss.Style
	Alert   lipgloss.Style
	Dim     lipgloss.Style
	HUDBox  lipgloss.Style
	Footer  lipgloss.Style
	Title   lipgloss.Style
}

Theme collects the lipgloss styles used across screens. Palette matches docs/plan.md §Visual polish: primary cyan, warning amber, alert red, dim gray for orbits.

func DefaultTheme

func DefaultTheme() Theme

Directories

Path Synopsis
Package screens implements the individual tea.Model screens composed by tui.App: OrbitView (C8), BodyInfo (C9), Maneuver (C20), Help (C9).
Package screens implements the individual tea.Model screens composed by tui.App: OrbitView (C8), BodyInfo (C9), Maneuver (C20), Help (C9).
Package widgets provides drawille-backed canvas + lipgloss HUD helpers shared by all screens.
Package widgets provides drawille-backed canvas + lipgloss HUD helpers shared by all screens.

Jump to

Keyboard shortcuts

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