Documentation
¶
Index ¶
- Constants
- func App(state *State, window *dom.Window) *dom.Node
- func AppStatusBar(state *State) *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 HelpPage(state *State, window *dom.Window) *dom.Node
- func HumanStatePage(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, window *dom.Window) *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 EntryOptions
- type ExportData
- type ExportEntry
- type ExportNote
- type HappeningListPageState
- type HappeningState
- type HelpPageState
- type HumanStatePageState
- type IDs
- type InputProps
- type MainPageState
- type MenuItem
- type MenuProps
- type MutexMap
- 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) FindEntryByID(entryID int64) *models.LogEntryView
- func (state *State) IsDescendantOf(potentialChild models.EntryIdentity, potentialParent models.EntryIdentity) bool
- func (state *State) PopFromNavigationStack() (models.EntryIdentity, bool)
- func (state *State) PushToNavigationStack(entry models.EntryIdentity)
- func (state *State) Requesting() bool
- func (state *State) ResetAllChildrenVisibility()
- func (state *State) Select(entyType models.LogEntryViewType, id int64)
- func (state *State) SelectNote(noteID int64, entryID int64)
- type StatusBar
- type StorageType
- type TodoItemProps
- type TodoNoteProps
- type TreeEntry
- type TreeFocusedItem
- type TreeGroup
- type TreeLog
- type TreeNote
- type TreeProps
- type ViewMode
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 ( GROUP_DEADLINE_ID = 1 GROUP_WORKPERF_ID = 2 GROUP_LIFEENHANCE_ID = 3 GROUP_WORKHACK_ID = 4 GROUP_LIFEHACK_ID = 5 GROUP_OTHER_ID = 6 )
Group IDs for organizing entries in group mode
const HEADER_HEIGHT = 1
Variables ¶
This section is empty.
Functions ¶
func AppStatusBar ¶ added in v0.0.17
AppState renders the application status bar
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 HumanStatePage ¶ added in v0.0.16
HumanStatePage renders the human state page
func RenderRoute ¶ added in v0.0.10
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 EntryOptions ¶ added in v0.0.16
type EntryOptions struct {
MaxEntries int
SliceStart int
SelectedID models.EntryIdentity
SelectedSource SelectedSource
ZenMode bool
SearchActive bool
Search string
ShowNotes bool
FocusingEntryID models.EntryIdentity
ExpandAll bool
ViewMode ViewMode
GroupCollapseState map[int64]bool
}
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
SubmitState submit.SubmitState // Submission state management
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 HelpPageState ¶ added in v0.0.17
type HelpPageState struct {
ScrollOffset int // Current scroll position (line offset from top)
}
type HumanStatePageState ¶ added in v0.0.16
type HumanStatePageState struct {
}
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 MutexMap ¶ added in v0.0.17
type MutexMap struct {
// contains filtered or unexported fields
}
MutexMap provides thread-safe access to a map[int64]bool
func NewMutexMap ¶ added in v0.0.17
func NewMutexMap() *MutexMap
NewMutexMap creates a new thread-safe map
type Route ¶ added in v0.0.10
type Route struct {
Type RouteType
MainPage *MainPageState
DetailPage *DetailPageState
ConfigPage *ConfigPageState
HappeningListPage *HappeningListPageState
HumanStatePage *HumanStatePageState
HelpPage *HelpPageState
}
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
func HumanStateRoute ¶ added in v0.0.16
func HumanStateRoute() 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
SubmitState submit.SubmitState // Submission state management
SelectedEntry models.EntryIdentity
LastSelectedEntry models.EntryIdentity
SelectedNoteID int64 // ID of the selected note (0 if none)
SelectedNoteEntryID int64 // ID of the entry that owns the selected note
SelectFromSource SelectedSource
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
// Human state functionality
HumanState *human_state.HumanState
ShowHistory bool // Whether to show historical (done) todos from before today
ShowNotes bool // Whether to show all notes globally
ExpandAll bool // Whether to expand all entries, ignoring individual collapse flags
// 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
CuttingEntry models.EntryIdentity // ID of the entry currently being cut (0 if none)
// Focused mode functionality
FocusedEntry models.EntryIdentity // ID of the entry currently focused on (0 if none)
// View mode functionality
ViewMode ViewMode // Current view mode (default or group)
// Group collapse state (for group mode entries that don't exist in DB)
GroupCollapseState *MutexMap // Thread-safe map for group collapse states
NavigationStack []models.EntryIdentity // Stack to track navigation history
Quit func()
Refresh func()
OnAdd func(ctx context.Context, viewType models.LogEntryViewType, text string) error
OnAddChild func(viewType models.LogEntryViewType, parentID int64, text string) (int64, error)
OnUpdate func(viewType models.LogEntryViewType, id int64, text string) error
OnDelete func(viewType models.LogEntryViewType, id int64) error
OnRemoveFromGroup func(viewType models.LogEntryViewType, id int64) error
OnToggle func(viewType models.LogEntryViewType, id int64) error
OnPromote func(viewType models.LogEntryViewType, id int64) error
OnUpdateHighlight func(viewType models.LogEntryViewType, id int64, highlightLevel int)
OnMove func(id models.EntryIdentity, newParentID models.EntryIdentity) 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(entryType models.LogEntryViewType, 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) FindEntryByID ¶ added in v0.0.21
func (state *State) FindEntryByID(entryID int64) *models.LogEntryView
FindEntryByID finds an entry by its ID in the entries tree
func (*State) IsDescendantOf ¶ added in v0.0.17
func (state *State) IsDescendantOf(potentialChild models.EntryIdentity, potentialParent models.EntryIdentity) bool
IsDescendant checks if potentialChild is a descendant of potentialParent cannot paste a parent into its child
func (*State) PopFromNavigationStack ¶ added in v0.0.21
func (state *State) PopFromNavigationStack() (models.EntryIdentity, bool)
PopFromNavigationStack pops and returns the last entry from the navigation stack
func (*State) PushToNavigationStack ¶ added in v0.0.21
func (state *State) PushToNavigationStack(entry models.EntryIdentity)
PushToNavigationStack pushes the current selected entry to the navigation stack
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) Select ¶ added in v0.0.9
func (state *State) Select(entyType models.LogEntryViewType, id int64)
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 models.LogEntryViewType
Prefix string
IsLast bool
// for all
Entry *models.LogEntryView
Log *TreeLog
Note *TreeNote
FocusedItem *TreeFocusedItem
Group *TreeGroup
}
TreeEntry wraps either a log entry or a note for unified tree rendering
type TreeFocusedItem ¶ added in v0.0.15
type TreeFocusedItem struct {
RootPath []string
}
TreeFocusedItem represents the focused root path
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 models.LogEntryViewType, 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