# Phase 3: Tablos CRUD - Discussion Log

> **Audit trail only.** Do not use as input to planning, research, or execution agents.
> Decisions are captured in CONTEXT.md — this log preserves the alternatives considered.

**Date:** 2026-05-14
**Phase:** 3-Tablos CRUD
**Areas discussed:** Tablos schema, Create/Edit UX, Delete confirmation, URL structure

---

## Tablos Schema

### Delete behavior

| Option | Description | Selected |
|--------|-------------|----------|
| Hard-delete (recommended) | Matches D-02 user pattern. Simpler queries — no WHERE deleted_at IS NULL everywhere. No recovery path needed in v1. | ✓ |
| Soft-delete (deleted_at) | Reversible. Adds deleted_at column and filters to every query. | |
| Soft-delete with a recycle bin page | Soft-delete + a /tablos/deleted route to restore or permanently delete. | |

**User's choice:** Hard-delete
**Notes:** Consistent with the hard-delete pattern established for users in Phase 2 (D-02).

---

### Extra columns beyond required

| Option | Description | Selected |
|--------|-------------|----------|
| title + description only (recommended) | Lean — matches TABLO-02 minimum. | |
| Add a color/icon field | One extra enum or text column for a visual label. | ✓ |
| Add a slug column | Pre-generate a slug for human-readable URLs. | |

**User's choice:** Add a color/icon field
**Notes:** Adds a `color` text column (nullable). Visual treatment (dot, badge, border accent) is Claude's discretion.

---

### Color field type

| Option | Description | Selected |
|--------|-------------|----------|
| A single color string (recommended) | color text (nullable, e.g. hex or Tailwind name). | ✓ |
| An emoji/icon string | icon text (nullable). | |
| Both color and icon | Two nullable columns. Matches JS app most closely. | |

**User's choice:** Single color string
**Notes:** Stored as text (e.g. `"#6366f1"` or `"indigo"`). Validation rules at planner's discretion.

---

### Sort order

| Option | Description | Selected |
|--------|-------------|----------|
| Newest-first only (recommended) | ORDER BY created_at DESC. No position column. | ✓ |
| Add a position column now | Integer position for user-defined order. | |

**User's choice:** Newest-first only
**Notes:** Reordering is out of scope for Phase 3.

---

## Create/Edit UX

### Create flow

| Option | Description | Selected |
|--------|-------------|----------|
| Inline form in the list (recommended) | "New tablo" button expands inline form via HTMX swap. New card prepended on submit. | ✓ |
| Modal dialog | Button opens a modal overlay. Needs new Modal component. | |
| Separate /tablos/new page | Navigate to dedicated create page. Full reload. | |

**User's choice:** Inline form in the list
**Notes:** Consistent with TABLO-06 (no full reloads). Reuses the HTMX fragment swap pattern from Phase 2.

---

### Edit flow

| Option | Description | Selected |
|--------|-------------|----------|
| Inline edit on the detail page (recommended) | Click title/description to swap to editable input via HTMX. | ✓ |
| Edit button opens a form below the header | Persistent Edit button shows/hides a form section. | |
| Separate /tablos/{id}/edit page | Navigate to a dedicated edit form. Full page navigation. | |

**User's choice:** Inline edit on the detail page
**Notes:** Click-to-edit swap pattern; cancel restores original without server round-trip.

---

## Delete Confirmation

| Option | Description | Selected |
|--------|-------------|----------|
| Inline "Are you sure?" fragment (recommended) | Delete button swaps itself to confirm row. No JS, no modal. | ✓ |
| Browser confirm() dialog | hx-confirm attribute. One line, but native dialog — can't style. | |
| Modal confirmation dialog | Modal overlay. Needs Modal component (doesn't exist yet). | |

**User's choice:** Inline "Are you sure?" fragment
**Notes:** Keeps everything in Go/templ/HTMX. Delete button → confirm fragment → DELETE request → card removed.

---

## URL Structure

| Option | Description | Selected |
|--------|-------------|----------|
| /tablos/{uuid} (recommended) | Use existing uuid PK. Simple, no slug logic. | ✓ |
| /tablos/{slug} | Human-readable. Requires slug column + generation + collision handling. | |
| /tablos/{short-id} | Shorter random ID (e.g. nanoid). Needs extra column. | |

**User's choice:** /tablos/{uuid}
**Notes:** No slug column needed. Non-owners get 404 (not 403) to avoid leaking tablo existence.

---

## Claude's Discretion

- Tailwind styling for tablo cards
- Color rendering (dot/badge vs left border accent)
- HTTP verb for edit (POST with path vs PATCH)
- `updated_at` maintenance (Postgres trigger vs explicit SET in query)

## Deferred Ideas

- Tablo reordering by user (drag-and-drop or button) — needs `position` column, out of scope v1
- Full color palette picker UI — color stored in Phase 3, picker UI deferred
- Slug-based URLs — discussed and deferred; UUID sufficient for v1
- Sharing / multi-user permissions — explicitly out of scope per PROJECT.md
