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 []TreeEntry) error
- func HappeningListPage(state *State) *dom.Node
- func MainInput(state *State, fullEntries []TreeEntry) *dom.Node
- func MainPage(state *State, window *dom.Window) *dom.Node
- func Menu(props MenuProps) *dom.Node
- func RenderRoute(state *State, route Route) *dom.Node
- func SearchInput(props InputProps) *dom.Node
- func TodoItem(props TodoItemProps) *dom.Node
- func TodoNote(props TodoNoteProps) *dom.Node
- func Tree(props TreeProps) []*dom.Node
- type ChildNotesSection
- type ComputeResult
- type ConfigPageState
- type ConfigPhase
- type ConfirmDialogProps
- type DetailPageState
- type ExportData
- type ExportEntry
- type ExportNote
- type HappeningListPageState
- type HappeningState
- type IDs
- type InputProps
- type MainPageState
- type MenuItem
- type MenuProps
- 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)
- func (state *State) SelectNote(noteID int64, entryID int64)
- type StatusBar
- type StorageType
- type TodoItemProps
- type TodoNoteProps
- type TreeEntry
- type TreeEntryType
- type TreeFocusedItem
- type TreeLog
- type TreeNote
- type TreeProps
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 )
const HEADER_HEIGHT = 1
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
ExportVisibleEntries exports the currently visible entries to a JSON file
func HappeningListPage ¶ added in v0.0.15
HappeningListPage renders the happening list page
func SearchInput ¶ added in v0.0.4
func SearchInput(props InputProps) *dom.Node
SearchInput wraps the component.SearchInput with app-specific defaults
func TodoItem ¶ added in v0.0.4
func TodoItem(props TodoItemProps) *dom.Node
func TodoNote ¶ added in v0.0.14
func TodoNote(props TodoNoteProps) *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 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 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 HappeningListPageState ¶ added in v0.0.15
type HappeningListPageState struct {
}
type HappeningState ¶ added in v0.0.15
type HappeningState struct {
Loading bool
Happenings []*models.Happening
Error string
Input models.InputState
FocusedItemID int64
// Edit/Delete state
EditingItemID int64
EditInputState models.InputState
DeletingItemID int64
DeleteConfirmButton int // 0 = Delete, 1 = Cancel
LoadHappenings func(ctx context.Context) ([]*models.Happening, error)
AddHappening func(ctx context.Context, content string) (*models.Happening, error)
UpdateHappening func(ctx context.Context, id int64, update *models.HappeningOptional) (*models.Happening, error)
DeleteHappening func(ctx context.Context, id int64) error
}
type InputProps ¶
type InputProps = component.InputProps
InputProps is an alias for component.InputProps for backward compatibility
type MainPageState ¶ added in v0.0.10
type MainPageState struct {
Entries []TreeEntry
}
type Route ¶ added in v0.0.10
type Route struct {
Type RouteType
MainPage *MainPageState
DetailPage *DetailPageState
ConfigPage *ConfigPageState
HappeningListPage *HappeningListPageState
}
func ConfigRoute ¶ added in v0.0.10
func ConfigRoute(state ConfigPageState) Route
func DetailRoute ¶ added in v0.0.10
func HappeningListRoute ¶ added in v0.0.15
func HappeningListRoute() Route
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
SelectedNoteID int64 // ID of the selected note (0 if none)
SelectedNoteEntryID int64 // ID of the entry that owns the selected note
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
// Happening functionality
Happening HappeningState
ShowHistory bool // Whether to show historical (done) todos from before today
ShowNotes bool // Whether to show all notes globally
// 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)
// Focused mode functionality
FocusedEntryID int64 // ID of the entry currently focused on (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
OnToggleNotesDisplay func(id int64) error // Callback to toggle notes display for entry and its subtree
OnToggleCollapsed func(id int64) error // Callback to toggle collapsed state for entry
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
func (*State) SelectNote ¶ added in v0.0.14
type StorageType ¶ added in v0.0.10
type StorageType int
const ( StorageType_LocalFile StorageType = iota StorageType_LocalSqlite StorageType_Server )
type TodoItemProps ¶ added in v0.0.4
type TodoItemProps struct {
Item *models.LogEntryView
Prefix string
IsLast bool
IsSelected bool
State *State
OnEnter func(e *dom.DOMEvent, entryID int64)
// gg
OnGoToFirst func(e *dom.DOMEvent)
// G
OnGoToLast func(e *dom.DOMEvent)
// gt -> top
OnGoToTop func(e *dom.DOMEvent)
// gb -> bottom
OnGoToBottom func(e *dom.DOMEvent)
}
type TodoNoteProps ¶ added in v0.0.14
type TreeEntry ¶ added in v0.0.14
type TreeEntry struct {
Type TreeEntryType
Prefix string
IsLast bool
Log *TreeLog
Note *TreeNote
FocusedItem *TreeFocusedItem
}
TreeEntry wraps either a log entry or a note for unified tree rendering
type TreeEntryType ¶ added in v0.0.14
type TreeEntryType string
TreeEntryType represents the type of entry in a TreeEntry
const ( TreeEntryType_Log TreeEntryType = "Log" TreeEntryType_Note TreeEntryType = "Note" TreeEntryType_FocusedItem TreeEntryType = "FocusedItem" )
type TreeFocusedItem ¶ added in v0.0.15
type TreeFocusedItem struct {
RootPath []string
}
TreeFocusedItem represents the focused root path
type TreeLog ¶ added in v0.0.14
type TreeLog struct {
Entry *models.LogEntryView
}
TreeLog represents a flattened log entry
type TreeProps ¶ added in v0.0.14
type TreeProps struct {
State *State // The application state
Entries []TreeEntry
EntriesAbove int
EntriesBelow int
OnEnter func(e *dom.DOMEvent, entryType TreeEntryType, entryID int64)
OnGoToFirst func(e *dom.DOMEvent)
OnGoToLast func(e *dom.DOMEvent)
OnGoToTop func(e *dom.DOMEvent)
OnGoToBottom func(e *dom.DOMEvent)
}
TreeProps contains configuration for rendering the entry tree