diff --git a/.planning/phases/03-tablos-crud/03-CONTEXT.md b/.planning/phases/03-tablos-crud/03-CONTEXT.md new file mode 100644 index 0000000..6638a86 --- /dev/null +++ b/.planning/phases/03-tablos-crud/03-CONTEXT.md @@ -0,0 +1,112 @@ +# Phase 3: Tablos CRUD - Context + +**Gathered:** 2026-05-14 +**Status:** Ready for planning + + +## Phase Boundary + +A logged-in user can list, create, view, edit, and delete their own tablos end-to-end through HTMX-driven flows. The dashboard shows the user's tablos newest-first with a "Create your first tablo" empty state. All mutations (create, edit, delete) work without full page reloads; forms degrade gracefully when HTMX is unavailable. + +Delivers TABLO-01..06. **Not** in scope: kanban tasks (Phase 4), file attachments (Phase 5), tablo sharing/permissions beyond owner-only, tablo reordering by user, rich text in description, slug-based URLs, color palette picker UI (color stored but picker UI is Claude's discretion). + + + + +## Implementation Decisions + +### Database Schema — tablos +- **D-01:** Hard-delete only — no `deleted_at` column. Matches the D-02 pattern from Phase 2 (users). Simpler queries — no `WHERE deleted_at IS NULL` filters needed throughout. Deletion is irreversible via the UI (confirmation required per D-04). +- **D-02:** `tablos` table columns: `id uuid PK DEFAULT gen_random_uuid()`, `user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE`, `title text NOT NULL`, `description text` (nullable), `color text` (nullable — hex string or Tailwind color name, e.g. `"#6366f1"` or `"indigo"`; validation at planner's discretion), `created_at timestamptz NOT NULL DEFAULT now()`, `updated_at timestamptz NOT NULL DEFAULT now()`. Index on `user_id` (for per-user list queries). +- **D-03:** Sort order is always `ORDER BY created_at DESC` (newest-first). No `position` column — user reordering is out of scope for Phase 3. + +### URL Structure +- **D-04:** Tablo detail page URL: `/tablos/{uuid}` — use the `id` UUID primary key directly. No slug column, no slug generation logic. Opaque but simple. Non-owner (or unauthenticated) requests to `/tablos/{uuid}` return 404 (not 403 — no information leakage per TABLO-03). + +### Create UX +- **D-05:** "New tablo" button on the dashboard expands an **inline form** above the tablo list via HTMX swap (`hx-swap="afterbegin"` into the list container, or a dedicated `#create-form` slot). On successful POST, the form collapses and the new tablo card is prepended to the list without a full page reload. On validation error, the inline form re-renders with field errors (same HTMX fragment pattern as Phase 2 signup). + +### Edit UX +- **D-06:** Editing happens **inline on the tablo detail page**. Clicking the title or description swaps that element to an editable ``/`