blob: 92dd8a5d248fc0fc9cd65be0a851beeb85a42c3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# Phase 3 Step 3: Trello UI & Handlers
**Status:** Open
**Priority:** High
**Created:** 2024-05-22
## Description
Implement the UI and backend handlers to enable creating and completing Trello cards directly from the dashboard.
## Requirements
### 1. UI Updates
* **Refactor:** Extract individual board rendering into a new partial `web/templates/partials/trello-board.html`.
* **Add Card:** Add a "Quick Add" form to each board (using `<details>` for simplicity) that allows selecting a List and entering a Name.
* **Complete Card:** Add a checkbox to each card that marks it as complete (archives/closes it).
### 2. Backend Handlers
* `HandleCreateCard`:
* POST `/cards`
* Params: `board_id`, `list_id`, `name`
* Action: Call `CreateCard` API.
* Response: Re-render the specific board partial with updated data.
* `HandleCompleteCard`:
* POST `/cards/complete`
* Params: `card_id`
* Action: Call `UpdateCard` API (set `closed=true`).
* Response: Empty string (removes the card from UI via HTMX).
### 3. Routing
* Register the new routes in `cmd/dashboard/main.go`.
## Implementation Plan
1. Create `web/templates/partials/trello-board.html`.
2. Update `web/templates/partials/trello-boards.html`.
3. Implement handlers in `internal/handlers/handlers.go`.
4. Register routes in `cmd/dashboard/main.go`.
|