tui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package tui hosts siphon's Bubble Tea application: the multi-panel dashboard, its child panels, and the modal forms layered over them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(deps app.Deps) error

Run launches the dashboard with the given app deps and blocks until the user quits. It replaces the Phase A no-arg Run().

Types

type Dashboard

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

Dashboard is the root TUI model. It owns the child panels, focus state, key routing, and the active modal form / error overlay.

Panels are held by pointer so that focus mutations made through d.order (which holds the same pointers) are visible to the field accessed in View(). Copying the Dashboard value copies the pointers, not the panel structs, so order and the named fields never diverge (FIX 2, approach a).

func NewDashboard

func NewDashboard(d app.Deps) Dashboard

NewDashboard constructs the root model with the three panels wired up and focus on the profiles panel.

func (Dashboard) Init

func (d Dashboard) Init() tea.Cmd

func (Dashboard) Update

func (d Dashboard) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Dashboard) View

func (d Dashboard) View() string

type ErrorMsg

type ErrorMsg struct {
	Err  error
	Hint string
}

ErrorMsg pops the error modal with the given error and optional hint.

type FocusMsg

type FocusMsg struct{ Panel string }

FocusMsg moves focus to the named panel.

type JobChannelMsg

type JobChannelMsg struct {
	Channel <-chan jobs.Event
	JobID   string
}

JobChannelMsg wraps the channel returned by app.Backup/Restore/Sync so the Jobs panel can subscribe. Sent by modals when they complete.

type JobEventMsg

type JobEventMsg struct {
	Event jobs.Event
}

JobEventMsg carries a single jobs.Event from the runner into the TUI's Update cycle. The Jobs panel listens for this; other panels ignore it.

type KeyMap

type KeyMap struct {
	Quit       key.Binding
	NextPanel  key.Binding
	PrevPanel  key.Binding
	Backup     key.Binding
	Restore    key.Binding
	Sync       key.Binding
	NewProfile key.Binding
	Delete     key.Binding
	Help       key.Binding
	Refresh    key.Binding
}

KeyMap defines every key in the dashboard. Keep this exhaustive and editable — the help modal renders directly from this struct.

func DefaultKeys

func DefaultKeys() KeyMap

type Panel

type Panel interface {
	tea.Model
	Title() string
	SetSize(w, h int)
	SetFocus(bool)
}

Panel is the small contract every child component implements so the Dashboard can route key events, lifecycle messages, and resize hints to the focused panel uniformly.

type RefreshMsg

type RefreshMsg struct{}

RefreshMsg asks all panels to reload their data (profile list, dumps).

Directories

Path Synopsis
Package modals holds short-lived Bubble Tea forms presented over the dashboard.
Package modals holds short-lived Bubble Tea forms presented over the dashboard.
Package panels contains the dashboard's child panels.
Package panels contains the dashboard's child panels.
Package styles holds Lipgloss styles shared across the TUI.
Package styles holds Lipgloss styles shared across the TUI.

Jump to

Keyboard shortcuts

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