app

package
v1.54.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormKind

type FormKind int

type Mode

type Mode int

type Model

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

func NewModel

func NewModel(store *data.Store, options Options) (*Model, error)

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 Options

type Options struct {
	DBPath           string
	ConfigPath       string
	LLMConfig        *llmConfig // nil if LLM is not configured
	ExtractionConfig extractionConfig
}

func (*Options) SetExtraction added in v1.45.0

func (o *Options) SetExtraction(
	model string,
	extractors []extract.Extractor,
	enabled, thinking bool,
)

SetExtraction configures the extraction pipeline on the Options.

func (*Options) SetLLM added in v1.22.0

func (o *Options) SetLLM(
	baseURL, model, extraContext string,
	timeout time.Duration,
	thinking *bool,
)

SetLLM configures the LLM backend on the Options. Pass empty strings to disable the LLM feature.

type Styles

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

Styles holds the application's pre-built lipgloss styles. Fields are private; use the public accessor methods to read them. Duplicate style definitions share a single backing field, cutting storage from 93 fields to 39.

func DefaultStyles

func DefaultStyles() *Styles

func (*Styles) AccentBold added in v1.54.1

func (s *Styles) AccentBold() lipgloss.Style

func (*Styles) AccentText added in v1.54.1

func (s *Styles) AccentText() lipgloss.Style

func (*Styles) Base added in v1.54.1

func (s *Styles) Base() lipgloss.Style

func (*Styles) Breadcrumb

func (s *Styles) Breadcrumb() lipgloss.Style

func (*Styles) BreadcrumbArrow

func (s *Styles) BreadcrumbArrow() lipgloss.Style

func (*Styles) CalCursor added in v1.6.0

func (s *Styles) CalCursor() lipgloss.Style

func (*Styles) CalDayLabel added in v1.50.0

func (s *Styles) CalDayLabel() lipgloss.Style

func (*Styles) CalHeader added in v1.50.0

func (s *Styles) CalHeader() lipgloss.Style

func (*Styles) CalHintKey added in v1.50.0

func (s *Styles) CalHintKey() lipgloss.Style

func (*Styles) CalSelected added in v1.6.0

func (s *Styles) CalSelected() lipgloss.Style

func (*Styles) CalToday added in v1.6.0

func (s *Styles) CalToday() lipgloss.Style

func (*Styles) CellDim added in v1.50.0

func (s *Styles) CellDim() lipgloss.Style

func (*Styles) ChatAssistant added in v1.22.0

func (s *Styles) ChatAssistant() lipgloss.Style

func (*Styles) ChatInterrupted added in v1.22.0

func (s *Styles) ChatInterrupted() lipgloss.Style

func (*Styles) ChatNotice added in v1.22.0

func (s *Styles) ChatNotice() lipgloss.Style

func (*Styles) ChatUser added in v1.22.0

func (s *Styles) ChatUser() lipgloss.Style

func (*Styles) ColActiveHeader

func (s *Styles) ColActiveHeader() lipgloss.Style

func (*Styles) DashHouseValue added in v1.53.0

func (s *Styles) DashHouseValue() lipgloss.Style

func (*Styles) DashLabel

func (s *Styles) DashLabel() lipgloss.Style

func (*Styles) DashOverdue

func (s *Styles) DashOverdue() lipgloss.Style

func (*Styles) DashRule added in v1.16.0

func (s *Styles) DashRule() lipgloss.Style

func (*Styles) DashSection

func (s *Styles) DashSection() lipgloss.Style

func (*Styles) DashSectionAlert added in v1.36.0

func (s *Styles) DashSectionAlert() lipgloss.Style

func (*Styles) DashSectionWarn added in v1.16.0

func (s *Styles) DashSectionWarn() lipgloss.Style

func (*Styles) DashSubtitle added in v1.5.0

func (s *Styles) DashSubtitle() lipgloss.Style

func (*Styles) DashUpcoming

func (s *Styles) DashUpcoming() lipgloss.Style

func (*Styles) DashValue

func (s *Styles) DashValue() lipgloss.Style

func (*Styles) DeletedCell added in v1.50.0

func (s *Styles) DeletedCell() lipgloss.Style

func (*Styles) DeletedLabel

func (s *Styles) DeletedLabel() lipgloss.Style

func (*Styles) DimPath added in v1.54.1

func (s *Styles) DimPath() lipgloss.Style

func (*Styles) Drilldown

func (s *Styles) Drilldown() lipgloss.Style

func (*Styles) Empty

