Documentation
¶
Index ¶
- Constants
- func App(state *State, window *dom.Window) *dom.Node
- func ConfirmDialog(props ConfirmDialogProps) *dom.Node
- func DetailPage(state *State, id int64) *dom.Node
- func MainInput(state *State, fullEntries []EntryWithDepth) *dom.Node
- func MainPage(state *State, window *dom.Window) *dom.Node
- func Menu(props MenuProps) *dom.Node
- func RenderEntryTree(props RenderEntryTreeProps) []*dom.Node
- func SearchInput(props InputProps) *dom.Node
- func TodoItem(props TodoItemProps) *dom.Node
- type ComputeResult
- type ConfirmDialogProps
- type EntryWithDepth
- type InputProps
- type MenuItem
- type MenuProps
- type RenderEntryTreeProps
- type SelectedEntryMode
- type State
- type TodoItemProps
Constants ¶
View Source
const ( SelectedEntryMode_Default = iota SelectedEntryMode_Editing SelectedEntryMode_ShowActions SelectedEntryMode_DeleteConfirm SelectedEntryMode_AddingChild )
View Source
const (
CtrlCExitDelayMs = 1000
)
Variables ¶
This section is empty.
Functions ¶
func ConfirmDialog ¶
func ConfirmDialog(props ConfirmDialogProps) *dom.Node
ConfirmDialog creates a confirmation dialog with action and cancel buttons
func MainInput ¶ added in v0.0.9
func MainInput(state *State, fullEntries []EntryWithDepth) *dom.Node
func RenderEntryTree ¶ added in v0.0.4
func RenderEntryTree(props RenderEntryTreeProps) []*dom.Node
RenderEntryTree builds and renders the tree of entries as DOM nodes
func SearchInput ¶ added in v0.0.4
func SearchInput(props InputProps) *dom.Node
func TodoItem ¶ added in v0.0.4
func TodoItem(props TodoItemProps) *dom.Node
Types ¶
type ComputeResult ¶ added in v0.0.6
type ComputeResult struct {
EntriesAbove int
EntriesBelow int
VisibleEntries []EntryWithDepth
FullEntries []EntryWithDepth
EffectiveSliceStart int
}
type ConfirmDialogProps ¶
type ConfirmDialogProps struct {
SelectedButton int
PromptText string // e.g., "Delete todo?"
DeleteText string // e.g., "[Delete]" or "[OK]"
CancelText string // e.g., "[Cancel]"
OnDelete func()
OnCancel func()
}
ConfirmDialogProps contains the properties for the confirmation dialog
type EntryWithDepth ¶ added in v0.0.4
type EntryWithDepth struct {
Entry *models.LogEntryView
Depth int
IsLastChild []bool // For each depth level, whether this entry is the last child at that level
}
EntryWithDepth represents a flattened entry with its depth and ancestor information
type InputProps ¶
type RenderEntryTreeProps ¶ added in v0.0.6
type RenderEntryTreeProps struct {
State *State // The application state
Entries []EntryWithDepth
EntriesAbove int
EntriesBelow int
OnGoToFirst func(e *dom.DOMEvent)
OnGoToLast func(e *dom.DOMEvent)
OnGoToTop func(e *dom.DOMEvent)
OnGoToBottom func(e *dom.DOMEvent)
}
RenderEntryTreeProps contains configuration for rendering the entry tree
type SelectedEntryMode ¶ added in v0.0.3
type SelectedEntryMode int
type State ¶
type State struct {
Entries models.LogEntryViews
Input models.InputState
SelectedEntryID int64
SelectFromSearch bool
LastSelectedEntryID int64
SelectedEntryMode SelectedEntryMode
SelectedInputState models.InputState
ChildInputState models.InputState
SelectedDeleteConfirmButton int
// in ZenMode, only show highlighted and
// unfinished entries
ZenMode bool
SelectedActionIndex int
EnteredEntryID int64
ShowHistory bool // Whether to show historical (done) todos from before today
// Search functionality
SearchQuery string // Current search query (without the ? prefix)
IsSearchActive bool // Whether search mode is active
// Pagination
SliceStart int // Starting index for the slice of entries to display
// Cut/Paste functionality
CuttingEntryID int64 // ID of the entry currently being cut (0 if none)
Quit func()
Refresh func()
OnAdd func(string)
OnAddChild func(parentID int64, text string)
OnUpdate func(id int64, text string)
OnDelete func(id int64)
OnToggle func(id int64)
OnPromote func(id int64)
OnUpdateHighlight func(id int64, highlightLevel int)
OnMove func(id int64, newParentID int64)
OnAddNote func(id int64, text string)
OnUpdateNote func(entryID int64, noteID int64, text string)
OnDeleteNote func(entryID int64, noteID int64)
OnRefreshEntries func() // Callback to refresh entries when ShowHistory changes
LastCtrlC time.Time
}
func (*State) ClearSearch ¶ added in v0.0.4
func (state *State) ClearSearch()
func (*State) IsDescendant ¶ added in v0.0.9
IsDescendant checks if potentialChild is a descendant of potentialParent
type TodoItemProps ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.