tui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package tui implements the Bubble Tea TUI shared by `hive view` and `hive edit`. The two subcommands differ only in whether the archive is opened read-only and whether the detail pane accepts edits — every other piece (tree navigation, detail rendering, keymap, layout, status bar) is identical. Keeping one code path here means both modes evolve together.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(archivePath string, opts Options) error

Run opens the archive (read-only unless opts.Editable) and starts the Bubble Tea program. Returns only after the program exits (or fails to open the archive).

Belt-and-braces cleanup: Bubble Tea handles its own terminal restoration on normal exit and on the panics it catches inside the event loop. A panic BEFORE tea.Program.Run() (or SIGKILL) can bypass that. The deferred restoreTerminal below fires unconditionally, so even a rogue exit path leaves the user with a usable terminal.

Types

type Options

type Options struct {
	// Editable opens the archive read-write and enables the detail pane's
	// edit form. False → read-only, no edit affordances.
	Editable bool

	// Actor is the identity stamped into col__modified_by on every write.
	// Only used when Editable is true. Empty falls back to "local".
	Actor string
}

Options configures Run.

Jump to

Keyboard shortcuts

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