tui

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package tui provides the Bubble Tea interactive TUI for JSON navigation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPalette

func ApplyPalette(p panels.Palette)

ApplyPalette rebuilds all tui-level and panel-level styles from the palette.

func Start

func Start(root *node.Node, filename, theme, version string) error

Start launches the TUI for the given node tree. It takes over the terminal (AltScreen) and restores it cleanly on exit. If the user presses 'o' to open a new file, the picker is shown and the explorer restarts with the selected file.

func StartWithPicker

func StartWithPicker(initialDir, theme, version string) error

StartWithPicker launches a file picker TUI. Once a .json file is selected it parses it and transitions directly into the main JSON explorer.

Types

type Model

type Model struct {

	// Set to true when the user wants to pick a new file (causes clean quit).
	ReloadRequest bool
	// contains filtered or unexported fields
}

Model is the root Bubble Tea model. It owns all three panels and dispatches keystrokes to the focused sub-panel.

func NewModel

func NewModel(root *node.Node, filename string, version string) Model

NewModel creates the root model with the parsed tree.

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

Directories

Path Synopsis
Package panels contains JSON TUI panel components.
Package panels contains JSON TUI panel components.

Jump to

Keyboard shortcuts

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