menu

package
v0.26.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeConfigMsg

type ChangeConfigMsg struct {
	Context context.Context
	To      configeditor.Result
}

type Config

type Config struct {
	CommonModel *common.CommonModel
	KeyBinds    *KeyBinds
}

type KeyBinds

type KeyBinds struct {
	// Navigation.
	Home     *keys.KeyBind `json:"home,omitempty"`
	End      *keys.KeyBind `json:"end,omitempty"`
	PageUp   *keys.KeyBind `json:"pageUp,omitempty"`
	PageDown *keys.KeyBind `json:"pageDown,omitempty"`

	// Actions.
	Select *keys.KeyBind `json:"select,omitempty"`
}

KeyBinds defines key bindings for menu view.

func (*KeyBinds) EnsureDefaults

func (kb *KeyBinds) EnsureDefaults()

EnsureDefaults sets default key bindings for menu actions.

func (*KeyBinds) GetKeyBinds

func (kb *KeyBinds) GetKeyBinds() []keys.KeyBind

GetKeyBinds returns all key bindings.

type KeyHandler

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

func NewKeyHandler

func NewKeyHandler(kb *KeyBinds, ckb *common.KeyBinds) *KeyHandler

func (*KeyHandler) HandleKeys

func (h *KeyHandler) HandleKeys(m Model, msg tea.KeyMsg) (Model, tea.Cmd)

func (*KeyHandler) HuhKeyMap

func (h *KeyHandler) HuhKeyMap() *huh.KeyMap

type Model

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

func NewModel

func NewModel(c Config) Model

NewModel creates a new menu model with rule-based directory filtering.

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) SetSize

func (m *Model) SetSize(_, h int)

func (*Model) ToggleHelp

func (m *Model) ToggleHelp()

ToggleHelp toggles the help display.

func (*Model) Unload

func (m *Model) Unload()

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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