Documentation
¶
Index ¶
- Constants
- func App(state *State, window *dom.Window) *dom.Node
- func ConfigPage(state *State) *dom.Node
- func ConfirmDialog(props ConfirmDialogProps) *dom.Node
- func DetailPage(state *State, id int64) *dom.Node
- func ExportVisibleEntries(filename string, visibleEntries []EntryWithDepth) error
- 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 RenderRoute(state *State, route Route) *dom.Node
- func SearchInput(props InputProps) *dom.Node
- func TodoItem(props TodoItemProps) *dom.Node
- type ChildNotesSection
- type ComputeResult
- type ConfigPageState
- type ConfigPhase
- type ConfirmDialogProps
- type DetailPageState
- type EntryWithDepth
- type ExportData
- type ExportEntry
- type ExportNote
- type IDs
- type InputProps
- type MainPageState
- type MenuItem
- type MenuProps
- type RenderEntryTreeProps
- type Route
- type RouteType
- type Routes
- type SelectedEntryMode
- type SelectedSource
- type State
- func (state *State) ClearSearch()
- func (state *State) Deselect()
- func (state *State) Enqueue(action func(ctx context.Context) error)
- func (state *State) IsDescendant(potentialChild int64, potentialParent int64) bool
- func (state *State) Requesting() bool
- func (state *State) ResetAllChildrenVisibility()
- func (state *State) Select(id int64)
- type StatusBar
- type StorageType
- type TodoItemProps
Constants ¶
const ( CtrlCExitDelayMs = 1000 UIWidth = 50 // Shared width for status bar and input components )
const ( SelectedEntryMode_Default = iota SelectedEntryMode_Editing SelectedEntryMode_ShowActions SelectedEntryMode_DeleteConfirm SelectedEntryMode_AddingChild )
Variables ¶
This section is empty.
Functions ¶
func ConfigPage ¶ added in v0.0.10
func ConfirmDialog ¶
func ConfirmDialog(props ConfirmDialogProps) *dom.Node
ConfirmDialog creates a confirmation dialog with action and cancel buttons
func ExportVisibleEntries ¶ added in v0.0.10
func ExportVisibleEntries(filename string, visibleEntries []EntryWithDepth) error
ExportVisibleEntries exports the currently visible entries to a JSON file
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 ChildNotesSection ¶ added in v0.0.10
type ChildNotesSection struct {
Entry *models.LogEntryView
Path string
Notes []*models.NoteView
}
type ComputeResult ¶ added in v0.0.6
type ComputeResult struct {
EntriesAbove int
EntriesBelow int
VisibleEntries []EntryWithDepth
FullEntries []EntryWithDepth
EffectiveSliceStart int
}
type ConfigPageState ¶ added in v0.0.10
type ConfigPageState struct {
ConfigPhase ConfigPhase
SelectedStorageType StorageType
PickingStorageType StorageType
ServerAddr models.InputState
ServerAuthToken models.InputState
ConfirmButtonFocused bool
CancelButtonFocused bool
}
type ConfigPhase ¶ added in v0.0.10
type ConfigPhase int
const ( ConfigPhase_PickingStorageType ConfigPhase = iota ConfigPhase_PickingStorageDetail )
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 DetailPageState ¶ added in v0.0.10
type DetailPageState struct {
EntryID int64
}
type EntryWithDepth ¶ added in v0.0.4
type EntryWithDepth struct {
Entry *models.LogEntryView
Prefix string
IsLast bool
}
EntryWithDepth represents a flattened entry with its prefix and position information
type ExportData ¶ added in v0.0.10
type ExportData struct {
Entries []ExportEntry `json:"entries"`
}
ExportData represents the structure for exporting entries
type ExportEntry ¶ added in v0.0.10
type ExportEntry struct {
Data *models.LogEntry `json:"data"`
Notes []ExportNote `json:"notes"`
}
ExportEntry represents a single entry with its notes for export
type ExportNote ¶ added in v0.0.10
ExportNote represents a single note for export
type InputProps ¶
type MainPageState ¶ added in v0.0.10
type MainPageState struct {
Entries []EntryWithDepth
}
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 Route ¶ added in v0.0.10
type Route struct {
Type RouteType
MainPage *MainPageState
DetailPage *DetailPageState
ConfigPage *ConfigPageState
}
func ConfigRoute ¶ added in v0.0.10
func ConfigRoute(state ConfigPageState) Route
func DetailRoute ¶ added in v0.0.10
type SelectedEntryMode ¶ added in v0.0.3
type SelectedEntryMode int
type SelectedSource ¶ added in v0.0.10
type SelectedSource int
const ( SelectedSource_Default SelectedSource = iota SelectedSource_Search )
type State ¶
type State struct {
Entries models.LogEntryViews
Input models.InputState
SelectedEntryID int64
SelectFromSource SelectedSource
LastSelectedEntryID int64
SelectedEntryMode SelectedEntryMode
SelectedInputState models.InputState
ChildInputState models.InputState
SelectedDeleteConfirmButton int
// in ZenMode, only show highlighted and
// unfinished entries
ZenMode bool
SelectedActionIndex int
Routes Routes
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) error
OnAddChild func(parentID int64, text string) (int64, error)
OnUpdate func(id int64, text string) error
OnDelete func(id int64) error
OnToggle func(id int64) error
OnPromote func(id int64) error
OnUpdateHighlight func(id int64, highlightLevel int)
OnMove func(id int64, newParentID int64) error
OnAddNote func(id int64, text string) error
OnUpdateNote func(entryID int64, noteID int64, text string)
OnDeleteNote func(entryID int64, noteID int64)
RefreshEntries func(ctx context.Context) error // Callback to refresh entries when ShowHistory changes
OnShowTop func(id int64, text string, duration time.Duration) // Callback to show todo in macOS floating bar
OnToggleVisibility func(id int64) error // Callback to toggle visibility of all children including history
LastCtrlC time.Time
StatusBar StatusBar
// contains filtered or unexported fields
}
func (*State) ClearSearch ¶ added in v0.0.4
func (state *State) ClearSearch()
func (*State) Enqueue ¶ added in v0.0.11
Enqueue schedules an action to run in a goroutine and tracks its status
func (*State) IsDescendant ¶ added in v0.0.9
IsDescendant checks if potentialChild is a descendant of potentialParent
func (*State) Requesting ¶ added in v0.0.11
Requesting returns true if there are ongoing actions
func (*State) ResetAllChildrenVisibility ¶ added in v0.0.12
func (state *State) ResetAllChildrenVisibility()
ResetAllChildrenVisibility resets all IncludeHistory states to false This is used when /history is toggled off to reset all 'v' command states
type StorageType ¶ added in v0.0.10
type StorageType int
const ( StorageType_LocalFile StorageType = iota StorageType_LocalSqlite StorageType_Server )