ui

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package ui provides the main UI for the kat application.

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = NewConfig()

Functions

func LogKeyPress

func LogKeyPress(key, context string)

LogKeyPress logs key presses for debugging (optional, can be enabled via config).

func NewProgram

func NewProgram(cfg *Config, cmd common.Commander) *tea.Program

NewProgram returns a new Tea program.

Types

type Config

type Config struct {
	KeyBinds *KeyBinds              `yaml:"keybinds"`
	Themes   map[string]ThemeConfig `validate:"dive"     yaml:"themes,omitempty"`
	UI       *UIConfig              `yaml:"ui,omitempty"`
}

Config contains TUI-specific configuration.

func NewConfig

func NewConfig() *Config

func (*Config) EnsureDefaults

func (c *Config) EnsureDefaults()

type GotResultMsg

type GotResultMsg command.Output

type KeyBinds

type KeyBinds struct {
	Common *common.KeyBinds `yaml:"common"`
	List   *list.KeyBinds   `yaml:"list"`
	Pager  *pager.KeyBinds  `yaml:"pager"`
}

func NewKeyBinds

func NewKeyBinds() *KeyBinds

func (*KeyBinds) EnsureDefaults

func (kb *KeyBinds) EnsureDefaults()

func (*KeyBinds) Validate

func (kb *KeyBinds) Validate() error

type OverlayState

type OverlayState int

type ShowResultMsg

type ShowResultMsg struct{}

type State

type State int

State is the top-level application State.

func (State) String

func (s State) String() string

type ThemeConfig

type ThemeConfig struct {
	Styles chroma.StyleEntries `yaml:"styles,omitempty"`
}

type UIConfig

type UIConfig struct {
	MinimumDelay    *time.Duration `yaml:"minimumDelay"`
	Compact         *bool          `yaml:"compact"`
	WordWrap        *bool          `yaml:"wordWrap"`
	ChromaRendering *bool          `yaml:"chromaRendering"`
	LineNumbers     *bool          `yaml:"lineNumbers"`
	Theme           string         `yaml:"theme"`
}

func (*UIConfig) EnsureDefaults

func (c *UIConfig) EnsureDefaults()

Directories

Path Synopsis
Package overlay provides terminal UI overlay functionality for placing foreground content on top of background content, similar to modal dialogs or popup windows in terminal applications.
Package overlay provides terminal UI overlay functionality for placing foreground content on top of background content, similar to modal dialogs or popup windows in terminal applications.

Jump to

Keyboard shortcuts

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