tui

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DimStyle = lipgloss.NewStyle().
	Faint(true).
	Foreground(colorGray)

DimStyle renders inactive or secondary text.

View Source
var Keys = struct {
	Up, Down, Left, Right key.Binding
	Enter, Quit, Help     key.Binding
	Solve, Test, Bench    key.Binding
	Analyze, Download     key.Binding
}{
	Up: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("↑/k", "up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("↓/j", "down"),
	),
	Left: key.NewBinding(
		key.WithKeys("left", "h"),
		key.WithHelp("←/h", "back"),
	),
	Right: key.NewBinding(
		key.WithKeys("right", "l"),
		key.WithHelp("→/l", "open"),
	),
	Enter: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "select"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q"),
		key.WithHelp("q", "quit"),
	),
	Help: key.NewBinding(
		key.WithKeys("?"),
		key.WithHelp("?", "toggle help"),
	),
	Solve: key.NewBinding(
		key.WithKeys("s"),
		key.WithHelp("s", "solve"),
	),
	Test: key.NewBinding(
		key.WithKeys("t"),
		key.WithHelp("t", "test"),
	),
	Bench: key.NewBinding(
		key.WithKeys("b"),
		key.WithHelp("b", "benchmark"),
	),
	Analyze: key.NewBinding(
		key.WithKeys("a"),
		key.WithHelp("a", "analyze"),
	),
	Download: key.NewBinding(
		key.WithKeys("d"),
		key.WithHelp("d", "download"),
	),
}

Keys defines the shared key bindings for the TUI.

View Source
var SelectedStyle = lipgloss.NewStyle().
	Bold(true).
	Foreground(colorCyan)

SelectedStyle highlights the currently focused row.

View Source
var TitleStyle = lipgloss.NewStyle().
	Bold(true).
	Foreground(colorMagenta).
	MarginBottom(1)

TitleStyle renders the application header.

Functions

func Run

func Run(cfg config.Config) error

Run creates and starts the TUI program.

func StatusBadge

func StatusBadge(status string) string

StatusBadge returns a styled badge string for a given status.

Types

type App

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

App is the root TUI model managing a navigation stack.

func (App) Init

func (a App) Init() tea.Cmd

func (App) Update

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

func (App) View

func (a App) View() string

Directories

Path Synopsis
Package components is shared TUI components.
Package components is shared TUI components.
Package yearview is the TUI year view.
Package yearview is the TUI year view.

Jump to

Keyboard shortcuts

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