Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FuzzyMatch ¶
FuzzyMatch checks whether all characters of query appear in target in order (case-insensitive). Returns whether it matched and a relevance score.
Scoring rewards:
- consecutive character matches
- matches at the start of the string
- matches at word boundaries (after space, /, -, _)
Types ¶
type DigModel ¶
type DigModel struct {
// contains filtered or unexported fields
}
DigModel is a full-screen Bubbletea timer model for focus sessions.
func NewDigModel ¶
NewDigModel creates a new DigModel.
type DigResult ¶
type DigResult struct {
Elapsed time.Duration
Completed bool // true if the full duration was reached
Canceled bool // true if user quit early
}
DigResult is returned when the dig TUI session ends.
type Item ¶
type Item interface {
// FilterValue returns the string used for fuzzy matching.
FilterValue() string
// Title returns the main display text.
Title() string
// Description returns optional secondary text (can be empty).
Description() string
}
Item is the interface that list items must implement for the picker.
func Run ¶
func Run(items []Item, opts ...PickerOption) (Item, error)
Run is the convenience entry point: show a picker and return the selected item. Returns nil and no error if the user canceled.
func RunWithOutput ¶
RunWithOutput renders the picker UI to the provided writer. Useful when stdout is captured but an interactive TTY UI is still desired.
type Picker ¶
type Picker struct {
// contains filtered or unexported fields
}
Picker is a reusable fuzzy-search list selector built on Bubbletea. Use Run() for the common case, or create a Picker and drive it manually.
func NewPicker ¶
func NewPicker(items []Item, opts ...PickerOption) *Picker
NewPicker creates a Picker with the given items and options.
type PickerOption ¶
type PickerOption func(*Picker)
PickerOption configures a Picker.
func WithHeight ¶
func WithHeight(h int) PickerOption
WithHeight sets the maximum visible items (0 = auto).
func WithPrompt ¶
func WithPrompt(prompt string) PickerOption
WithPrompt sets the search prompt character(s).
func WithTitle ¶
func WithTitle(title string) PickerOption
WithTitle sets the heading displayed above the picker.
type TodoAction ¶
type TodoAction struct {
Type string // "toggle", "delete", "add", "schedule", "quit"
ID int
Text string
Schedule string // for "schedule" actions
ProjectPath *string // project context for "add" actions
}
TodoAction represents an action taken in the todo TUI.
type TodoModel ¶
type TodoModel struct {
// pending actions to apply after quitting
Actions []TodoAction
// contains filtered or unexported fields
}
TodoModel is a full interactive Bubbletea model for managing todos.
func NewTodoModel ¶
NewTodoModel creates a new TodoModel with the given todos.