Help us shape the future of Go! Take the 2026 Go Developer Survey

components

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorDismissTimeout = 5 * time.Second

ErrorDismissTimeout is how long the error banner auto-dismisses after.

View Source
const ItemFlashDuration = 167 * time.Millisecond

ItemFlashDuration is how long a queued-item highlight stays visible.

Variables

This section is empty.

Functions

func BuildSkeletonRows added in v0.6.0

func BuildSkeletonRows(styles ui.Styles) []list.Item

BuildSkeletonRows returns a list of placeholder items mimicking list rows during loading.

func UnicodeFilter added in v0.6.0

func UnicodeFilter(term string, targets []string) []list.Rank

UnicodeFilter matches list items while returning rune indexes for highlighting.

func VisibleFlashIDs added in v0.6.0

func VisibleFlashIDs(l list.Model) []string

VisibleFlashIDs returns IDs for flash-capable items rendered on the current list page.

Types

type ConfirmMsg added in v0.4.0

type ConfirmMsg struct {
	Confirmed bool
	Data      any // optional context data
}

ConfirmMsg is sent when the confirmation dialog is resolved.

type ConfirmOverlay added in v0.4.0

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

ConfirmOverlay is a generic confirmation dialog.

func NewConfirmOverlay added in v0.4.0

func NewConfirmOverlay(styles ui.Styles) ConfirmOverlay

NewConfirmOverlay creates a new confirmation overlay.

func (*ConfirmOverlay) Hide added in v0.4.0

func (c *ConfirmOverlay) Hide()

Hide closes the confirmation dialog.

func (*ConfirmOverlay) Show added in v0.4.0

func (c *ConfirmOverlay) Show(title, prompt string, data any)

Show opens the confirmation dialog.

func (*ConfirmOverlay) Update added in v0.4.0

func (c *ConfirmOverlay) Update(msg tea.Msg) (tea.Cmd, bool)

Update handles key events for the dialog.

func (ConfirmOverlay) View added in v0.4.0

func (c ConfirmOverlay) View() string

View renders the confirmation dialog.

func (ConfirmOverlay) Visible added in v0.4.0

func (c ConfirmOverlay) Visible() bool

Visible returns true if the dialog is currently visible.

type ErrMsg

type ErrMsg struct {
	Err error
}

ErrMsg signals an application error to be displayed in the banner.

type ErrorBanner

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

ErrorBanner holds the state for the error banner overlay.

func NewErrorBanner

func NewErrorBanner(errStyle lipgloss.Style) ErrorBanner

NewErrorBanner creates a new error banner with the given error style.

func (*ErrorBanner) Dismiss

func (b *ErrorBanner) Dismiss()

Dismiss clears the error.

func (ErrorBanner) Error

func (b ErrorBanner) Error() error

Error returns the current error.

func (ErrorBanner) HasError

func (b ErrorBanner) HasError() bool

HasError returns true if there is an active error.

func (*ErrorBanner) SetError

func (b *ErrorBanner) SetError(err error) tea.Cmd

SetError sets the current error and returns a command to auto-dismiss.

func (*ErrorBanner) SetWidth

func (b *ErrorBanner) SetWidth(w int)

SetWidth updates the banner width.

func (ErrorBanner) View

func (b ErrorBanner) View() string

View renders the error banner. Returns "" if no error.

type ErrorDismissMsg

type ErrorDismissMsg struct{}

ErrorDismissMsg signals that the error banner should be dismissed.

type FlashDelegate added in v0.6.0

type FlashDelegate struct {
	list.DefaultDelegate
	// contains filtered or unexported fields
}

FlashDelegate wraps list.DefaultDelegate and recolors items that are flashing.

func NewFlashDelegate added in v0.6.0

func NewFlashDelegate(styles ui.Styles, flash *ItemFlash) FlashDelegate

NewFlashDelegate builds a delegate that highlights items tracked by flash.

func (FlashDelegate) Render added in v0.6.0

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

Render draws the item, applying flash styles when the item ID is active.

type FlashIDProvider added in v0.6.0

type FlashIDProvider interface {
	FlashID() string
}

FlashIDProvider is implemented by list items that can be highlighted after an action.

type HelpBinding

type HelpBinding struct {
	Key  string
	Desc string
}

HelpBinding represents a single keybinding entry for the help overlay.

type HelpGroup

type HelpGroup struct {
	Title    string
	Bindings []HelpBinding
}

HelpGroup represents a named group of keybindings.

type HelpOverlay

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

HelpOverlay holds the state for the help overlay.

func NewHelpOverlay

func NewHelpOverlay(styles ui.Styles, groups []HelpGroup) HelpOverlay

NewHelpOverlay creates a new help overlay with the given keybinding groups.

func (*HelpOverlay) Hide

func (h *HelpOverlay) Hide()

Hide dismisses the help overlay.

func (*HelpOverlay) SetSize

func (h *HelpOverlay) SetSize(w, h2 int)

