Documentation
¶
Index ¶
- Constants
- func IsUnauthorized(err error) bool
- type ErrMsg
- type ErrorBanner
- type ErrorDismissMsg
- type HelpBinding
- type HelpGroup
- type HelpOverlay
- type Palette
- func (p *Palette) ClearSelection()
- func (p *Palette) Close()
- func (p *Palette) Open(staticItems []PaletteItem, searchFn SearchFunc)
- func (p *Palette) SelectedAction() (PaletteAction, string, string, string, any)
- func (p *Palette) SetSize(width, height int)
- func (p *Palette) SetStyles(styles ui.Styles)
- func (p *Palette) Update(msg tea.Msg) (tea.Cmd, bool)
- func (p Palette) View() string
- func (p *Palette) Visible() bool
- type PaletteAction
- type PaletteItem
- type SearchFunc
Constants ¶
const ErrorDismissTimeout = 5 * time.Second
ErrorDismissTimeout is how long the error banner auto-dismisses after.
Variables ¶
This section is empty.
Functions ¶
func IsUnauthorized ¶
IsUnauthorized returns true if the error message indicates HTTP 401.
Types ¶
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) 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 HelpBinding ¶
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) HelpOverlay
NewHelpOverlay creates a new help overlay with all keybinding groups.
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 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) Open ¶ added in v0.2.0
func (p *Palette) Open(staticItems []PaletteItem, searchFn SearchFunc)
func (*Palette) SelectedAction ¶ added in v0.2.0
type PaletteAction ¶ added in v0.2.0
type PaletteAction int
const ( ActionNone PaletteAction = iota ActionGoHome ActionGoLibrary ActionGoSeriesList ActionTogglePlay ActionNextChapter ActionPrevChapter ActionSeekForward ActionSeekBackward ActionSpeedUp ActionSpeedDown ActionSleep15 ActionSleep30 ActionSleep45 ActionSleep60 ActionSleepOff ActionShowQueue ActionClearQueue ActionOpenSelected ActionQueueItem ActionPlayNextItem ActionMarkFinished ActionAddBookmark ActionGoToSeries ActionBrowseSeries ActionSwitchLibrary ActionOpenDetail ActionPlayDirect ActionEditMetadata )
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