components

package
v0.0.0-...-c947b55 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calendar

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

Calendar is a date picker component that displays a month view calendar

func NewCalendar

func NewCalendar(initialDate time.Time) Calendar

NewCalendar creates a new calendar picker

func (Calendar) GetSelectedDate

func (c Calendar) GetSelectedDate() time.Time

GetSelectedDate returns the currently selected date

func (Calendar) Init

func (c Calendar) Init() tea.Cmd

Init implements tea.Model

func (Calendar) Update

func (c Calendar) Update(msg tea.Msg) (Calendar, tea.Cmd)

Update handles keyboard input

func (Calendar) View

func (c Calendar) View() string

View renders the calendar

type CalendarResult

type CalendarResult struct {
	Date     time.Time
	Canceled bool
}

CalendarResult is returned when a date is selected

type ClearStatusMsg

type ClearStatusMsg struct{}

ClearStatusMsg is sent when the status message should be cleared

type CustomCommand

type CustomCommand struct {
	Name        string
	Command     string
	Description string
}

CustomCommand represents a user-configured custom command (mirrors config.CustomCommand)

type DisplayMode

type DisplayMode int

DisplayMode indicates what the task list is displaying

const (
	DisplayModeTasks DisplayMode = iota
	DisplayModeGroups
)

type Filter

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

Filter is a component for entering task filter syntax

func NewFilter

func NewFilter() Filter

NewFilter creates a new filter input component

func (*Filter) AddToHistory

func (f *Filter) AddToHistory(value string)

AddToHistory adds a filter command to the history

func (*Filter) Blur

func (f *Filter) Blur()

Blur removes focus from the filter input

func (Filter) CursorPosition

func (f Filter) CursorPosition() int

CursorPosition returns the current cursor position as a byte offset from start For textarea, we return the length of the text (cursor assumed at end) This is a simplification since textarea doesn't expose cursor position publicly

func (*Filter) Focus

func (f *Filter) Focus() tea.Cmd

Focus sets focus on the filter input

func (*Filter) NavigateHistoryDown

func (f *Filter) NavigateHistoryDown()

NavigateHistoryDown moves to the next command in history (or back to current input)

func (*Filter) NavigateHistoryUp

func (f *Filter) NavigateHistoryUp()

NavigateHistoryUp moves to the previous command in history

func (*Filter) ResetHistoryNavigation

func (f *Filter) ResetHistoryNavigation()

ResetHistoryNavigation resets the history navigation state

func (*Filter) SetCursor

func (f *Filter) SetCursor(pos int)

SetCursor sets the cursor position (moves to end for textarea) Note: textarea doesn't support arbitrary position setting like textinput, so we move to the end after inserting text

func (*Filter) SetHeight

func (f *Filter) SetHeight(height int)

SetHeight sets the height of the filter input

func (*Filter) SetValue

func (f *Filter) SetValue(value string)

SetValue sets the filter text

func (*Filter) SetWidth

func (f *Filter) SetWidth(width int)

SetWidth sets the width of the filter input

func (Filter) Update

func (f Filter) Update(msg tea.Msg) (Filter, tea.Cmd)

Update handles messages for the filter input

func (Filter) Value

func (f Filter) Value() string

Value returns the current filter text

func (Filter) View

func (f Filter) View() string

View renders the filter input

type FloatingWindow

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

FloatingWindow represents a centered overlay window

func NewFloatingWindow

func NewFloatingWindow(title, hint string, styles FloatingWindowStyles) FloatingWindow

NewFloatingWindow creates a new floating window component

func (FloatingWindow) Render

func (fw FloatingWindow) Render(content string, width, height int) string

Render renders the floating window with the given content at the center of the screen content is typically the input field view width and height are the dimensions of the terminal

func (*FloatingWindow) SetHint

func (fw *FloatingWindow) SetHint(hint string)

SetHint updates the hint text

func (*FloatingWindow) SetTitle

func (fw *FloatingWindow) SetTitle(title string)

SetTitle updates the window title

type FloatingWindowStyles

type FloatingWindowStyles struct {
	Border lipgloss.Style
	Title  lipgloss.Style
	Hint   lipgloss.Style
}

FloatingWindowStyles contains styling for the floating window

type Help

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

Help component displays the help screen with keybinding reference

