mirror of
https://gitverse.ru/kpa39l/email-assistant.git
synced 2026-11-27 18:33:08 +00:00
openspec: create change tasks-card-inline (proposal, design, spec, tasks)
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
---
|
||||
hash: "tasks-card-inline-v1"
|
||||
date: 2026-10-23
|
||||
---
|
||||
|
||||
# Task Card Inline Spec
|
||||
|
||||
## Requirement: Checkbox Toggle Fix
|
||||
|
||||
### Scenario: User checks/unchecks task
|
||||
- Given: task list displayed in .card
|
||||
- When: user clicks .chk span
|
||||
- Then: POST /api/task/{uid}/toggle fires with HX-Request=true
|
||||
- Then: server toggles STATUS in Radicale (NEEDS-ACTION ↔ COMPLETED)
|
||||
- Then: server returns `<div hx-get="/api/tasks/reload" hx-target="closest .card" hx-swap="innerHTML">`
|
||||
- Then: HTMX replaces .card innerHTML with the div
|
||||
- Then: div on load fires GET /api/tasks/reload
|
||||
- Then: server returns fresh `<div class="chead">` + `<div class="cbody">` with updated list
|
||||
- Then: DOM shows correct checkbox state and task name
|
||||
|
||||
## Requirement: Create Task Button
|
||||
|
||||
### Scenario: User clicks [+ New Task]
|
||||
- Given: task list in .cbody, last child is `<button class="add-task">+ Новая задача</button>`
|
||||
- When: user clicks button
|
||||
- Then: Alpine shows inline form (summary input + due date + submit)
|
||||
- When: user fills summary, clicks submit
|
||||
- Then: POST /api/tasks/create with subject=summary&from=tasks-card&body=
|
||||
- Then: Radicale creates VTODO
|
||||
- Then: .card reload via hx-get="/api/tasks/reload"
|
||||
- Then: new task visible
|
||||
|
||||
## Requirement: Inline Edit Task Name
|
||||
|
||||
### Scenario: User clicks task name to edit
|
||||
- Given: task shown in .cbody
|
||||
- When: user clicks on .t div
|
||||
- Then: Alpine activates edit mode (x-data="{editing: false, editText: ''}")
|
||||
- Then: .t becomes `<input x-model="editText" value="{{ summary }}">`
|
||||
- When: user presses Enter
|
||||
- Then: fetch PUT /api/task/{uid}/update with body: {summary: editText}
|
||||
- Then: Radicale updates VTODO SUMMARY
|
||||
- Then: .card reload
|
||||
- When: user presses Escape
|
||||
- Then: edit cancelled, original name restored
|
||||
|
||||
## Metric of Success
|
||||
- User can create task from main page in 2 clicks
|
||||
- User can toggle task in 1 click
|
||||
- User can rename task in 2 clicks (click name → type → Enter)
|
||||
- No "(Без темы)" after any operation
|
||||
Reference in New Issue
Block a user