From 4d6f14e7d106dadeb354081a32dfa8b1f40371e0 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 30 Nov 2026 11:38:15 +0100 Subject: fix(todo): open tasks at the configured URL, animate done and snooze Vikunja's frontend_url said port 80, so a tap opened the wrong page; the frontend lives at the API's address, so open uses [todo] url. A hold now turns the chip green with a ticked box and shrinks it away, a snooze carries it off to the right; the row is redrawn only after the animation, so it is not cut short. Co-Authored-By: Claude Opus 5.5 --- deckit/modules/todo.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'deckit') diff --git a/deckit/modules/todo.py b/deckit/modules/todo.py index 8ce673d..3c698e0 100644 --- a/deckit/modules/todo.py +++ b/deckit/modules/todo.py @@ -104,7 +104,6 @@ class Todo: self.pass_ = cfg.get("pass", _pass) self.token = None self.now = cfg.get("now", lambda: datetime.now(timezone.utc)) - self.front = None self.st = {"tasks": [], "error": None} self.wake, self.stopping = threading.Event(), False self.actions = {"open": self._open, "done": self._done, "snooze": self._snooze} if self.url else {} @@ -123,8 +122,6 @@ class Todo: def refresh(self): try: - if self.front is None: - self.front = self.http("GET", self.url + "/api/v1/info", "").get("frontend_url", "") items = self._call("GET", "/api/v2/tasks?" + urllib.parse.urlencode( {"filter": FILTER, "per_page": 50})).get("items") or [] self.st = {"tasks": pick(items, self.now()), "error": None} @@ -148,8 +145,9 @@ class Todo: def _open(self, body): i = self._id(body) - base = (self.front or self.url).rstrip("/") - self._write(lambda: self.popen(["xdg-open", f"{base}/tasks/{i}"])) + # ponytail: the frontend at the API's address; /api/v1/info's frontend_url + # is often wrong behind a port (it says :80). A [todo] frontend if they ever differ. + self._write(lambda: self.popen(["xdg-open", f"{self.url}/tasks/{i}"])) def _done(self, body): i = self._id(body) -- cgit v1.2.3