func NewHelp

func NewHelp(width, height int, styles HelpStyles) Help

NewHelp creates a new help component with default keybindings

func NewHelpWithCustomCommands

func NewHelpWithCustomCommands(width, height int, styles HelpStyles, keybindings map[string]string, customCommands map[string]CustomCommand) Help

NewHelpWithCustomCommands creates a new help component with custom keybindings and custom commands

func NewHelpWithKeybindings

func NewHelpWithKeybindings(width, height int, styles HelpStyles, keybindings map[string]string) Help

NewHelpWithKeybindings creates a new help component with custom keybindings from config

func (*Help) SetKeybindings

func (h *Help) SetKeybindings(groups []KeybindingGroup)

SetKeybindings sets custom keybinding groups

func (*Help) SetSize

func (h *Help) SetSize(width, height int)

SetSize updates the size of the help component

func (Help) Update

func (h Help) Update(msg tea.Msg) (Help, tea.Cmd)

Update handles messages for the help component

func (Help) View

func (h Help) View() string

View renders the help screen

type HelpStyles

type HelpStyles struct {
	Title       lipgloss.Style
	GroupTitle  lipgloss.Style
	Key         lipgloss.Style
	Description lipgloss.Style
	Border      lipgloss.Style
}

HelpStyles contains styling for the help component

func DefaultHelpStyles

func DefaultHelpStyles() HelpStyles

DefaultHelpStyles returns the default help styles

type Keybinding

type Keybinding struct {
	Keys        []string // Multiple keys that perform the same action (e.g., ["j", "↓"])
	Description string
}

Keybinding represents a keyboard shortcut and its description

type KeybindingGroup

type KeybindingGroup struct {
	Title    string
	Bindings []Keybinding
}

KeybindingGroup represents a group of related keybindings

type ListPicker

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

ListPicker is a component for selecting from a filtered list of items

func NewListPicker

func NewListPicker(title string, items []string, filter string) ListPicker

NewListPicker creates a new list picker with the given items

func (ListPicker) Filter

func (lp ListPicker) Filter() string

Filter returns the current filter text

func (ListPicker) HasItems

func (lp ListPicker) HasItems() bool

HasItems returns true if there are any filtered items to select from

func (ListPicker) SelectedIndex

func (lp ListPicker) SelectedIndex() int

SelectedIndex returns the index of the currently selected item in the filtered list

func (ListPicker) SelectedItem

func (lp ListPicker) SelectedItem() string

SelectedItem returns the currently selected item, or empty string if none

func (ListPicker) Update

func (lp ListPicker) Update(msg tea.Msg) (ListPicker, tea.Cmd)

Update handles key presses for the list picker

func (ListPicker) View

func (lp ListPicker) View() string

View renders the list picker

type MessageType

type MessageType int

MessageType represents the type of status message

const (
	// MessageInfo is an informational message
	MessageInfo MessageType = iota
	// MessageSuccess is a success message
	MessageSuccess
	// MessageError is an error message
	MessageError
	// MessageWarning is a warning message
	MessageWarning
)

type SectionChangedMsg

type SectionChangedMsg struct {
	Section core.Section
}

SectionChangedMsg is sent when the active section changes

type Sections

type Sections struct {
	Items       []core.Section
	ActiveIndex int
	TaskCount   int
	Width       int
	// contains filtered or unexported fields
}

Sections represents the section navigation component

func NewSections

func NewSections(sections []core.Section, width int, styles SectionsStyles) Sections

NewSections creates a new Sections component

func NewSectionsWithIndex

func NewSectionsWithIndex(sections []core.Section, width int, styles SectionsStyles, activeIndex int) Sections

NewSectionsWithIndex creates a new Sections component with a specific active index

func (Sections) GetActiveSection

func (s Sections) GetActiveSection() core.Section

GetActiveSection returns the currently active section

func (Sections) IsProjectsView

func (s Sections) IsProjectsView() bool

IsProjectsView returns true if the active section is the Projects view Note: The exact name "Projects" is required - renaming will disable grouped view

func (Sections) IsTagsView

func (s Sections) IsTagsView() bool

IsTagsView returns true if the active section is the Tags view Note: The exact name "Tags" is required - renaming will disable grouped view

func (*Sections) SetSize

