groupslist

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(groups []string, width int, height int) tea.Model

New builds the groups list.

Types

type GroupsListCustomDelegate

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

func (GroupsListCustomDelegate) Height

func (d GroupsListCustomDelegate) Height() int

Height must agree with the rows Render actually emits: one title line inside the wrapper's Padding(1), so three. The list budgets Height() rows per item when it works out how many fit on a page, but it then prints whatever Render returns - so a Height() larger than the row both pages the list earlier than it needs to and pads the shortfall out as dead space above the paginator. The row lost its description line and this was left at 4, which is where the gap came from. TestDelegateHeightMatchesTheRow holds the two together.

func (GroupsListCustomDelegate) Render

func (d GroupsListCustomDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

Render handles the actual drawing of the item

func (GroupsListCustomDelegate) Spacing

func (d GroupsListCustomDelegate) Spacing() int

func (GroupsListCustomDelegate) Update

func (d GroupsListCustomDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd

type Model

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

func (Model) FilterState

func (m Model) FilterState() list.FilterState

FilterState exposes how much of the keyboard the list has taken, so AppModel can snapshot it into the help overlay's context.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) KeepsEsc

func (m Model) KeepsEsc() bool

KeepsEsc reports whether the list needs esc for itself: an applied filter is cleared by esc alone. Both body panels are always active now, so the list keeps esc whenever a filter is applied - AppModel's "back" checks this before it clears a selection.

func (Model) OwnsKeyboard

func (m Model) OwnsKeyboard() bool

OwnsKeyboard reports whether the list is taking every keystroke for itself, which it does while the user is typing a filter: n, d and q are letters then, not commands. Only while typing - once a filter is applied and the cursor is back in the rows, the panel keys mean what they always mean, and esc clears the filter. See model.AppModel.keyboardOwned.

func (Model) Update

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

func (Model) View

func (m Model) View() tea.View

Jump to

Keyboard shortcuts

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