Help us shape the future of Go! Take the 2026 Go Developer Survey

ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Up     key.Binding
	Down   key.Binding
	Top    key.Binding
	Bottom key.Binding

	Diff        key.Binding
	DiffCurrent key.Binding
	Mark        key.Binding

	// Navigation between sections. Tab is the discoverable one; the digits are
	// for when you know where you are going.
	NextSection key.Binding
	PrevSection key.Binding

	Back key.Binding

	// Updating an input. Lower-case for the selected one, upper-case for all
	// of them — the same shape as the generation actions, where the wider
	// blast radius gets the shift.
	Scan key.Binding

	UpdateOne key.Binding
	UpdateAll key.Binding

	// Mutating actions. Each one only ever opens a confirmation showing the
	// exact command; none of them runs anything on the keypress alone.
	Rollback key.Binding
	SwitchTo key.Binding
	Delete   key.Binding
	GC       key.Binding

	// Rebuild pane. RebuildSwitch shares the `S` key with SwitchTo — they are
	// in different panes and both mean "activate this" — but it needs its own
	// binding rather than reusing that one, because the help text differs and
	// a footer reading "switch to selected" in a pane with no selection is
	// exactly the drift this file exists to prevent.
	Build         key.Binding
	RebuildSwitch key.Binding
	RebuildTest   key.Binding
	BootDefault   key.Binding
	Cancel        key.Binding
	OpenEditor    key.Binding

	// Search. `enter` rather than a letter, because in the search section every
	// letter is text you are typing — a letter binding there would be
	// unreachable by construction.
	Try key.Binding

	Confirm key.Binding
	Deny    key.Binding

	Help key.Binding
	Quit key.Binding
}

KeyMap is the whole keyboard surface. Declared in one place so the help line cannot drift from what the update loop actually handles — the usual failure being a binding that works but is undocumented, or documented and removed.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

func (KeyMap) FullHelp

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

FullHelp is the expanded view behind '?'.

func (KeyMap) ShortHelp

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

ShortHelp is what bubbles' help.Model expects when given the KeyMap directly. shortHelpFor is what the footer actually uses.

type Model

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

Model is the root Bubble Tea model. Panes are fields on it rather than separate models, because they share the generation list and the boot state and passing those around would be more machinery than the panes are worth.

func New

func New(flakeDir string, profile nix.Profile) Model

New builds the initial model. Nothing is loaded here; the first commands run from Init so that the UI paints immediately rather than after nix has been shelled out to.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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