func (s *Styles) Empty() lipgloss.Style

func (*Styles) EntityKindStyle added in v1.54.1

func (s *Styles) EntityKindStyle(letter byte) (lipgloss.Style, bool)

func (*Styles) Error

func (s *Styles) Error() lipgloss.Style

func (*Styles) ExtCursor added in v1.50.0

func (s *Styles) ExtCursor() lipgloss.Style

func (*Styles) ExtDone added in v1.50.0

func (s *Styles) ExtDone() lipgloss.Style

func (*Styles) ExtFail added in v1.50.0

func (s *Styles) ExtFail() lipgloss.Style

func (*Styles) ExtFailed added in v1.50.0

func (s *Styles) ExtFailed() lipgloss.Style

func (*Styles) ExtOk added in v1.50.0

func (s *Styles) ExtOk() lipgloss.Style

func (*Styles) ExtPending added in v1.50.0

func (s *Styles) ExtPending() lipgloss.Style

func (*Styles) ExtRerun added in v1.50.0

func (s *Styles) ExtRerun() lipgloss.Style

func (*Styles) ExtRunning added in v1.50.0

func (s *Styles) ExtRunning() lipgloss.Style

func (*Styles) FilterMark added in v1.25.0

func (s *Styles) FilterMark() lipgloss.Style

func (*Styles) FormClean

func (s *Styles) FormClean() lipgloss.Style

func (*Styles) FormDirty

func (s *Styles) FormDirty() lipgloss.Style

func (*Styles) Header

func (s *Styles) Header() lipgloss.Style

func (*Styles) HeaderBadge

func (s *Styles) HeaderBadge() lipgloss.Style

func (*Styles) HeaderBox

func (s *Styles) HeaderBox() lipgloss.Style

func (*Styles) HeaderHint

func (s *Styles) HeaderHint() lipgloss.Style

func (*Styles) HeaderLabel

func (s *Styles) HeaderLabel() lipgloss.Style

func (*Styles) HeaderSection

func (s *Styles) HeaderSection() lipgloss.Style

func (*Styles) HeaderTitle

func (s *Styles) HeaderTitle() lipgloss.Style

func (*Styles) HeaderValue

func (s *Styles) HeaderValue() lipgloss.Style

func (*Styles) HiddenLeft

func (s *Styles) HiddenLeft() lipgloss.Style

func (*Styles) HiddenRight

func (s *Styles) HiddenRight() lipgloss.Style

func (*Styles) HouseDoor added in v1.50.0

func (s *Styles) HouseDoor() lipgloss.Style

func (*Styles) HouseRoof added in v1.50.0

func (s *Styles) HouseRoof() lipgloss.Style

func (*Styles) HouseWall added in v1.50.0

func (s *Styles) HouseWall() lipgloss.Style

func (*Styles) HouseWindow added in v1.50.0

func (s *Styles) HouseWindow() lipgloss.Style

func (*Styles) Info

func (s *Styles) Info() lipgloss.Style

func (*Styles) Keycap

func (s *Styles) Keycap() lipgloss.Style

func (*Styles) LinkIndicator

func (s *Styles) LinkIndicator() lipgloss.Style

func (*Styles) ModeEdit

func (s *Styles) ModeEdit() lipgloss.Style

func (*Styles) ModeNormal

func (s *Styles) ModeNormal() lipgloss.Style

func (*Styles) ModelActive added in v1.50.0

func (s *Styles) ModelActive() lipgloss.Style

func (*Styles) ModelActiveHL added in v1.50.0

func (s *Styles) ModelActiveHL() lipgloss.Style

func (*Styles) ModelLocal added in v1.50.0

func (s *Styles) ModelLocal() lipgloss.Style

func (*Styles) ModelLocalHL added in v1.50.0

func (s *Styles) ModelLocalHL() lipgloss.Style

func (*Styles) ModelRemote added in v1.50.0

func (s *Styles) ModelRemote() lipgloss.Style

func (*Styles) ModelRemoteHL added in v1.50.0

func (s *Styles) ModelRemoteHL() lipgloss.Style

func (*Styles) Money

func (s *Styles) Money() lipgloss.Style

func (*Styles) Null added in v1.33.1

func (s *Styles) Null() lipgloss.Style

func (*Styles) OverlayBox added in v1.54.1

func (s *Styles) OverlayBox() lipgloss.Style

func (*Styles) Pinned added in v1.23.0

func (s *Styles) Pinned() lipgloss.Style

func (*Styles) Readonly

