ui

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTheme

func ApplyTheme(name string)

ApplyTheme resolves a theme by name and applies it. Unknown names fall back to themeDark. Call this from main.go before ui.New and from the Settings screen when the user picks a new theme.

func EvalQuery

func EvalQuery(atoms []queryAtom, it db.SearchItem) bool

EvalQuery reports whether an item matches all atoms. Empty atom list → true.

func ParseQuery

func ParseQuery(input string) ([]queryAtom, error)

ParseQuery turns a user input string into a list of atoms. All atoms are combined with implicit AND. Unknown qualifiers become free words.

func SetCellPixelSize added in v0.8.0

func SetCellPixelSize(widthPx, heightPx int)

SetCellPixelSize records the measured cell size (pixels) so cellSize can compute image geometry from the terminal's actual font metrics. No-op when either dimension is non-positive so callers can pass through a failed query without guarding.

Types

type CatalogEntry

type CatalogEntry struct {
	Name     string
	URL      string
	Category string
}

CatalogEntry is one feed in the built-in discover catalog.

type Model

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

func New

func New(database *db.DB, fetcher *feed.Fetcher, afterSyncCommands []string, refreshIntervalMinutes int, home string, lang i18n.Lang, showImages bool, sortField string, sortReverse bool, showPreview bool, themeName string) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type Theme

type Theme struct {
	Name  string
	Light bool // true for light palettes — drives glamour style etc.

	BG       lipgloss.Color // primary pane background
	AltBG    lipgloss.Color // selection / alternate row
	Border   lipgloss.Color // muted border / separator
	Muted    lipgloss.Color // de-emphasized text (metadata, hints)
	Text     lipgloss.Color // default foreground
	ListText lipgloss.Color // dense list foreground, softer than Text

	Accent    lipgloss.Color // pane titles, active border, chrome
	Secondary lipgloss.Color // selected row, secondary accent

	Green  lipgloss.Color // counter / success
	Orange lipgloss.Color // time-ago / notice
	Red    lipgloss.Color // error
	Yellow lipgloss.Color // unread marker / warning
	Teal   lipgloss.Color // URLs / teal accent
}

Theme is a flat 12-slot color palette. Swapping a Theme triggers a rebuild of every registered style so the running UI picks up the new palette without a restart. Slots map to the semantic roles the rest of the UI uses directly (background, foreground, accents, status colors).

Jump to

Keyboard shortcuts

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