SetSize updates the available dimensions for centering.

func (*HelpOverlay) Toggle

func (h *HelpOverlay) Toggle()

Toggle switches the help overlay on or off.

func (HelpOverlay) View

func (h HelpOverlay) View() string

View renders the help overlay as a centered bordered box. Returns "" if not visible.

func (HelpOverlay) Visible

func (h HelpOverlay) Visible() bool

Visible returns whether the overlay is currently shown.

type ItemFlash added in v0.6.0

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

ItemFlash tracks temporary highlights by item ID.

func NewItemFlash added in v0.6.0

func NewItemFlash() *ItemFlash

NewItemFlash creates an empty flash tracker.

func (*ItemFlash) Active added in v0.6.0

func (f *ItemFlash) Active(id string) bool

Active reports whether id is currently highlighted.

func (*ItemFlash) HandleExpired added in v0.6.0

func (f *ItemFlash) HandleExpired(msg ItemFlashExpiredMsg) bool

HandleExpired clears items that still belong to the completed pulse.

func (*ItemFlash) Start added in v0.6.0

func (f *ItemFlash) Start(ids ...string) tea.Cmd

Start highlights the given IDs for ItemFlashDuration and returns the expiry command. Existing highlights for other IDs retain their own expiry time.

type ItemFlashExpiredMsg added in v0.6.0

type ItemFlashExpiredMsg struct {
	Owner      *ItemFlash
	Generation int
	ItemIDs    []string
}

ItemFlashExpiredMsg clears one finished item flash pulse.

type Palette added in v0.2.0

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

func NewPalette added in v0.2.0

func NewPalette() Palette

func (*Palette) ClearSelection added in v0.2.0

func (p *Palette) ClearSelection()

func (*Palette) Close added in v0.2.0

func (p *Palette) Close()

func (*Palette) Open added in v0.2.0

func (p *Palette) Open(staticItems []PaletteItem, searchFn SearchFunc)

func (*Palette) SelectedAction added in v0.2.0

func (p *Palette) SelectedAction() (PaletteAction, string, string, string, any)

func (*Palette) SetSize added in v0.2.0

func (p *Palette) SetSize(width, height int)

func (*Palette) SetStyles added in v0.2.0

func (p *Palette) SetStyles(styles ui.Styles)

func (*Palette) Update added in v0.2.0

func (p *Palette) Update(msg tea.Msg) (tea.Cmd, bool)

func (Palette) View added in v0.2.0

func (p Palette) View() string

func (*Palette) Visible added in v0.2.0

func (p *Palette) Visible() bool

type PaletteAction added in v0.2.0

type PaletteAction int
const (
	ActionNone PaletteAction = iota
	ActionGoHome
	ActionGoLibrary
	ActionGoPlaylists
	ActionGoSeriesList
	ActionTogglePlay
	ActionNextTrack
	ActionPrevTrack
	ActionNextChapter
	ActionPrevChapter
	ActionSeekForward
	ActionSeekBackward
	ActionSpeedUp
	ActionSpeedDown
	ActionVolumeUp
	ActionVolumeDown
	ActionSleep15
	ActionSleep30
	ActionSleep45
	ActionSleep60
	ActionSleepOff
	ActionShowQueue
	ActionClearQueue
	ActionShuffleQueue
	ActionRepeatTrack
	ActionRepeatQueue
	ActionOpenSelected
	ActionQueueItem
	ActionPlayNextItem
	ActionMarkFinished
	ActionAddBookmark
	ActionGoToSeries
	ActionBrowseSeries
	ActionSwitchLibrary
	ActionOpenDetail
	ActionContentNavigate
	ActionPlayDirect
	ActionEditMetadata
	ActionDeleteItem
	ActionShuffleItem
	ActionSubliminalMode
	ActionToggleCaptions
)

type PaletteItem added in v0.2.0

type PaletteItem struct {
	Label     string
	Action    PaletteAction
	IsHeader  bool
	Payload   string
	LibraryID string
	ItemID    string
	Data      any
}

func (PaletteItem) Description added in v0.2.0

func (i PaletteItem) Description() string

func (PaletteItem) FilterValue added in v0.2.0

func (i PaletteItem) FilterValue() string

func (PaletteItem) Title added in v0.2.0

func (i PaletteItem) Title() string

type SearchFunc added in v0.2.0

type SearchFunc func(query string) []PaletteItem

type SkeletonItem added in v0.6.0

type SkeletonItem struct {
	TitleStr       string
	DescriptionStr string
}

SkeletonItem implements list.Item for skeleton loading placeholder rows.

func (SkeletonItem) Description added in v0.6.0

func (i SkeletonItem) Description() string

func (SkeletonItem) FilterValue added in v0.6.0

func (i SkeletonItem) FilterValue() string

func (SkeletonItem) Title added in v0.6.0

func (i SkeletonItem) Title() string

Jump to

Keyboard shortcuts

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