actionbar

package
v0.0.0-...-41bbe8e Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: CC0-1.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NO_FOCUS_INDEX = -1
	COLUMN_WIDTH   = 30
)

Variables

View Source
var DEFAULT_TABLE_STYLE = lipgloss.HiddenBorder()

Functions

This section is empty.

Types

type ActionBarModel

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

A TUI element that allows users to type action names into a text input in order to search for and execute actions

func NewActionBarModel

func NewActionBarModel(actionsDelegate func() []con.Action) *ActionBarModel

Instantiates a new ActionBarModel with default settings

func (*ActionBarModel) Blur

func (m *ActionBarModel) Blur() *ActionBarModel

Blurs the ActionBarModel's input

func (*ActionBarModel) Focus

func (m *ActionBarModel) Focus() *ActionBarModel

Unblurs the ActionBarModel's input

func (ActionBarModel) GetActions

func (m ActionBarModel) GetActions() (output []con.Action)

Calls the ActionBarModel.actionsDelegate to get a list of all actions

func (ActionBarModel) GetInputValue

func (m ActionBarModel) GetInputValue() string

Returns the current value of the textinput.Model

func (*ActionBarModel) HandleShortcuts

func (m *ActionBarModel) HandleShortcuts(shortcut string) *ActionBarModel

Handles the given keyboard shortcut string, whether it's an action's shortcut or a shortcut for the action bar itself

func (ActionBarModel) Init

func (m ActionBarModel) Init() tea.Cmd

Initializes the ActionBarModel's text input

func (*ActionBarModel) SetActionDelegate

func (m *ActionBarModel) SetActionDelegate(delegate func() []con.Action) *ActionBarModel

Sets the function used by ActionBarModel to get the list of available actions

func (*ActionBarModel) SetInput

func (m *ActionBarModel) SetInput(input textinput.Model) *ActionBarModel

Sets the model for the ActionBarModel's text input

func (*ActionBarModel) ToggleFocus

func (m *ActionBarModel) ToggleFocus() *ActionBarModel

Switches the focused/blured state of the ActionBarModel's input

func (ActionBarModel) Update

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

func (ActionBarModel) View

func (m ActionBarModel) View() string

type ActionListModel

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

Handles displaying a list of action suggestions to the user

func NewActionListModel

func NewActionListModel(actions func(string) []con.Action) ActionListModel

Instantiates an ActionListModel with default values

func (*ActionListModel) Blur

func (m *ActionListModel) Blur() *ActionListModel

Unfocuses the suggestion list

func (*ActionListModel) Focus

func (m *ActionListModel) Focus() *ActionListModel

Focuses the first suggested action

func (ActionListModel) Focused

func (m ActionListModel) Focused() bool

Returns whether any of the suggestions in the list are focused

func (ActionListModel) GetCurrentSuggestions

func (m ActionListModel) GetCurrentSuggestions() (output []con.Action)

func (ActionListModel) GetFocusedSuggestion

func (m ActionListModel) GetFocusedSuggestion() *con.Action

Returns the currently focused sugggested action, or nil if blurred

func (*ActionListModel) GetInput

func (m *ActionListModel) GetInput() string

func (ActionListModel) Init

func (m ActionListModel) Init() tea.Cmd

func (*ActionListModel) SetInput

func (m *ActionListModel) SetInput(input string) *ActionListModel

Sets the input value being used to filter suggestions

func (ActionListModel) Update

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

func (*ActionListModel) UpdateSuggestedActions

func (m *ActionListModel) UpdateSuggestedActions() (output *ActionListModel)

Calls the ActionListModel's actionsDelegate and sets the currentSuggestions to the result

func (*ActionListModel) UpdateSuggestedActionsFromInput

func (m *ActionListModel) UpdateSuggestedActionsFromInput(input string) (output *ActionListModel)

Sets the input value to a given string and updates the suggested actions

func (ActionListModel) View

func (m ActionListModel) View() string

Jump to

Keyboard shortcuts

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