func (s *Sections) SetSize(width int)

SetSize updates the width of the component

func (*Sections) SetTaskCount

func (s *Sections) SetTaskCount(count int)

SetTaskCount sets the task count for display

func (Sections) Update

func (s Sections) Update(msg tea.Msg) (Sections, tea.Cmd)

Update handles messages for the Sections component

func (Sections) View

func (s Sections) View() string

View renders the section navigation tabs

type SectionsStyles

type SectionsStyles struct {
	Active   lipgloss.Style
	Inactive lipgloss.Style
	Count    lipgloss.Style
}

SectionsStyles holds the styles needed for rendering sections

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

Sidebar displays detailed information about a task

func NewSidebar

func NewSidebar(width, height int, styles SidebarStyles) Sidebar

NewSidebar creates a new sidebar component

func (*Sidebar) SetAllTasks

func (s *Sidebar) SetAllTasks(tasks []core.Task)

SetAllTasks updates the list of all tasks for dependency lookups

func (*Sidebar) SetSize

func (s *Sidebar) SetSize(width, height int)

SetSize updates the sidebar dimensions

func (*Sidebar) SetTask

func (s *Sidebar) SetTask(task *core.Task)

SetTask updates the task being displayed

func (Sidebar) Update

func (s Sidebar) Update(msg tea.Msg) (Sidebar, tea.Cmd)

Update handles messages for the sidebar

func (Sidebar) View

func (s Sidebar) View() string

View renders the sidebar

type SidebarStyles

type SidebarStyles struct {
	Border         lipgloss.Style
	Title          lipgloss.Style
	Label          lipgloss.Style
	Value          lipgloss.Style
	Dim            lipgloss.Style
	PriorityHigh   lipgloss.Color
	PriorityMedium lipgloss.Color
	PriorityLow    lipgloss.Color
	DueOverdue     lipgloss.Color
	StatusPending  lipgloss.Color
	StatusActive   lipgloss.Color
	StatusDone     lipgloss.Color
	StatusWaiting  lipgloss.Color
	Tag            lipgloss.Color
}

SidebarStyles holds the styles needed for rendering the sidebar

type StatusBar

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

StatusBar component displays transient status messages

func NewStatusBar

func NewStatusBar(width int, showKeybindings bool, styles StatusBarStyles) StatusBar

NewStatusBar creates a new status bar

func (*StatusBar) ClearMessage

func (s *StatusBar) ClearMessage()

ClearMessage clears the current status message

func (*StatusBar) SetKeybindings

func (s *StatusBar) SetKeybindings(keys string)

SetKeybindings sets the keybindings text to display

func (*StatusBar) SetMessage

func (s *StatusBar) SetMessage(content string, msgType MessageType, duration time.Duration) tea.Cmd

SetMessage sets a new status message with a duration Returns a command that will clear the message after the duration

func (*StatusBar) SetWidth

func (s *StatusBar) SetWidth(width int)

SetWidth updates the width of the status bar

func (StatusBar) Update

func (s StatusBar) Update(msg tea.Msg) (StatusBar, tea.Cmd)

Update handles messages for the status bar

func (StatusBar) View

func (s StatusBar) View() string

View renders the status bar

type StatusBarStyles

type StatusBarStyles struct {
	Normal  lipgloss.Style
	Success lipgloss.Style
	Error   lipgloss.Style
	Warning lipgloss.Style
	Keys    lipgloss.Style
}

StatusBarStyles contains styling for the status bar

func DefaultStatusBarStyles

func DefaultStatusBarStyles() StatusBarStyles

DefaultStatusBarStyles returns the default status bar styles

type StatusMessage

type StatusMessage struct {
	Content  string
	Type     MessageType
	Duration time.Duration
}

StatusMessage represents a transient message to display

type TaskList

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

TaskList is a component for displaying and navigating a list of tasks or groups

func NewTaskList

func NewTaskList(width, height int, columns config.Columns, narrowViewFields config.Columns, styles TaskListStyles) TaskList

NewTaskList creates a new task list component

func (*TaskList) ClearSelection

func (t *TaskList) ClearSelection()

ClearSelection clears all selected tasks

func (TaskList) Cursor

func (t TaskList) Cursor() int

Cursor returns the current cursor position (exported for Model access)

