ui

package
v0.0.0-...-7a3fd9b Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// Window dimensions
	Width  int
	Height int

	// Navigation state
	Cursor int
	Tree   *tree.TreeNode

	// Dialog states
	ShowConfirm    bool
	ConfirmYes     bool
	PendingCommand string
	DefaultConfirm bool

	// Input handling
	ShowInputs  bool
	InputFields []InputField
	InputCursor int
	InputValues map[string]string

	// Help system
	ShowHelp bool
	Help     help.Model
	Keys     KeyMap
}

App represents the main application state

func NewApp

func NewApp(treeRoot *tree.TreeNode, defaultConfirm bool) App

NewApp creates a new application instance with initialized components

func (App) Init

func (m App) Init() tea.Cmd

Init initializes the application

func (App) Update

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

Update handles messages and updates the application state

func (App) View

func (m App) View() string

View renders the main UI

type InputField

type InputField struct {
	Name        string
	Placeholder string
	TextInput   textinput.Model

	// Choice field support
	IsChoice        bool
	Options         []config.VariableOption
	Choice          int
	SelectedValue   string
	ShowCustomInput bool
	CustomInput     textinput.Model
}

InputField represents a variable input field with support for choices and text input

type KeyMap

type KeyMap struct {
	Up    key.Binding
	Down  key.Binding
	Enter key.Binding
	Back  key.Binding
	Quit  key.Binding
	Help  key.Binding
}

KeyMap defines all keyboard shortcuts for the application

func (KeyMap) FullHelp

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

FullHelp returns full help

func (KeyMap) ShortHelp

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

ShortHelp returns short help

Jump to

Keyboard shortcuts

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