Documentation
¶
Overview ¶
Package styles provides reusable lipgloss-based TUI components.
Package styles provides reusable lipgloss-based TUI components.
Index ¶
- Constants
- func DefaultDarkPalette() config.ColorPalette
- func HistoryTableColumns() []table.Column
- func NewDefaultSpinner(theme *Theme) spinner.Model
- func NewHistoryList(theme *Theme, items []HistoryItem, width, height int) list.Model
- func NewSearchInput(theme *Theme) textinput.Model
- func NewStyledHelp(theme *Theme) help.Model
- func NewStyledInput(theme *Theme, placeholder string) textinput.Model
- func NewStyledSpinner(theme *Theme, spinnerType SpinnerType) spinner.Model
- func NewStyledTable(theme *Theme, columns []table.Column, rows []table.Row, width, height int) table.Model
- func NewURLInput(theme *Theme) textinput.Model
- func RelativeTime(tm time.Time) string
- func StatsTableColumns() []table.Column
- func TimeCategoryLabel(cat TimeCategory) string
- type AboutRenderer
- type CleanupKeyMap
- type CleanupModel
- type CleanupRange
- type CleanupRangeInfo
- type CleanupResultMsg
- type ConfigRenderer
- func (r *ConfigRenderer) RenderChanges(changes []port.KeyChange) string
- func (r *ConfigRenderer) RenderChangesSummary(changes []port.KeyChange) string
- func (*ConfigRenderer) RenderChecking(spinner string) string
- func (r *ConfigRenderer) RenderConfigInfo(path string, changeCount int) string
- func (r *ConfigRenderer) RenderError(err error) string
- func (r *ConfigRenderer) RenderMigrateHint() string
- func (r *ConfigRenderer) RenderMigrationSuccess(count int, path string) string
- func (r *ConfigRenderer) RenderMissingKeys(keys []port.KeyInfo) string
- func (r *ConfigRenderer) RenderNoConfigFile(path string) string
- func (r *ConfigRenderer) RenderOpening(path, editor string) string
- func (r *ConfigRenderer) RenderUpToDate(path string) string
- type ConfigSchemaRenderer
- type ConfirmKeyMap
- type ConfirmModel
- type ConfirmResult
- type ConfirmResultMsg
- type CrashesCLIRenderer
- type DmenuKeyMap
- type DoctorMediaReport
- type DoctorRenderer
- type DoctorReport
- type DoctorRuntimeCheck
- type DoctorRuntimeReport
- type DomainStatsRow
- type HistoryDelegate
- type HistoryItem
- type HistoryKeyMap
- type KeyMap
- type LoadingModel
- type PurgeItem
- type PurgeKeyMap
- type PurgeModel
- func (m PurgeModel) Done() bool
- func (m PurgeModel) Init() tea.Cmd
- func (m PurgeModel) SelectedCount() int
- func (m PurgeModel) SelectedSessionIDs() []entity.SessionID
- func (m PurgeModel) SelectedSize() int64
- func (m PurgeModel) SelectedTypes() []entity.PurgeTargetType
- func (m PurgeModel) SessionsEnabled() bool
- func (m *PurgeModel) ToggleAllSessions()
- func (m PurgeModel) Update(msg tea.Msg) (PurgeModel, tea.Cmd)
- func (m PurgeModel) View() string
- type SessionsCLIRenderer
- func (r *SessionsCLIRenderer) RenderDeleted(sessionID entity.SessionID) string
- func (r *SessionsCLIRenderer) RenderEmptyList() string
- func (r *SessionsCLIRenderer) RenderError(err error) string
- func (r *SessionsCLIRenderer) RenderList(items []entity.SessionInfo, limit int) string
- func (r *SessionsCLIRenderer) RenderRestoreStarted(sessionID entity.SessionID) string
- type SimpleDelegate
- type SimpleItem
- type SpinnerType
- type TabsModel
- type Theme
- func (t *Theme) AccentBadge(text string) string
- func (t *Theme) DomainBadge(domain string) string
- func (t *Theme) InputBox(input string, focused bool) string
- func (t *Theme) MutedBadge(text string) string
- func (t *Theme) Renderer() *lipgloss.Renderer
- func (t *Theme) StatusBadge(text string, fg, bg lipgloss.Color) string
- func (t *Theme) TimeBadge(tm time.Time) string
- func (t *Theme) VisitBadge(count int) string
- type TimeCategory
- type UpdateRenderer
- func (r *UpdateRenderer) RenderAvailable(current, latest, releaseURL string) string
- func (r *UpdateRenderer) RenderCannotAutoUpdate(current, latest, releaseURL string) string
- func (*UpdateRenderer) RenderChecking(spinner string) string
- func (r *UpdateRenderer) RenderDevBuild() string
- func (r *UpdateRenderer) RenderDownloading(spinner, version string) string
- func (r *UpdateRenderer) RenderError(err error) string
- func (r *UpdateRenderer) RenderStaged(version string) string
- func (r *UpdateRenderer) RenderUpToDate(version string) string
Constants ¶
const ( IconGlobe = "\uf0ac" // browser/web IconVersion = "\uf02b" // tag IconGitBranch = "\ue725" // git branch IconCalendar = "\uf073" // calendar IconCode = "\uf121" // code IconGithub = "\uf09b" // github IconHeart = "\uf004" // heart IconGo = "\ue627" // go gopher IconArrow = "\uf061" // arrow right // Doctor / diagnostics IconDoctor = "\uf0f1" // stethoscope IconCheck = "\uf00c" // check IconX = "\uf00d" // x IconWarning = "\uf071" // warning IconInfo = "\uf05a" // info IconWrench = "\uf0ad" // wrench IconPackage = "\uf187" // archive/package IconVideo = "\uf03d" // video camera // Purge / filesystem IconTrash = "\uf1f8" // trash IconFolder = "\uf07b" // folder IconConfig = "\ue615" // config IconDatabase = "\uf1c0" // database IconFilter = "\uf0b0" // filter IconDesktop = "\uf108" // desktop IconImage = "\uf1c5" // image file IconCache = "\uf49e" // cache IconLogs = "\uf0f6" // file-text // Checkboxes IconCheckboxEmpty = "\uf096" // unchecked IconCheckboxChecked = "\uf046" // checked // UI IconCursor = "\uf054" // chevron-right // Sessions / browser IconSession = "\uf2d2" // window IconSessionStack = "\uf24d" // clone/stack IconTab = "\uf0ce" // table IconPane = "\uf0db" // columns IconTree = "\uf1bb" // tree IconClock = "\uf017" // clock IconPlay = "\uf04b" // play (running) IconStop = "\uf04d" // stop (exited) IconRestore = "\uf0e2" // rotate-left (restore) IconExpand = "\uf065" // expand IconCollapse = "\uf066" // compress // Update / download IconDownload = "\uf019" // download IconUpdate = "\uf021" // refresh/sync IconRocket = "\uf135" // rocket (upgrade) )
Nerd Font icons (requires a Nerd Font to display correctly)
Variables ¶
This section is empty.
Functions ¶
func DefaultDarkPalette ¶
func DefaultDarkPalette() config.ColorPalette
DefaultDarkPalette returns hardcoded dark theme colors.
func HistoryTableColumns ¶
HistoryTableColumns returns columns for history list table.
func NewDefaultSpinner ¶
NewDefaultSpinner creates the default themed spinner.
func NewHistoryList ¶
func NewHistoryList(theme *Theme, items []HistoryItem, width, height int) list.Model
NewHistoryList creates a themed list for history items.
func NewSearchInput ¶
NewSearchInput creates a search-specific input.
func NewStyledHelp ¶
NewStyledHelp creates a themed help model.
func NewStyledInput ¶
NewStyledInput creates a themed text input.
func NewStyledSpinner ¶
func NewStyledSpinner(theme *Theme, spinnerType SpinnerType) spinner.Model
NewStyledSpinner creates a themed spinner.
func NewStyledTable ¶
func NewStyledTable(theme *Theme, columns []table.Column, rows []table.Row, width, height int) table.Model
NewStyledTable creates a themed table model.
func NewURLInput ¶
NewURLInput creates a URL input field.
func RelativeTime ¶
RelativeTime formats a time as a human-readable relative string.
func StatsTableColumns ¶
StatsTableColumns returns columns for domain stats table.
func TimeCategoryLabel ¶
func TimeCategoryLabel(cat TimeCategory) string
TimeCategoryLabel returns the display label for a time category.
Types ¶
type AboutRenderer ¶
type AboutRenderer struct {
// contains filtered or unexported fields
}
AboutRenderer renders build info in fastfetch style.
func NewAboutRenderer ¶
func NewAboutRenderer(theme *Theme) *AboutRenderer
NewAboutRenderer creates a new about renderer with the given theme.
type CleanupKeyMap ¶
type CleanupKeyMap struct {
Up key.Binding
Down key.Binding
Confirm key.Binding
Cancel key.Binding
}
CleanupKeyMap defines keybindings for cleanup modal.
func DefaultCleanupKeyMap ¶
func DefaultCleanupKeyMap() CleanupKeyMap
DefaultCleanupKeyMap returns default keybindings.
type CleanupModel ¶
type CleanupModel struct {
Ranges []CleanupRangeInfo
Selected int
Confirmed bool
Canceled bool
// contains filtered or unexported fields
}
CleanupModel is a cleanup range selection modal.
func NewCleanup ¶
func NewCleanup(theme *Theme) CleanupModel
NewCleanup creates a new cleanup modal.
func (CleanupModel) Done ¶
func (m CleanupModel) Done() bool
Done returns true if the modal is complete.
func (CleanupModel) SelectedRange ¶
func (m CleanupModel) SelectedRange() CleanupRange
SelectedRange returns the selected cleanup range.
func (CleanupModel) Update ¶
func (m CleanupModel) Update(msg tea.Msg) (CleanupModel, tea.Cmd)
Update implements tea.Model.
type CleanupRange ¶
type CleanupRange int
CleanupRange represents a time range for history cleanup.
const ( CleanupRangeLastHour CleanupRange = iota CleanupRangeLast24Hours CleanupRangeLast7Days CleanupRangeLast30Days CleanupRangeAll )
func (CleanupRange) CutoffTime ¶
func (r CleanupRange) CutoffTime() time.Time
CutoffTime returns the cutoff time for this range.
type CleanupRangeInfo ¶
type CleanupRangeInfo struct {
Range CleanupRange
Label string
Description string
}
CleanupRangeInfo holds display info for a cleanup range.
func AllCleanupRanges ¶
func AllCleanupRanges() []CleanupRangeInfo
AllCleanupRanges returns all available cleanup ranges.
type CleanupResultMsg ¶
type CleanupResultMsg struct {
Confirmed bool
Range CleanupRange
}
CleanupResultMsg is sent when cleanup modal completes.
type ConfigRenderer ¶ added in v0.22.0
type ConfigRenderer struct {
// contains filtered or unexported fields
}
ConfigRenderer renders config status messages with styled output.
func NewConfigRenderer ¶ added in v0.22.0
func NewConfigRenderer(theme *Theme) *ConfigRenderer
NewConfigRenderer creates a new config renderer with the given theme.
func (*ConfigRenderer) RenderChanges ¶ added in v0.22.0
func (r *ConfigRenderer) RenderChanges(changes []port.KeyChange) string
RenderChanges renders the list of detected changes (added, renamed, removed).
func (*ConfigRenderer) RenderChangesSummary ¶ added in v0.22.0
func (r *ConfigRenderer) RenderChangesSummary(changes []port.KeyChange) string
RenderChangesSummary renders a summary of changes for the config info header.
func (*ConfigRenderer) RenderChecking ¶ added in v0.22.0
func (*ConfigRenderer) RenderChecking(spinner string) string
RenderChecking renders the "checking config..." message with spinner.
func (*ConfigRenderer) RenderConfigInfo ¶ added in v0.22.0
func (r *ConfigRenderer) RenderConfigInfo(path string, changeCount int) string
RenderConfigInfo renders the config file info with status.
func (*ConfigRenderer) RenderError ¶ added in v0.22.0
func (r *ConfigRenderer) RenderError(err error) string
RenderError renders an error message.
func (*ConfigRenderer) RenderMigrateHint ¶ added in v0.22.0
func (r *ConfigRenderer) RenderMigrateHint() string
RenderMigrateHint renders a hint to run the migrate command.
func (*ConfigRenderer) RenderMigrationSuccess ¶ added in v0.22.0
func (r *ConfigRenderer) RenderMigrationSuccess(count int, path string) string
RenderMigrationSuccess renders the success message after migration.
func (*ConfigRenderer) RenderMissingKeys ¶ added in v0.22.0
func (r *ConfigRenderer) RenderMissingKeys(keys []port.KeyInfo) string
RenderMissingKeys renders the list of missing keys with their types and default values.
func (*ConfigRenderer) RenderNoConfigFile ¶ added in v0.22.0
func (r *ConfigRenderer) RenderNoConfigFile(path string) string
RenderNoConfigFile renders message when config file doesn't exist yet.
func (*ConfigRenderer) RenderOpening ¶ added in v0.27.0
func (r *ConfigRenderer) RenderOpening(path, editor string) string
RenderOpening renders a brief "opening config" message for `dumber config open`.
func (*ConfigRenderer) RenderUpToDate ¶ added in v0.22.0
func (r *ConfigRenderer) RenderUpToDate(path string) string
RenderUpToDate renders the "config is up to date" message.
type ConfigSchemaRenderer ¶ added in v0.22.0
type ConfigSchemaRenderer struct {
// contains filtered or unexported fields
}
ConfigSchemaRenderer renders configuration schema information.
func NewConfigSchemaRenderer ¶ added in v0.22.0
func NewConfigSchemaRenderer(theme *Theme) *ConfigSchemaRenderer
NewConfigSchemaRenderer creates a new ConfigSchemaRenderer.
func (*ConfigSchemaRenderer) Render ¶ added in v0.22.0
func (r *ConfigSchemaRenderer) Render(keys []entity.ConfigKeyInfo) string
Render renders the configuration schema in styled format.
func (*ConfigSchemaRenderer) RenderJSON ¶ added in v0.22.0
func (*ConfigSchemaRenderer) RenderJSON(keys []entity.ConfigKeyInfo) (string, error)
RenderJSON renders the configuration schema as JSON.
type ConfirmKeyMap ¶
type ConfirmKeyMap struct {
Yes key.Binding
No key.Binding
Left key.Binding
Right key.Binding
Confirm key.Binding
Cancel key.Binding
}
ConfirmKeyMap defines keybindings for the confirm dialog.
func DefaultConfirmKeyMap ¶
func DefaultConfirmKeyMap() ConfirmKeyMap
DefaultConfirmKeyMap returns the default keybindings.
type ConfirmModel ¶
type ConfirmModel struct {
Message string
Yes bool // Current selection
Confirmed bool // User pressed enter
Canceled bool // User pressed escape
// contains filtered or unexported fields
}
ConfirmModel is a yes/no confirmation dialog.
func NewConfirm ¶
func NewConfirm(theme *Theme, message string) ConfirmModel
NewConfirm creates a new confirmation dialog.
func (ConfirmModel) Done ¶
func (m ConfirmModel) Done() bool
Done returns true if the dialog is complete.
func (ConfirmModel) Result ¶
func (m ConfirmModel) Result() bool
Result returns true if user confirmed "Yes".
func (ConfirmModel) Update ¶
func (m ConfirmModel) Update(msg tea.Msg) (ConfirmModel, tea.Cmd)
Update implements tea.Model.
type ConfirmResult ¶
ConfirmResult wraps the confirm dialog result for parent models.
type ConfirmResultMsg ¶
type ConfirmResultMsg ConfirmResult
ConfirmResultMsg is sent when the confirm dialog completes.
type CrashesCLIRenderer ¶ added in v0.27.0
type CrashesCLIRenderer struct {
// contains filtered or unexported fields
}
CrashesCLIRenderer renders non-interactive CLI output for crashes subcommands that otherwise print raw crash markdown to stdout.
func NewCrashesCLIRenderer ¶ added in v0.27.0
func NewCrashesCLIRenderer(theme *Theme) *CrashesCLIRenderer
func (*CrashesCLIRenderer) RenderError ¶ added in v0.27.0
func (r *CrashesCLIRenderer) RenderError(err error) string
func (*CrashesCLIRenderer) RenderHintList ¶ added in v0.27.0
func (r *CrashesCLIRenderer) RenderHintList() string
type DmenuKeyMap ¶
type DmenuKeyMap struct {
}
DmenuKeyMap defines keybindings for dmenu browser.
func DefaultDmenuKeyMap ¶
func DefaultDmenuKeyMap() DmenuKeyMap
DefaultDmenuKeyMap returns the default dmenu keybindings.
func (DmenuKeyMap) FullHelp ¶
func (k DmenuKeyMap) FullHelp() [][]key.Binding
FullHelp returns keybindings for expanded help.
func (DmenuKeyMap) ShortHelp ¶
func (k DmenuKeyMap) ShortHelp() []key.Binding
ShortHelp returns keybindings to show in compact help.
type DoctorMediaReport ¶
type DoctorMediaReport struct {
GStreamerAvailable bool
HWAccelAvailable bool
AV1HWAvailable bool
HasVAPlugin bool
HasVAAPIPlugin bool
HasNVCodecPlugin bool
AV1Decoders []string
H264Decoders []string
H265Decoders []string
VP9Decoders []string
VAAPIAvailable bool
VAAPIDriver string
VAAPIVersion string
Warnings []string
}
type DoctorRenderer ¶
type DoctorRenderer struct {
// contains filtered or unexported fields
}
func NewDoctorRenderer ¶
func NewDoctorRenderer(theme *Theme) *DoctorRenderer
func (*DoctorRenderer) Render ¶
func (r *DoctorRenderer) Render(report DoctorReport) string
type DoctorReport ¶
type DoctorReport struct {
OverallOK bool
Runtime DoctorRuntimeReport
Media *DoctorMediaReport
}
type DoctorRuntimeCheck ¶
type DoctorRuntimeReport ¶
type DoctorRuntimeReport struct {
Prefix string
OK bool
Checks []DoctorRuntimeCheck
}
type DomainStatsRow ¶
DomainStatsRow converts domain stats to table row.
func (DomainStatsRow) ToRow ¶
func (d DomainStatsRow) ToRow() table.Row
ToRow converts to table.Row.
type HistoryDelegate ¶
HistoryDelegate renders history items with theme styling.
func NewHistoryDelegate ¶
func NewHistoryDelegate(theme *Theme) HistoryDelegate
NewHistoryDelegate creates a themed history list delegate.
func (HistoryDelegate) Height ¶
func (d HistoryDelegate) Height() int
Height returns the height of each item.
func (HistoryDelegate) Spacing ¶
func (d HistoryDelegate) Spacing() int
Spacing returns the spacing between items.
type HistoryItem ¶
type HistoryItem struct {
ID int64
URL string
Title string
Domain string
VisitCount int
LastVisited time.Time
}
HistoryItem represents a history entry for the list.
func (HistoryItem) DescriptionValue ¶
func (i HistoryItem) DescriptionValue() string
Description implements list.DefaultItem.
func (HistoryItem) FilterValue ¶
func (i HistoryItem) FilterValue() string
FilterValue implements list.Item.
func (HistoryItem) TitleValue ¶
func (i HistoryItem) TitleValue() string
Title implements list.DefaultItem.
type HistoryKeyMap ¶
type HistoryKeyMap struct {
Up key.Binding
Down key.Binding
Tab1 key.Binding
Tab2 key.Binding
Tab3 key.Binding
Tab4 key.Binding
NextTab key.Binding
PrevTab key.Binding
Search key.Binding
Open key.Binding
Delete key.Binding
DeleteDomain key.Binding
Cleanup key.Binding
Filter key.Binding
Help key.Binding
Quit key.Binding
}
HistoryKeyMap defines keybindings for history browser.
func DefaultHistoryKeyMap ¶
func DefaultHistoryKeyMap() HistoryKeyMap
DefaultHistoryKeyMap returns the default history keybindings.
func (HistoryKeyMap) FullHelp ¶
func (k HistoryKeyMap) FullHelp() [][]key.Binding
FullHelp returns keybindings for expanded help.
func (HistoryKeyMap) ShortHelp ¶
func (k HistoryKeyMap) ShortHelp() []key.Binding
ShortHelp returns keybindings to show in compact help.
type LoadingModel ¶
type LoadingModel struct {
Spinner spinner.Model
Message string
// contains filtered or unexported fields
}
LoadingModel wraps a spinner with a message.
func NewLoading ¶
func NewLoading(theme *Theme, message string) LoadingModel
NewLoading creates a loading indicator with message.
type PurgeItem ¶
type PurgeItem struct {
entity.PurgeTarget
Selected bool
}
PurgeItem wraps entity.PurgeTarget with selection state for the UI.
type PurgeKeyMap ¶
type PurgeKeyMap struct {
Up key.Binding
Down key.Binding
Toggle key.Binding
ToggleAll key.Binding
Confirm key.Binding
Cancel key.Binding
}
PurgeKeyMap defines keybindings for purge modal.
func DefaultPurgeKeyMap ¶
func DefaultPurgeKeyMap() PurgeKeyMap
DefaultPurgeKeyMap returns default keybindings.
type PurgeModel ¶
type PurgeModel struct {
Items []PurgeItem
Sessions []entity.SessionPurgeItem
SessionsSize int64 // Total size of all session snapshots
Cursor int // Flat cursor index across all rows
Confirmed bool
Canceled bool
// contains filtered or unexported fields
}
PurgeModel is the multi-select purge modal with simplified sessions support. Sessions are handled as a single "purge all" option instead of individual selection.
func NewPurge ¶
func NewPurge(theme *Theme, targets []entity.PurgeTarget) PurgeModel
NewPurge creates a new purge modal with the given targets.
func NewPurgeWithSessions ¶ added in v0.21.0
func NewPurgeWithSessions(theme *Theme, targets []entity.PurgeTarget, sessions []entity.SessionPurgeItem, sessionsSize int64) PurgeModel
NewPurgeWithSessions creates a new purge modal with targets and sessions.
func (PurgeModel) Done ¶
func (m PurgeModel) Done() bool
Done returns true if the modal is complete.
func (PurgeModel) SelectedCount ¶
func (m PurgeModel) SelectedCount() int
SelectedCount returns the number of selected items (targets + sessions as 1 if selected).
func (PurgeModel) SelectedSessionIDs ¶ added in v0.21.0
func (m PurgeModel) SelectedSessionIDs() []entity.SessionID
SelectedSessionIDs returns the IDs of all sessions if sessions are selected. Returns nil if Data is selected (sessions are deleted with the database) or if sessions are not selected.
func (PurgeModel) SelectedSize ¶
func (m PurgeModel) SelectedSize() int64
SelectedSize returns the total size of selected items. When Data is selected, includes SessionsSize since DB will be removed.
func (PurgeModel) SelectedTypes ¶
func (m PurgeModel) SelectedTypes() []entity.PurgeTargetType
SelectedTypes returns the selected target types.
func (PurgeModel) SessionsEnabled ¶ added in v0.21.0
func (m PurgeModel) SessionsEnabled() bool
SessionsEnabled returns true if sessions can be selected. Sessions are disabled when Data is selected (database will be removed).
func (*PurgeModel) ToggleAllSessions ¶ added in v0.21.0
func (m *PurgeModel) ToggleAllSessions()
ToggleAllSessions toggles the selection state of all sessions.
func (PurgeModel) Update ¶
func (m PurgeModel) Update(msg tea.Msg) (PurgeModel, tea.Cmd)
Update implements tea.Model.
type SessionsCLIRenderer ¶ added in v0.27.0
type SessionsCLIRenderer struct {
// contains filtered or unexported fields
}
SessionsCLIRenderer renders non-interactive CLI output for sessions subcommands (e.g. `dumber sessions list`, `restore`, `delete`).
func NewSessionsCLIRenderer ¶ added in v0.27.0
func NewSessionsCLIRenderer(theme *Theme) *SessionsCLIRenderer
func (*SessionsCLIRenderer) RenderDeleted ¶ added in v0.27.0
func (r *SessionsCLIRenderer) RenderDeleted(sessionID entity.SessionID) string
func (*SessionsCLIRenderer) RenderEmptyList ¶ added in v0.27.0
func (r *SessionsCLIRenderer) RenderEmptyList() string
func (*SessionsCLIRenderer) RenderError ¶ added in v0.27.0
func (r *SessionsCLIRenderer) RenderError(err error) string
func (*SessionsCLIRenderer) RenderList ¶ added in v0.27.0
func (r *SessionsCLIRenderer) RenderList(items []entity.SessionInfo, limit int) string
func (*SessionsCLIRenderer) RenderRestoreStarted ¶ added in v0.27.0
func (r *SessionsCLIRenderer) RenderRestoreStarted(sessionID entity.SessionID) string
type SimpleDelegate ¶
type SimpleDelegate struct {
Theme *Theme
}
SimpleDelegate renders simple items.
func (SimpleDelegate) Height ¶
func (d SimpleDelegate) Height() int
Height returns the height of each item.
func (SimpleDelegate) Spacing ¶
func (d SimpleDelegate) Spacing() int
Spacing returns the spacing between items.
type SimpleItem ¶
SimpleItem is a basic list item with title and description.
func (SimpleItem) FilterValue ¶
func (i SimpleItem) FilterValue() string
FilterValue implements list.Item.
type SpinnerType ¶
type SpinnerType int
SpinnerType defines available spinner styles.
const ( SpinnerDots SpinnerType = iota SpinnerLine SpinnerMiniDot SpinnerJump SpinnerPulse SpinnerPoints SpinnerGlobe SpinnerMoon SpinnerMonkey )
type TabsModel ¶
TabsModel represents a horizontal tab bar.
func TimelineTabs ¶
TimelineTabs creates tabs for history timeline view.
func (TabsModel) ViewCompact ¶
ViewCompact renders a compact tab bar without separators.
func (TabsModel) ViewWithCounts ¶
ViewWithCounts renders tabs with item counts.
type Theme ¶
type Theme struct {
// Base colors (from config.ColorPalette)
Background lipgloss.Color
Surface lipgloss.Color
SurfaceVariant lipgloss.Color
Text lipgloss.Color
Muted lipgloss.Color
Accent lipgloss.Color
Border lipgloss.Color
// Additional semantic colors
Error lipgloss.Color
Warning lipgloss.Color
Success lipgloss.Color
// Pre-built styles
Title lipgloss.Style
Subtitle lipgloss.Style
Normal lipgloss.Style
Subtle lipgloss.Style
Highlight lipgloss.Style
ErrorStyle lipgloss.Style
WarningStyle lipgloss.Style
SuccessStyle lipgloss.Style
// Component styles
ActiveTab lipgloss.Style
InactiveTab lipgloss.Style
TabBar lipgloss.Style
ListItem lipgloss.Style
ListItemSelected lipgloss.Style
ListItemTitle lipgloss.Style
ListItemDesc lipgloss.Style
Badge lipgloss.Style
BadgeMuted lipgloss.Style
Input lipgloss.Style
InputFocused lipgloss.Style
HelpKey lipgloss.Style
HelpDesc lipgloss.Style
Box lipgloss.Style
BoxHeader lipgloss.Style
}
Theme holds lipgloss colors and styles derived from config.
func NewThemeFromPalette ¶
func NewThemeFromPalette(p config.ColorPalette) *Theme
NewThemeFromPalette creates a Theme from a ColorPalette.
func (*Theme) AccentBadge ¶
AccentBadge renders a badge with accent color.
func (*Theme) DomainBadge ¶
DomainBadge renders a domain badge.
func (*Theme) MutedBadge ¶
MutedBadge renders a badge with muted colors.
func (*Theme) StatusBadge ¶
StatusBadge renders a status badge with custom colors.
func (*Theme) VisitBadge ¶
VisitBadge renders a visit count badge.
type TimeCategory ¶
type TimeCategory int
TimeCategory returns which timeline category a time belongs to.
const ( TimeCategoryToday TimeCategory = iota TimeCategoryYesterday TimeCategoryThisWeek TimeCategoryOlder )
func GetTimeCategory ¶
func GetTimeCategory(tm time.Time) TimeCategory
GetTimeCategory returns the category for a given time.
type UpdateRenderer ¶ added in v0.22.0
type UpdateRenderer struct {
// contains filtered or unexported fields
}
UpdateRenderer renders update status messages with styled output.
func NewUpdateRenderer ¶ added in v0.22.0
func NewUpdateRenderer(theme *Theme) *UpdateRenderer
NewUpdateRenderer creates a new update renderer with the given theme.
func (*UpdateRenderer) RenderAvailable ¶ added in v0.22.0
func (r *UpdateRenderer) RenderAvailable(current, latest, releaseURL string) string
RenderAvailable renders the "update available" message.
func (*UpdateRenderer) RenderCannotAutoUpdate ¶ added in v0.22.0
func (r *UpdateRenderer) RenderCannotAutoUpdate(current, latest, releaseURL string) string
RenderCannotAutoUpdate renders the "cannot auto-update" message.
func (*UpdateRenderer) RenderChecking ¶ added in v0.22.0
func (*UpdateRenderer) RenderChecking(spinner string) string
RenderChecking renders the "checking for updates" message.
func (*UpdateRenderer) RenderDevBuild ¶ added in v0.22.0
func (r *UpdateRenderer) RenderDevBuild() string
RenderDevBuild renders the "dev build" skip message.
func (*UpdateRenderer) RenderDownloading ¶ added in v0.22.0
func (r *UpdateRenderer) RenderDownloading(spinner, version string) string
RenderDownloading renders the "downloading" message with spinner.
func (*UpdateRenderer) RenderError ¶ added in v0.22.0
func (r *UpdateRenderer) RenderError(err error) string
RenderError renders an error message.
func (*UpdateRenderer) RenderStaged ¶ added in v0.22.0
func (r *UpdateRenderer) RenderStaged(version string) string
RenderStaged renders the "update staged" success message.
func (*UpdateRenderer) RenderUpToDate ¶ added in v0.22.0
func (r *UpdateRenderer) RenderUpToDate(version string) string
RenderUpToDate renders the "already up to date" message.