Day Planner

Overview

Daily planning tool embedded in the standup page. Users create time blocks on a visual grid, link tasks, track completion.

Components

ComponentPurpose
DayPlanner.tsxMain orchestrator. Receives standupId + personId. Manages mutations, suggestions, task panel
DayPlanTimeGrid.tsxVisual time grid with hour lines, drag-to-reposition, task drop zones, current time indicator
DayPlanBlock.tsxIndividual block: title, token icon, duration, status styling. Inline detail panel + toolbar when selected
DayPlanBlockDetail.tsxExpanded detail: project selector, token selector, linked tasks, links, notes, convert-to-task
DayPlanQuickAdd.tsxQuick-add input for creating blocks
DayPlanTaskPanel.tsxSide panel for browsing/linking tasks
DayPlanWeeklyProgress.tsxWeekly hours progress bars per project

Data Model

day_plan_block table

FieldTypeNotes
statusenumPLANNED, ACTIVE, DONE, SKIPPED, CANCELLED, OVERRAN
strictnessenumFLEXIBLE, FIRM, HARD
tokenenumCALL, GOTO, TEXT, PAY, WORK, MEET (nullable)
sourceenumMANUAL, INTEGRATION
start_timetimestampISO format
duration_mintMinutes
actual_start, actual_endtimestampFor tracking
FK-standup, person, project, task
  • day_plan_block_task - M2M table for related tasks
  • DayPlanBlockView - View type includes joined task_detail, project_detail, related_tasks

Block Status Flow

PLANNED → ACTIVE        (Play button, sets actual_start)
PLANNED → DONE          (Check button, via completeBlockWithActivity)
PLANNED → CANCELLED     (Ban button)
CANCELLED → PLANNED     (Undo2/Restore, clears actual_start/actual_end)
DONE → PLANNED          (Undo2/Restore, clears actual_start/actual_end)

Block Controls (toolbar, shows when selected)

StatusAvailable actions
PLANNED/ACTIVE+/- duration, Link task, Play, Check, Cancel, Delete
CANCELLED/DONE+/- duration, Link task, Restore (Undo2), Delete

Hooks (useDayPlan.ts)

HookPurpose
useDayPlanBlocks(standupId)Fetch all blocks for a standup
useCreateDayPlanBlock()Create + log task_activity
useUpdateDayPlanBlock()Generic update (maps fields manually)
useDeleteDayPlanBlock()Delete
useAddBlockRelatedTask()Add M2M task link
useRemoveBlockRelatedTask()Remove M2M task link
useCompleteBlockWithActivity()Mark DONE + set actual_end + log task_activity with timing

Standup Integration

  • Standup page shows today only: new Date().toISOString().slice(0, 10)
  • Auto-creates standup via useEnsureStandup if none exists for today
  • DayPlanner is one section alongside entries, morning intake, lunch checkin, evening reflection

Layout Constants (day-plan-layout.ts)

HOUR_HEIGHT, LABEL_WIDTH, START_HOUR, END_HOUR, parseStartTime(), snapMinutes(), clampMinutes(), computeColumns() (for overlapping blocks)