Skip to content

Today

What it does

The Today screen (/today) is the main daily planner. It has three modes, switchable via the view tabs (or the Shift+C shortcut, which cycles Planner -> Calendar -> Markdown): a Planner list view, a Calendar time-grid view, and a Markdown freeform text view of the same day's tasks. All three modes read and write the exact same tasks table — there is one source of truth, just three lenses on it.

Alongside the main panel, a Backlog sidebar lists tasks that are overdue or have no date, so you can drag them onto today.

Files tied to it

FilePurpose
src/features/today/components/TodayPage.tsxOrchestrator — picks which of Planner / Calendar / Markdown to render based on uiStore.todayView, and shows/hides the backlog sidebar
src/features/today/components/PlannerView.tsxThe list-based planner (scheduled + unscheduled sections)
src/features/today/components/TaskCard.tsxA single task row/card — checkbox, title, time, priority indicator
src/features/today/components/TaskSection.tsxGroups tasks into labeled sections (e.g. "Morning", "Unscheduled")
src/features/today/components/TaskDetailSheet.tsxBottom sheet / dialog for viewing & editing one task's full detail (notes, subtasks, project, priority)
src/features/today/components/BacklogSidebar.tsxSidebar listing overdue/undated tasks, draggable onto the day
src/features/today/components/ContextMenu.tsxRight-click / long-press menu for task actions
src/features/today/components/PlanningRitual.tsxGuided "plan your day" flow
src/features/today/components/QuickAddInput.tsxInline quick-add field embedded in the planner
src/features/today/components/TimeBlock.tsx / UnscheduledBlock.tsxRendering helpers used by the planner for scheduled vs. unscheduled tasks
src/features/today/components/MarkdownView.tsxRenders the day's tasks as an editable markdown document
src/features/today/components/MarkdownEditor.tsxCodeMirror-based editor instance backing Markdown mode
src/features/today/components/MarkdownLeaveGuard.tsxMounted globally in App.tsx; intercepts navigation away from Markdown mode while there are unsaved edits
src/features/today/components/ModeHelp.tsxInline help/legend for markdown syntax
src/features/today/components/editorKeybindings.tsCodeMirror keybinding config for the markdown editor
src/features/today/components/hideIdMarkers.tsHides internal task-ID markers embedded in the markdown text so you only see human-readable content

Calendar mode itself lives in src/features/calendar/ (see Calendar) — TodayPage just mounts <UnifiedCalendar mode="today" />.

Key concepts / how it connects

  • One data source, three views. Planner, Calendar, and Markdown all call the same repository functions from src/db/repositories/taskRepository.ts (e.g. useTodayTasks()). Editing a task's time in Calendar mode and then switching to Markdown mode shows the change instantly — there's no separate "markdown state" to sync.
  • Markdown mode is a serialization, not a separate model. src/lib/taskMarkdown.ts and src/lib/markdownSave.ts convert between the Task[] array and a markdown text blob (and back on save). Task IDs are embedded as hidden markers (stripped from view by hideIdMarkers.ts) so edits can be matched back to the right database row.
  • Leaving Markdown mode with unsaved changes is guarded: uiStore tracks a markdownDirty flag; MarkdownLeaveGuard (mounted globally) intercepts route/view changes and prompts before discarding edits.
  • Backlog membership is date-based, not status-based. getBacklogTasks() in taskRepository.ts returns tasks that are either undated or have a date before today and aren't done — there's no separate "backlog" flag on a task.

Where to start editing

  • Changing what a task card shows -> TaskCard.tsx.
  • Changing planner layout/sections -> PlannerView.tsx + TaskSection.tsx.
  • Changing markdown syntax/behavior -> MarkdownEditor.tsx, taskMarkdown.ts, markdownSave.ts.
  • Adding a new task action (e.g. a context-menu item) -> ContextMenu.tsx.