docs(11-01): complete planning agenda plan

This commit is contained in:
Arthur Belleville 2026-05-16 07:28:12 +02:00
parent 2989c0b917
commit 404b545a5d
No known key found for this signature in database
4 changed files with 134 additions and 12 deletions

View file

@ -44,10 +44,10 @@ Requirements for milestone v2.0. Each requirement must map to exactly one roadma
### Planning
- [ ] **PLAN-01**: Each authenticated user can open an individual planning page
- [ ] **PLAN-02**: Planning page lists the user's scheduled events across tablos in chronological order
- [ ] **PLAN-03**: Planning page links each event back to its tablo context
- [ ] **PLAN-04**: Planning page supports a functional empty state and date navigation/filtering suitable for the first working version
- [x] **PLAN-01**: Each authenticated user can open an individual planning page
- [x] **PLAN-02**: Planning page lists the user's scheduled events across tablos in chronological order
- [x] **PLAN-03**: Planning page links each event back to its tablo context
- [x] **PLAN-04**: Planning page supports a functional empty state and date navigation/filtering suitable for the first working version
## Future Requirements

View file

@ -15,7 +15,7 @@
| 8 | Social Sign-in | Google sign-in creates/links local users and issues existing Xtablo sessions; Apple sign-in is disabled | AUTH-08..13 |
| 9 | Etapes | Tasks can be grouped under one-level etapes without breaking the kanban model | ETAPE-01..06 |
| 10 | 4/4 | Complete | 2026-05-16 |
| 11 | Individual Planning | Users can view their own event agenda across tablos | PLAN-01..04 |
| 11 | 1/2 | In Progress| |
| 12 | Native Tablo Chat | Each tablo has persisted discussion with real-time delivery and no managed chat provider | CHAT-01..06 |
---

View file

@ -3,14 +3,14 @@ gsd_state_version: 1.0
milestone: v2.0
milestone_name: Collaboration, planning, and social sign-in
status: executing
last_updated: "2026-05-16T05:22:55.432Z"
last_activity: 2026-05-16 -- Phase 11 execution started
last_updated: "2026-05-16T05:28:12.300Z"
last_activity: 2026-05-16
progress:
total_phases: 5
completed_phases: 3
total_plans: 15
completed_plans: 13
percent: 87
completed_plans: 14
percent: 93
---
# STATE
@ -29,9 +29,9 @@ See: `.planning/PROJECT.md` (updated 2026-05-15)
## Current Position
Phase: 11 (Individual Planning) — EXECUTING
Plan: 1 of 2
Status: Executing Phase 11
Last activity: 2026-05-16 -- Phase 11 execution started
Plan: 2 of 2
Status: Ready to execute
Last activity: 2026-05-16
Resume file: .planning/phases/11-individual-planning/11-01-PLAN.md
## Phase Status
@ -119,6 +119,7 @@ Resume file: .planning/phases/11-individual-planning/11-01-PLAN.md
| Phase 08 P03 | 30min | 2 tasks | 7 files |
| Phase 08 P04 | 20min | 2 tasks | 8 files |
| Phase 08 P05 | 20min | 2 tasks | 7 files |
| Phase 11 P01 | ~15min | 2 tasks | 15 files |
## Notes

View file

@ -0,0 +1,121 @@
---
phase: 11-individual-planning
plan: 01
subsystem: planning
tags: [planning, events, postgres, sqlc, htmx, templ]
requires:
- phase: 10-events
provides: ListUserEventsRange and tablo Events deep-link target
provides:
- Protected /planning route
- 14-day personal agenda window with previous/today/next navigation
- Owned-only event aggregation across tablos
- Event source links back to tablo Events tab
affects: [planning, events, router, templates]
tech-stack:
added: []
patterns:
- "Planning page handlers use injected Now for deterministic local-date tests."
- "Planning event rows use ListUserEventsRange and link back to /tablos/{id}/events?month=YYYY-MM."
key-files:
created:
- backend/internal/web/handlers_planning.go
- backend/internal/web/handlers_planning_test.go
- backend/templates/planning.templ
- backend/templates/planning_forms.go
modified:
- backend/internal/web/router.go
- backend/cmd/web/main.go
key-decisions:
- "Use a dedicated PlanningDeps with optional Now injection so date-window behavior is deterministic in tests."
- "Keep /planning as a normal protected full page inside Layout instead of an HTMX-only fragment."
- "Use Phase 10 ListUserEventsRange unchanged so cross-tablo aggregation stays filtered by tablos.user_id."
patterns-established:
- "Personal planning navigation uses start=YYYY-MM-DD for shareable 14-day windows."
- "Planning agenda rows show compact event metadata and source tablo links without exposing event descriptions."
requirements-completed: [PLAN-01, PLAN-02, PLAN-03, PLAN-04]
duration: ~15min
completed: 2026-05-16
---
# Phase 11: Individual Planning Plan 01 Summary
**Protected Go/HTMX planning agenda with owned cross-tablo event aggregation and 14-day navigation**
## Performance
- **Duration:** ~15 min
- **Started:** 2026-05-16T05:22:55Z
- **Completed:** 2026-05-16T05:38:00Z
- **Tasks:** 2
- **Files modified:** 15
## Accomplishments
- Added RED DB-backed planning tests for auth, default 14-day range, ordering, ownership, navigation links, empty state, invalid date fallback, and source tablo links.
- Added `PlanningPageHandler` and `PlanningDeps` with authenticated-user aggregation through `ListUserEventsRange`.
- Added server-rendered planning templates for the restrained agenda UI required by `11-UI-SPEC.md`.
- Wired `/planning` into the protected router group and updated all router call sites.
## Task Commits
Each task was committed atomically:
1. **Task 1: Add RED coverage for protected planning agenda behavior** - `c5c3bbe` (test)
2. **Task 2: Implement the protected planning route, handler, view models, and agenda template** - `2989c0b` (feat)
## Files Created/Modified
- `backend/internal/web/handlers_planning_test.go` - Adds DB-backed planning route and agenda tests.
- `backend/internal/web/handlers_planning.go` - Adds `/planning` handler, date parsing, and owned aggregation query.
- `backend/templates/planning.templ` - Adds the server-rendered planning agenda page.
- `backend/templates/planning_forms.go` - Adds planning agenda view models and URL/date helpers.
- `backend/internal/web/router.go` - Mounts `/planning` in the protected route group and accepts planning deps.
- `backend/cmd/web/main.go` - Wires `PlanningDeps` into the production router.
- Existing web test helpers - Updated `NewRouter` call sites for the new dependency parameter.
## Decisions Made
- `Today` links to `/planning`, while previous/next windows use `start=YYYY-MM-DD`.
- The event link month is derived from each event's `event_date`, not from the current planning window.
- Invalid `start` query values fall back to today's local date instead of returning an error.
## Deviations from Plan
None - plan executed exactly as written.
## Issues Encountered
None.
## User Setup Required
None - no external service configuration required.
## Verification
- `cd backend && go test ./internal/web -run 'TestPlanning' -count=1` failed in RED before implementation because `PlanningDeps` and router wiring did not exist.
- `cd backend && just generate && go test ./internal/web -run 'TestPlanning' -count=1` passed after implementation.
- `cd backend && git diff --check` passed.
## Self-Check: PASSED
- Key created files exist on disk.
- Task commits exist for `11-01`.
- PLAN-01 through PLAN-04 are covered by automated tests or implemented behavior.
- No open deviations.
## Next Phase Readiness
The first planning page slice is ready for Plan 11-02 full backend verification and browser UAT approval.
---
*Phase: 11-individual-planning*
*Completed: 2026-05-16*