tui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package tui provides the Bubble Tea model and UI components for the JSON log viewer. It handles rendering, input processing, and coordinates between the index, parser, and navigation packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	// Navigation
	Up       key.Binding
	Down     key.Binding
	PageUp   key.Binding
	PageDown key.Binding
	Home     key.Binding
	End      key.Binding
	// Vim motions
	VimUp     key.Binding
	VimDown   key.Binding
	VimTop    key.Binding
	VimBottom key.Binding
	// Actions
	Quit key.Binding
	Help key.Binding
	// Pane navigation
	Left  key.Binding
	Right key.Binding
	// Resize
	ResizeMode  key.Binding
	ResizeLeft  key.Binding
	ResizeRight key.Binding
}

KeyMap defines the key bindings for the application.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings.

func (KeyMap) FullHelp

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

FullHelp returns the full help key bindings.

func (KeyMap) ShortHelp

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

ShortHelp returns the short help key bindings.

type Model

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

Model is the Bubble Tea model for the log viewer application.

func New

func New(idx *index.Index, version string) Model

New creates a new TUI model with the given index and version.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the model.

func (*Model) Update

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

Update handles messages and updates the model.

func (*Model) View

func (m *Model) View() string

View renders the UI.

type Styles

type Styles struct {
	// Table header style.
	Header lipgloss.Style
	// Selected row style.
	Selected lipgloss.Style
	// Normal row style.
	Normal lipgloss.Style
	// Detail pane style.
	Detail lipgloss.Style
	// Title style.
	Title lipgloss.Style
	// Help style.
	Help lipgloss.Style
	// Separator style.
	Separator lipgloss.Style
	// Table container style (for height constraints).
	TableContainer lipgloss.Style
	// Detail container style (for height constraints).
	DetailContainer lipgloss.Style
}

Styles holds the lipgloss styles for the UI.

func DefaultStyles

func DefaultStyles() *Styles

DefaultStyles returns the default UI styles.

Jump to

Keyboard shortcuts

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