func (TaskList) GetSelectedTasks

func (t TaskList) GetSelectedTasks() []core.Task

GetSelectedTasks returns all currently selected tasks, or the cursor task if none selected

func (TaskList) HasSelections

func (t TaskList) HasSelections() bool

HasSelections returns true if any tasks are selected

func (TaskList) IsSelected

func (t TaskList) IsSelected(uuid string) bool

IsSelected returns true if the given task UUID is selected

func (TaskList) SelectedGroup

func (t TaskList) SelectedGroup() *core.TaskGroup

SelectedGroup returns the currently selected group, or nil if not in group mode

func (TaskList) SelectedIndex

func (t TaskList) SelectedIndex() int

SelectedIndex returns the index of the currently selected task

func (TaskList) SelectedTask

func (t TaskList) SelectedTask() *core.Task

SelectedTask returns the currently selected task, or nil if no tasks

func (*TaskList) SetEmptyMessage

func (t *TaskList) SetEmptyMessage(message string)

SetEmptyMessage sets a custom message to display when the list is empty

func (*TaskList) SetForceSmallScreen

func (t *TaskList) SetForceSmallScreen(force bool)

SetForceSmallScreen forces the task list into small screen rendering mode. This is set by the model when the terminal width is below the threshold or when the user has configured force_small_screen in the config.

func (*TaskList) SetGroups

func (t *TaskList) SetGroups(groups []core.TaskGroup)

SetGroups updates the groups and switches to group display mode

func (*TaskList) SetRelativeDates

func (t *TaskList) SetRelativeDates(enabled bool)

SetRelativeDates enables or disables relative date display in date columns

func (*TaskList) SetScrollBuffer

func (t *TaskList) SetScrollBuffer(buffer int)

SetScrollBuffer sets the number of tasks to keep visible above/below the cursor. A buffer of 1 means the selected task will have at least 1 task visible above and below it (when not at list boundaries). Set to 0 to disable buffering.

func (*TaskList) SetSize

func (t *TaskList) SetSize(width, height int)

SetSize updates the component dimensions

func (*TaskList) SetTasks

func (t *TaskList) SetTasks(tasks []core.Task)

SetTasks updates the task list and switches to task display mode

func (*TaskList) SetTasksWithSort

func (t *TaskList) SetTasksWithSort(tasks []core.Task, sortMethod string, reverse bool)

SetTasksWithSort updates the task list with custom sorting

func (TaskList) TaskCount

func (t TaskList) TaskCount() int

TaskCount returns the total number of tasks

func (*TaskList) ToggleSelection

func (t *TaskList) ToggleSelection()

ToggleSelection toggles the selection state of the current task

func (TaskList) Update

func (t TaskList) Update(msg tea.Msg) (TaskList, tea.Cmd)

Update handles messages for the task list

func (TaskList) View

func (t TaskList) View() string

View renders the task list or group list

type TaskListStyles

type TaskListStyles struct {
	Header          lipgloss.Style
	Separator       lipgloss.Style
	Selection       lipgloss.Style
	PriorityHigh    lipgloss.Color
	PriorityMedium  lipgloss.Color
	PriorityLow     lipgloss.Color
	DueOverdue      lipgloss.Color
	TagColor        lipgloss.Color
	StatusCompleted lipgloss.Color
	StatusWaiting   lipgloss.Color
	StatusActive    lipgloss.Color
}

TaskListStyles holds the styles needed for rendering the task list

type TimePicker

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

TimePicker is a time selection component for HH:MM format

func NewTimePicker

func NewTimePicker() TimePicker

NewTimePicker creates a new time picker with default to current hour, minute 00

func (TimePicker) GetFormattedTime

func (t TimePicker) GetFormattedTime() string

GetFormattedTime returns the time in HH:MM format

func (TimePicker) GetHour

func (t TimePicker) GetHour() int

GetHour returns the selected hour

func (TimePicker) GetMinute

func (t TimePicker) GetMinute() int

GetMinute returns the selected minute

func (TimePicker) Update

func (t TimePicker) Update(msg tea.Msg) (TimePicker, tea.Cmd)

Update handles keyboard input

func (TimePicker) View

func (t TimePicker) View() string

View renders the time picker

Jump to

Keyboard shortcuts

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