search

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackMsg

type BackMsg struct{}

BackMsg signals that the user wants to leave the search screen.

type Cache

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

Cache keeps lightweight per-library search snapshots in memory.

func NewCache

func NewCache(client *abs.Client) *Cache

NewCache creates a new in-memory search cache.

func (*Cache) Prepare

func (c *Cache) Prepare(ctx context.Context, libraryID, libraryMediaType string) error

Prepare ensures the library snapshot exists before the user starts searching.

func (*Cache) Search

func (c *Cache) Search(ctx context.Context, libraryID, libraryMediaType, query string) ([]abs.LibraryItem, error)

Search returns search results from a cached per-library snapshot.

type KeyMap

type KeyMap struct {
	Enter key.Binding
	Back  key.Binding
}

KeyMap defines keybindings for the search screen.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default keybindings for the search screen.

type Model

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

Model is the bubbletea model for the search screen.

func New

func New(styles ui.Styles, cache *Cache, libraryID, libraryMediaType string) Model

New creates a new search screen model.

func (Model) Error

func (m Model) Error() error

Error returns the last error, if any.

func (Model) Init

func (m Model) Init() tea.Cmd

Init returns the initial command (focus text input cursor + prewarm cache).

func (Model) Items

func (m Model) Items() []abs.LibraryItem

Items returns the current search results.

func (Model) Loading

func (m Model) Loading() bool

Loading returns whether a search is in progress.

func (Model) Query

func (m Model) Query() string

Query returns the current search query.

func (Model) Searched

func (m Model) Searched() bool

Searched returns whether at least one search has completed.

func (Model) SelectedPaletteActions added in v0.2.0

func (m Model) SelectedPaletteActions() []components.PaletteItem

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize updates the terminal dimensions for the search screen.

func (Model) Update

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

Update handles messages for the search screen.

func (Model) View

func (m Model) View() string

View renders the search screen.

type NavigateDetailMsg struct {
	Item abs.LibraryItem
}

NavigateDetailMsg requests navigation to the detail screen for an item.

type SearchResultsMsg

type SearchResultsMsg struct {
	Items []abs.LibraryItem
	Query string
	Err   error
}

SearchResultsMsg carries the results of a search query.

Jump to

Keyboard shortcuts

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