Documentation
¶
Overview ¶
Package task defines the Task type and related styles, key bindings, and messages used to represent and render tasks in the list view.
Index ¶
- type DeleteMsg
- type EnterEditMsg
- type Styles
- type Task
- type TaskDelegate
- func (t TaskDelegate) FullHelp() [][]key.Binding
- func (t TaskDelegate) Height() int
- func (t TaskDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)
- func (t TaskDelegate) ShortHelp() []key.Binding
- func (t TaskDelegate) Spacing() int
- func (t TaskDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd
- type TaskKeyMap
- type ToggleDoneMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteMsg ¶
type DeleteMsg struct{}
DeleteMsg signals that the user requested deletion of the currently selected task.
type EnterEditMsg ¶
type EnterEditMsg struct{}
EnterEditMsg signals that the user wants to edit the currently selected task in the list.
type Styles ¶
type Styles struct {
// The Normal state.
Normal subStyle
// The selected item state.
Selected subStyle
// The dimmed state, for when the filter input is initially activated.
Dimmed subStyle
// Characters matching the current filter, if any.
FilterMatch lipgloss.Style
// StatusMessage styles status text shown for task operations.
StatusMessage lipgloss.Style
}
Styles contains all styles used to render tasks in the list, including normal, selected, dimmed, and filter match highlighting.
type Task ¶
type Task struct {
ID uuid.UUID `json:"ID"`
TitleStr string `json:"TitleStr"`
DescStr string `json:"DescStr"`
DueDate time.Time `json:"DueDate"`
Done bool `json:"Done"`
}
Task represents a single task, including ID, title, description, due date, and completion status.
func NewWithOptions ¶
NewWithOptions constructs a Task with the provided values and a generated ID.
func (Task) Description ¶
Description returns the task description.
func (Task) FilterValue ¶
FilterValue implements list.Item and is used by the list filter.
type TaskDelegate ¶
type TaskDelegate struct {
Styles Styles
// contains filtered or unexported fields
}
TaskDelegate implements list.ItemDelegate for Task items, handling rendering and key bindings for actions on tasks in the list.
func NewTaskDelegate ¶
func NewTaskDelegate() TaskDelegate
NewTaskDelegate constructs a TaskDelegate with default styles and keymap.
func (TaskDelegate) FullHelp ¶
func (t TaskDelegate) FullHelp() [][]key.Binding
FullHelp implements the help.KeyMap interface for the full help view of task-related key bindings.
func (TaskDelegate) Height ¶
func (t TaskDelegate) Height() int
Height returns the number of lines used to render each task.
func (TaskDelegate) Render ¶
Render draws a Task into the list, applying styles for selection, filtering, and completion state.
func (TaskDelegate) ShortHelp ¶
func (t TaskDelegate) ShortHelp() []key.Binding
ShortHelp implements the help.KeyMap interface for condensed help for task-related key bindings.
func (TaskDelegate) Spacing ¶
func (t TaskDelegate) Spacing() int
Spacing returns the number of blank lines between rendered tasks.
type TaskKeyMap ¶
TaskKeyMap defines key bindings for actions on a single task in the list, such as editing, toggling completion, and removing.
func (TaskKeyMap) FullHelp ¶
func (t TaskKeyMap) FullHelp() [][]key.Binding
FullHelp implements the help.KeyMap interface for the full help view for task-related key bindings.
func (TaskKeyMap) ShortHelp ¶
func (t TaskKeyMap) ShortHelp() []key.Binding
ShortHelp implements the help.KeyMap interface for condensed help.
type ToggleDoneMsg ¶
type ToggleDoneMsg struct{}
ToggleDoneMsg signals that the user toggled the completion state of the currently selected task.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package editmenu provides a Bubble Tea sub-model for creating and editing tasks, including a form, validation, and contextual help.
|
Package editmenu provides a Bubble Tea sub-model for creating and editing tasks, including a form, validation, and contextual help. |