Day Planner
Overview
Daily planning tool embedded in the standup page. Users create time blocks on a visual grid, link tasks, track completion.
Components
| Component | Purpose |
|---|
DayPlanner.tsx | Main orchestrator. Receives standupId + personId. Manages mutations, suggestions, task panel |
DayPlanTimeGrid.tsx | Visual time grid with hour lines, drag-to-reposition, task drop zones, current time indicator |
DayPlanBlock.tsx | Individual block: title, token icon, duration, status styling. Inline detail panel + toolbar when selected |
DayPlanBlockDetail.tsx | Expanded detail: project selector, token selector, linked tasks, links, notes, convert-to-task |
DayPlanQuickAdd.tsx | Quick-add input for creating blocks |
DayPlanTaskPanel.tsx | Side panel for browsing/linking tasks |
DayPlanWeeklyProgress.tsx | Weekly hours progress bars per project |
Data Model
day_plan_block table
| Field | Type | Notes |
|---|
| status | enum | PLANNED, ACTIVE, DONE, SKIPPED, CANCELLED, OVERRAN |
| strictness | enum | FLEXIBLE, FIRM, HARD |
| token | enum | CALL, GOTO, TEXT, PAY, WORK, MEET (nullable) |
| source | enum | MANUAL, INTEGRATION |
| start_time | timestamp | ISO format |
| duration_m | int | Minutes |
| actual_start, actual_end | timestamp | For 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)
| Status | Available actions |
|---|
| PLANNED/ACTIVE | +/- duration, Link task, Play, Check, Cancel, Delete |
| CANCELLED/DONE | +/- duration, Link task, Restore (Undo2), Delete |
Hooks (useDayPlan.ts)
| Hook | Purpose |
|---|
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)