summaryrefslogtreecommitdiff
path: root/web/templates/partials/tasks-tab.html
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-08-07 10:39:28 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-08-07 10:39:28 +0000
commiteadd17df2946a1219fdf02f2ee0a0ac19734e56d (patch)
treee0460d1cdd9c17fd47ce7cce2fe7845378d8011e /web/templates/partials/tasks-tab.html
parent06450fe69ade2928deb9274bb67b7ba60d394b4f (diff)
Wire the Tasks tab into nav; fold in buckets/projects/labels and recurrence
The Tasks tab (/tabs/tasks) existed server-side and was tested, but nothing in the nav linked to it -- it was pure dead weight in the other direction. Wiring it up as the natural home for everything that was either misplaced in Settings or missing a web UI entirely: - Maintenance Buckets, Projects, and Labels moved out of Settings and into the Tasks tab (restyled from Settings' opaque slate cards to the glass/backdrop-blur look already used by the tab's chain/atom cards -- they're now embedded in index.html's page shell, not a standalone page, so the shared bg-card/bg-input classes from that shell apply). Settings keeps only what's actually settings: Passkeys, Trusted Agents, Data Sources. - Added a Recurrence section to the task-detail modal (freq/interval/ weekday form, posting to a new POST /tasks/recurrence -- the HTMX counterpart to the widget API's HandleWidgetTaskRecurrence). Native task recurrence previously had zero web UI at all, only reachable via the Android widget's RecurrenceEditDialog. Also fixed a real bug found while touching this code: HandleGetTaskDetail's source switch only had a case for "trello" -- opening any native ("doot") task's detail modal, which is most tasks in this tab, showed a blank title and description. Factored both call sites (initial GET and the re-render after a recurrence edit) through one loadTaskDetailData helper and added the missing "doot" case. Also fixed task-detail.html's styling, which was still using pre-dark-theme classes (text-gray-900 etc.) -- functionally invisible text on the modal's dark background. Verified with a throwaway local server (real templates + real DB, not the MockRenderer the unit tests use) seeded with a recurring task, a bucket, a project, and a label -- confirmed all five touched routes render 200 with the expected content, including the populated Buckets/Projects/Labels sections and a real weekly-recurrence form with the correct weekdays pre-checked. Caught and fixed a copy bug this way too ("every 2 weeklys" -> "every 2 weeks"). Not committed; deleted after use. go build ./..., go vet ./..., and go test ./... all clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL
Diffstat (limited to 'web/templates/partials/tasks-tab.html')
-rw-r--r--web/templates/partials/tasks-tab.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/web/templates/partials/tasks-tab.html b/web/templates/partials/tasks-tab.html
index b506716..1ac6703 100644
--- a/web/templates/partials/tasks-tab.html
+++ b/web/templates/partials/tasks-tab.html
@@ -143,5 +143,71 @@
</div>
</details>
{{end}}
+
+ <!-- Maintenance Buckets -->
+ <details class="group">
+ <summary class="text-lg font-semibold mb-3 flex items-center gap-2 text-white/70 cursor-pointer hover:text-white/90 list-none">
+ <span>🪣</span> Maintenance Buckets
+ <svg class="w-4 h-4 ml-auto transform transition-transform group-open:rotate-180" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
+ </svg>
+ </summary>
+ {{template "buckets-section" .}}
+ <form class="mt-3 flex flex-wrap gap-2 p-3 bg-black/20 rounded-lg" hx-post="/settings/buckets" hx-target="#buckets-list" hx-swap="outerHTML" hx-on::after-request="if(event.detail.successful) this.reset()">
+ <input type="text" name="name" placeholder="Bucket name" required
+ class="flex-1 bg-input border border-white/20 rounded-lg px-3 py-2 text-sm text-white placeholder-white/50 outline-none focus:ring-1 focus:ring-white/30">
+ <input type="number" name="cycle_days" placeholder="Cycle (days)" required min="1"
+ class="w-28 bg-input border border-white/20 rounded-lg px-3 py-2 text-sm text-white placeholder-white/50 outline-none focus:ring-1 focus:ring-white/30">
+ <input type="number" name="pick_n" placeholder="Pick N" required min="1"
+ class="w-24 bg-input border border-white/20 rounded-lg px-3 py-2 text-sm text-white placeholder-white/50 outline-none focus:ring-1 focus:ring-white/30">
+ <button type="submit" class="bg-white/10 hover:bg-white/20 text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors">Create Bucket</button>
+ </form>
+ </details>
+
+ <!-- Projects (read-only) -->
+ <details class="group">
+ <summary class="text-lg font-semibold mb-3 flex items-center gap-2 text-white/70 cursor-pointer hover:text-white/90 list-none">
+ <span>📁</span> Projects
+ <span class="text-sm font-normal text-white/40">({{len .Projects}})</span>
+ <svg class="w-4 h-4 ml-auto transform transition-transform group-open:rotate-180" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
+ </svg>
+ </summary>
+ <div class="grid gap-2 sm:grid-cols-2 lg:grid-cols-3">
+ {{if .Projects}}
+ {{range .Projects}}
+ <div class="bg-card rounded-lg border border-white/5 flex items-center gap-3 py-2 px-3">
+ <span class="w-3 h-3 rounded-full flex-shrink-0" style="background-color: {{.Color}}"></span>
+ <span class="text-sm text-white/80 truncate">{{.Name}}</span>
+ </div>
+ {{end}}
+ {{else}}
+ <div class="bg-card rounded-lg border border-white/5 col-span-full text-center text-white/40 py-6 text-sm italic">No projects yet.</div>
+ {{end}}
+ </div>
+ </details>
+
+ <!-- Labels (read-only) -->
+ <details class="group">
+ <summary class="text-lg font-semibold mb-3 flex items-center gap-2 text-white/70 cursor-pointer hover:text-white/90 list-none">
+ <span>🏷️</span> Labels
+ <span class="text-sm font-normal text-white/40">({{len .Labels}})</span>
+ <svg class="w-4 h-4 ml-auto transform transition-transform group-open:rotate-180" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
+ </svg>
+ </summary>
+ <div class="grid gap-2 sm:grid-cols-2 lg:grid-cols-3">
+ {{if .Labels}}
+ {{range .Labels}}
+ <div class="bg-card rounded-lg border border-white/5 flex items-center gap-3 py-2 px-3">
+ <span class="w-3 h-3 rounded-full flex-shrink-0" style="background-color: {{.Color}}"></span>
+ <span class="text-sm text-white/80 truncate">{{.Name}}</span>
+ </div>
+ {{end}}
+ {{else}}
+ <div class="bg-card rounded-lg border border-white/5 col-span-full text-center text-white/40 py-6 text-sm italic">No labels assigned a color yet.</div>
+ {{end}}
+ </div>
+ </details>
</div>
{{end}}