aboutsummaryrefslogtreecommitdiffstats
path: root/docs/superpowers/specs
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-30 11:13:47 +0100
committerDanilo M. <danix@danix.xyz>2026-11-30 11:13:47 +0100
commit41c503645122f3d2d79ea4a428d6eb72c399c5b5 (patch)
tree92dfb9879824a9d2d67de8b7262b348fa1303930 /docs/superpowers/specs
parent88f120cb544296f4c760546a204f1e2268a2e5dd (diff)
downloaddeck-it-41c503645122f3d2d79ea4a428d6eb72c399c5b5.tar.gz
deck-it-41c503645122f3d2d79ea4a428d6eb72c399c5b5.zip
feat(todo): Vikunja tasks due now on the Dashboard
A row under the music and spending cards lists the open Vikunja tasks that are due today or overdue, or whose reminder has passed, and is hidden when there are none. A task with a reminder still ahead is left out, so snoozing adds a reminder 30 min ahead and the task returns when it fires. Tap opens the task in the PC's browser, hold marks it done, a swipe right snoozes it. [todo] url points at Vikunja; the API token lives in ~/.config/deck-it/vikunja-token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.