From c45e96d610af200f4a8383886889b60941fbe6fb Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Sat, 16 May 2026 00:29:27 +0200 Subject: [PATCH] docs(10-01): complete events creation plan --- .planning/ROADMAP.md | 2 +- .planning/STATE.md | 18 +-- .planning/phases/10-events/10-01-SUMMARY.md | 116 ++++++++++++++++++++ 3 files changed, 126 insertions(+), 10 deletions(-) create mode 100644 .planning/phases/10-events/10-01-SUMMARY.md diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 69dafb3..addaa81 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -14,7 +14,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 | Events | Tablos have scheduled events with CRUD, validation, and authorization | EVENT-01..05 | +| 10 | 1/4 | In Progress| | | 11 | Individual Planning | Users can view their own event agenda across tablos | PLAN-01..04 | | 12 | Native Tablo Chat | Each tablo has persisted discussion with real-time delivery and no managed chat provider | CHAT-01..06 | diff --git a/.planning/STATE.md b/.planning/STATE.md index 30c7c71..4281228 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -2,15 +2,15 @@ gsd_state_version: 1.0 milestone: v2.0 milestone_name: Collaboration, planning, and social sign-in -status: ready_to_execute -last_updated: "2026-05-15T22:18:38.208Z" -last_activity: 2026-05-15 -- Phase 10 planning complete +status: executing +last_updated: "2026-05-15T22:29:24.395Z" +last_activity: 2026-05-15 progress: total_phases: 5 completed_phases: 2 total_plans: 13 - completed_plans: 9 - percent: 69 + completed_plans: 10 + percent: 77 --- # STATE @@ -28,11 +28,11 @@ See: `.planning/PROJECT.md` (updated 2026-05-15) ## Current Position -Phase: 10 (events) — PLANNED -Plan: 0 of 4 +Phase: 10 (events) — EXECUTING +Plan: 2 of 4 Status: Ready to execute -Last activity: 2026-05-15 -- Phase 10 planning complete -Resume file: .planning/phases/10-events/10-01-PLAN.md +Last activity: 2026-05-15 +Resume file: .planning/phases/10-events/10-02-PLAN.md ## Phase Status diff --git a/.planning/phases/10-events/10-01-SUMMARY.md b/.planning/phases/10-events/10-01-SUMMARY.md new file mode 100644 index 0000000..eccf1ed --- /dev/null +++ b/.planning/phases/10-events/10-01-SUMMARY.md @@ -0,0 +1,116 @@ +--- +phase: 10-events +plan: 01 +subsystem: events +tags: [events, postgres, sqlc, htmx, templ] + +requires: + - phase: 09-etapes + provides: Tablo detail navigation patterns and HTMX tab fragments reused for the Events tab +provides: + - Events table with local date and time fields scoped to tablos + - SQLC create, fetch, and month-range list queries for events + - Server-rendered Events tab with month grid and inline create form + - Event create validation for required fields and end-after-start time ordering +affects: [tablo-detail, events, planning, calendar] + +tech-stack: + added: [] + patterns: + - "EventsDeps injected through NewRouter alongside existing feature deps" + - "Server-rendered HTMX tab fragment refreshes the whole Events tab after create" + - "Local event_date/start_time/end_time stored as Postgres date/time values" + +key-files: + created: + - backend/migrations/0008_events.sql + - backend/internal/db/queries/events.sql + - backend/internal/web/handlers_events_test.go + - backend/internal/web/handlers_events.go + - backend/templates/events.templ + - backend/templates/events_forms.go + modified: + - backend/internal/web/router.go + - backend/cmd/web/main.go + - backend/templates/tablos.templ + - backend/internal/web/handlers_tablos.go + - backend/internal/web/handlers_files.go + +key-decisions: + - "Use local date/time columns rather than timestamptz for scheduled event display." + - "Refresh the entire Events tab after create to keep month navigation and event rows consistent." + - "Keep event access scoped through loadOwnedTablo and parent-scoped queries." + +patterns-established: + - "Event handlers parse YYYY-MM, YYYY-MM-DD, and HH:MM into pgtype values at the web boundary." + - "Calendar data is built in Go and rendered by templ as a 42-cell month grid." + +requirements-completed: [EVENT-01, EVENT-03, EVENT-04, EVENT-05] + +duration: ~20min +completed: 2026-05-15 +--- + +# Phase 10: Events Plan 01 Summary + +**Tablo-scoped event creation with local date/time storage and a server-rendered month calendar** + +## Performance + +- **Duration:** ~20 min +- **Started:** 2026-05-15T22:05:00Z +- **Completed:** 2026-05-15T22:28:58Z +- **Tasks:** 2 +- **Files modified:** 20 + +## Accomplishments + +- Added the `events` table, event SQLC queries, and generated DB accessors. +- Added authenticated Events routes for tab display, inline creation, canceling the create form, and POST create. +- Extended the tablo detail page with an Events tab that renders a month grid and created event titles. +- Added DB-backed handler coverage for rendering, create success, invalid end time validation, and ownership denial. + +## Task Commits + +Each task was committed atomically: + +1. **Task 1: Add RED coverage for create-and-list calendar slice** - `4fbd960` (test) +2. **Task 2: Implement event creation and month listing** - `0bfe8cf` (feat) + +## Files Created/Modified + +- `backend/migrations/0008_events.sql` - Creates the event schema, constraints, and indexes. +- `backend/internal/db/queries/events.sql` - Adds create, fetch, and month-range list queries. +- `backend/internal/web/handlers_events.go` - Adds event calendar rendering and create handlers. +- `backend/templates/events.templ` - Renders the Events tab, month grid, and create form. +- `backend/templates/events_forms.go` - Provides event form and calendar view models/helpers. +- `backend/templates/tablos.templ` - Adds the Events tab to the tablo detail surface. +- `backend/internal/web/router.go` - Wires event routes and `EventsDeps`. +- `backend/cmd/web/main.go` - Injects event dependencies into the router. +- `backend/internal/web/*_test.go` - Updates router construction and adds event handler tests. + +## Decisions Made + +- Events store `event_date`, `start_time`, and nullable `end_time` as local Postgres date/time types to avoid timezone conversion in the calendar. +- The create flow refreshes the whole `#events-tab` fragment after success so the calendar, month controls, and form slot stay synchronized. +- Event list/create authorization goes through `loadOwnedTablo`, matching files and etapes ownership behavior. + +## Deviations from Plan + +None - plan executed as written. + +## Issues Encountered + +None. + +## User Setup Required + +None - no external service configuration required. + +## Next Phase Readiness + +The event schema, router dependency, month calendar, and create form are in place. Plan 10-02 can build directly on this surface by adding owned-event edit, update, and delete handlers plus inline form fragments. + +--- +*Phase: 10-events* +*Completed: 2026-05-15*