# Phase 4: Tasks (Kanban) - 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-15
**Phase:** 4-tasks-kanban
**Areas discussed:** Column architecture, Move/reorder interaction, Task detail UX

---

## Column architecture

| Option | Description | Selected |
|--------|-------------|----------|
| Fixed columns (recommended) | 3 columns hardcoded, no task_columns table | |
| Configurable columns | task_columns table with user CRUD | |
| Fixed for now, schema-ready for later | 3 hardcoded names but schema-evolvable | |

**User's choice:** Fixed columns — but with 4 states: todo, in progress, in review, done (not the default 3-column set)
**Notes:** User specified the exact column names, overriding the default To do / Doing / Done suggestion.

---

| Option | Description | Selected |
|--------|-------------|----------|
| Postgres enum type (recommended) | CREATE TYPE task_status AS ENUM | ✓ |
| TEXT with CHECK constraint | column TEXT NOT NULL CHECK (column IN ...) | |
| Small integer (0-3) | position SMALLINT, Go mapping layer | |

**User's choice:** Postgres enum type
**Notes:** No additional notes.

---

| Option | Description | Selected |
|--------|-------------|----------|
| Hard-delete (consistent with Phase 3) | No deleted_at, consistent with D-01 | ✓ |
| Soft-delete | deleted_at nullable, recoverable | |

**User's choice:** Hard-delete
**Notes:** Consistent with established Phase 3 pattern.

---

## Move/reorder interaction

| Option | Description | Selected |
|--------|-------------|----------|
| Drag-and-drop with Sortable.js | ~30KB standalone utility, canonical kanban UX | ✓ |
| Button-driven move/reorder | Pure HTMX, ↑↓←→ buttons, no extra JS | |
| Select-based column move + buttons for reorder | Hybrid: select for column, buttons for order | |

**User's choice:** Drag-and-drop with Sortable.js
**Notes:** User accepted the JS dependency as a utility (not framework), staying within the "no JS framework" constraint.

---

| Option | Description | Selected |
|--------|-------------|----------|
| HTMX hx-trigger + Sortable 'end' event (recommended) | ~5 line inline script bridges Sortable to HTMX | ✓ |
| Vanilla fetch POST in Sortable callback | Bypasses HTMX for the drop interaction | |
| Let researcher/planner decide | Defer wiring pattern | |

**User's choice:** HTMX hx-trigger + Sortable 'end' event
**Notes:** Keeps the interaction HTMX-first with a minimal inline script bridge.

---

| Option | Description | Selected |
|--------|-------------|----------|
| Integer gaps-of-100 (recommended) | position INTEGER, rebalance when gaps exhaust | ✓ |
| Fractional index string (lexorank-style) | TEXT, never rebalances, complex to generate | |
| Sequential integer (no gaps) | Renumber all rows on every reorder | |

**User's choice:** Integer gaps-of-100
**Notes:** Ordering strategy was not in the user's selected areas; asked inline since it's a schema gate.

---

## Task detail UX

| Option | Description | Selected |
|--------|-------------|----------|
| Inline expand in the kanban card | HTMX swap, same pattern as Phase 3 inline edit | ✓ |
| Slide-over / modal panel | New panel component needed, no existing equivalent | |
| Dedicated task detail page | /tablos/{id}/tasks/{task_id}, interrupts board flow | |

**User's choice:** Inline expand in the kanban card
**Notes:** Consistent with Phase 3's inline edit pattern (D-06).

---

| Option | Description | Selected |
|--------|-------------|----------|
| Inline form at bottom of column (recommended) | + Add task → form in column, consistent with Phase 3 | ✓ |
| A single shared create form above the board | Column selector, disconnects visually | |
| Click-to-edit: blank card appears immediately | More JS needed beyond Sortable | |

**User's choice:** Inline form at bottom of column
**Notes:** Consistent with Phase 3's inline create pattern (D-05).

---

| Option | Description | Selected |
|--------|-------------|----------|
| Replaces the tablo detail body (board IS the detail page) | Title/desc + kanban on one page, no tabs | ✓ |
| Tabs: Overview \| Tasks \| Files | Tab nav added now, before Phase 5 files exist | |

**User's choice:** Board embedded directly in tablo detail page (no tabs)
**Notes:** Tabs deferred until Phase 5 when files section is added; revisit then if layout is crowded.

---

## Claude's Discretion

- Exact Tailwind styling for task cards
- Column header visual treatment (background, count badge)
- Sortable.js drag handle (full card vs grip icon)
- HTTP verb for task create/edit endpoints
- Position rebalancing timing (sync vs deferred)
- Rebalance threshold (e.g. adjacent gap < 2)

## Deferred Ideas

- Configurable columns (user-defined names, task_columns table) — v2 or later phase
- Tab navigation on tablo detail (Overview / Tasks / Files) — revisit in Phase 5
- Task due dates, assignees, labels, comments — out of v1 scope
- Rich-text task descriptions — plain text only in v1
