aboutsummaryrefslogtreecommitdiffstats
path: root/docs/superpowers/specs
diff options
context:
space:
mode:
Diffstat (limited to 'docs/superpowers/specs')
-rw-r--r--docs/superpowers/specs/2026-11-30-todo-design.md56
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/superpowers/specs/2026-11-30-todo-design.md b/docs/superpowers/specs/2026-11-30-todo-design.md
new file mode 100644
index 0000000..72ac21a
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-30-todo-design.md
@@ -0,0 +1,56 @@
+# Vikunja todos on the Dashboard
+
+The Dashboard's bottom row (once the action icons) stays empty unless there is
+something to do. Then it lists the Vikunja tasks that need attention.
+
+## What shows
+
+Open tasks that are due today or overdue, or whose reminder has passed.
+A task with a reminder still in the future is hidden: that is how a snooze
+hides it until the reminder fires. Overdue first, then by due date; a task
+with no due date (only a reminder) after those. At most 3 lines plus
+"+N more". No tasks: no row.
+
+## Server: `deckit/modules/todo.py`
+
+- `[todo] url`, the Vikunja API base (`http://host:3456`). Empty: the module
+ reports nothing and starts no thread.
+- Token: `~/.config/deck-it/vikunja-token`, a Vikunja API token allowed to
+ read and update tasks. Never in the repo or the shipped config.
+- A thread reads `GET /api/v2/tasks?filter=done = false && (due_date <
+ now/d+1d || reminders < now)` every 60s and right after an action;
+ `/api/v1/info`'s `frontend_url` once for links.
+- State: `{tasks: [{id, title, due}], more, error}`. `due` is an ISO time
+ or null (Vikunja's `0001-01-01` is null).
+- Actions take `{id}`, which must be one the last state listed:
+ - `open`: `xdg-open <frontend_url>tasks/<id>` on the PC.
+ - `done`: merge-patch `{done: true}` (a repeating task moves on, Vikunja's
+ own rule).
+ - `snooze`: read the task, merge-patch its `reminders` with every old one
+ plus one at now+30m.
+- Unreachable or refused: `error` carries the reason; the last tasks are
+ dropped.
+
+## Dashboard
+
+A `.dash-todo` row at the bottom of `.dash-mid`, hidden when empty. Each line:
+title, and "overdue 2d", "today 15:00" or "reminder". Gestures:
+
+- tap: `open`
+- hold (`hold.js`): `done`, the line fades out
+- swipe left to right past a third of its width: `snooze`; the line follows
+ the finger and slides out; a swipe cancels the hold.
+
+An error shows one muted line, "Vikunja unreachable", the reason in its
+tooltip.
+
+## Keystone
+
+`todo` under Dashboard parts, labelled "Vikunja todos", and a URL field.
+
+## Tests
+
+`tests/test_todo.py` with a fake HTTP layer: a future reminder hides a task,
+sort order, `0001` dates read as none, an unlisted id is refused, snooze keeps
+the old reminders and adds one, done sends a partial patch, empty url is
+quiet.