palette

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package palette provides a command palette overlay for the TUI. Triggered by "/" in the input bar, it shows a fuzzy-filtered list of commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseMsg

type CloseMsg struct{}

CloseMsg is sent when the palette closes itself.

type Command

type Command struct {
	Name     string         // Display name (e.g. "New Conversation")
	Handler  func() tea.Cmd // What to do when selected (leaf commands)
	Children []Command      // Sub-commands (selecting drills down)
}

Command is a single palette entry. If Children is set, selecting this command drills into the sub-commands instead of executing Handler.

type Model

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

Model is the command palette.

func New

func New(theme styles.Theme, commands []Command) *Model

New creates a new command palette.

func (*Model) Height

func (m *Model) Height() int

Height returns the rendered height of the palette.

func (*Model) Init

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

Init returns the initial command (focus + blink).

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

SetWidth sets the palette width.

func (*Model) Update

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

Update handles key events. The caller must only forward events when the palette is open.

func (*Model) View

func (m *Model) View() string

View renders the palette.

type OpenMsg

type OpenMsg struct{}

OpenMsg requests the palette to open.

Jump to

Keyboard shortcuts

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