func (s *Styles) Readonly() lipgloss.Style

func (*Styles) Rule added in v1.54.1

func (s *Styles) Rule() lipgloss.Style

func (*Styles) SecondaryText added in v1.54.1

func (s *Styles) SecondaryText() lipgloss.Style

func (*Styles) SortArrow added in v1.50.0

func (s *Styles) SortArrow() lipgloss.Style

func (*Styles) StatusStyle added in v1.54.1

func (s *Styles) StatusStyle(key string) (lipgloss.Style, bool)

func (*Styles) TabActive

func (s *Styles) TabActive() lipgloss.Style

func (*Styles) TabInactive

func (s *Styles) TabInactive() lipgloss.Style

func (*Styles) TabLocked

func (s *Styles) TabLocked() lipgloss.Style

func (*Styles) TabUnderline

func (s *Styles) TabUnderline() lipgloss.Style

func (*Styles) TableHeader

func (s *Styles) TableHeader() lipgloss.Style

func (*Styles) TableSelected

func (s *Styles) TableSelected() lipgloss.Style

func (*Styles) TableSeparator

func (s *Styles) TableSeparator() lipgloss.Style

func (*Styles) TextDim added in v1.54.1

func (s *Styles) TextDim() lipgloss.Style

func (*Styles) UrgencyFar added in v1.54.1

func (s *Styles) UrgencyFar() lipgloss.Style

func (*Styles) UrgencyOverdue added in v1.54.1

func (s *Styles) UrgencyOverdue() lipgloss.Style

func (*Styles) UrgencySoon added in v1.54.1

func (s *Styles) UrgencySoon() lipgloss.Style

func (*Styles) UrgencyUpcoming added in v1.54.1

func (s *Styles) UrgencyUpcoming() lipgloss.Style

func (*Styles) WarrantyActive added in v1.54.1

func (s *Styles) WarrantyActive() lipgloss.Style

func (*Styles) WarrantyExpired added in v1.54.1

func (s *Styles) WarrantyExpired() lipgloss.Style

type Tab

type Tab struct {
	Kind        TabKind
	Name        string
	Handler     TabHandler
	Table       table.Model
	Rows        []rowMeta
	Specs       []columnSpec
	CellRows    [][]cell
	ColCursor   int
	ViewOffset  int // first visible column in horizontal scroll viewport
	LastDeleted *uint
	ShowDeleted bool
	Sorts       []sortEntry
	Stale       bool // true when data may be outdated; cleared on reload

	// Pin-and-filter state.
	Pins           []filterPin // active pins; AND across columns, OR within
	FilterActive   bool        // true = non-matching rows hidden; false = preview only
	FilterInverted bool        // true = show rows that DON'T match instead of rows that do

	// Full data (pre-row-filter). Populated by reloadTab after project status
	// filtering. Row filter operates on these without hitting the DB.
	FullRows     []table.Row
	FullMeta     []rowMeta
	FullCellRows [][]cell
}

func NewTabs

func NewTabs() []Tab

type TabHandler

type TabHandler interface {
	// FormKind returns the FormKind that identifies this entity in forms and
	// undo entries.
	FormKind() FormKind

	// Load fetches entities and converts them to table rows.
	Load(store *data.Store, showDeleted bool) ([]table.Row, []rowMeta, [][]cell, error)

	// Delete soft-deletes the entity with the given ID.
	Delete(store *data.Store, id uint) error

	// Restore reverses a soft-delete.
	Restore(store *data.Store, id uint) error

	// StartAddForm opens a "new entity" form on the model.
	StartAddForm(m *Model) error

	// StartEditForm opens an "edit entity" form for the given ID.
	StartEditForm(m *Model, id uint) error

	// InlineEdit opens a single-field editor for the given column.
	InlineEdit(m *Model, id uint, col int) error

	// SubmitForm persists the current form data (create or update).
	SubmitForm(m *Model) error

	// Snapshot captures the current DB state of an entity for undo/redo.
	Snapshot(store *data.Store, id uint) (undoEntry, bool)

	// SyncFixedValues updates column specs with values from dynamic lookup
	// tables so column widths stay stable.
	SyncFixedValues(m *Model, specs []columnSpec)
}

TabHandler encapsulates entity-specific operations for a tab, eliminating TabKind/FormKind switch dispatch scattered across the codebase. Each entity type (projects, quotes, maintenance, appliances) implements this interface.

type TabKind

type TabKind int

func (TabKind) String

func (k TabKind) String() string

Jump to

Keyboard shortcuts

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