diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-08-07 10:39:28 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-08-07 10:39:28 +0000 |
| commit | eadd17df2946a1219fdf02f2ee0a0ac19734e56d (patch) | |
| tree | e0460d1cdd9c17fd47ce7cce2fe7845378d8011e /web/templates/partials/task-detail.html | |
| parent | 06450fe69ade2928deb9274bb67b7ba60d394b4f (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/task-detail.html')
| -rw-r--r-- | web/templates/partials/task-detail.html | 66 |
1 files changed, 62 insertions, 4 deletions
diff --git a/web/templates/partials/task-detail.html b/web/templates/partials/task-detail.html index ace604f..135c38f 100644 --- a/web/templates/partials/task-detail.html +++ b/web/templates/partials/task-detail.html @@ -1,12 +1,70 @@ {{define "task-detail"}} <div class="p-4"> - <h3 class="font-semibold text-gray-900 mb-3">{{.Title}}</h3> + <h3 class="font-semibold text-white mb-3">{{.Title}}</h3> <form hx-post="/tasks/update" hx-swap="none" hx-on::after-request="if(event.detail.successful) { closeTaskModal(); htmx.trigger(document.body, 'refresh-tasks'); }"> <input type="hidden" name="id" value="{{.ID}}"> <input type="hidden" name="source" value="{{.Source}}"> - <label class="block text-sm font-medium text-gray-700 mb-1">Description</label> - <textarea name="description" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm mb-3 h-32">{{.Description}}</textarea> - <button type="submit" class="w-full bg-primary-600 hover:bg-primary-700 text-white px-4 py-2 rounded-lg text-sm font-medium">Save</button> + <label class="block text-sm font-medium text-white/70 mb-1">Description</label> + <textarea name="description" class="w-full bg-input border border-white/20 rounded-lg px-3 py-2 text-sm text-white placeholder-white/50 mb-3 h-32">{{.Description}}</textarea> + <button type="submit" class="w-full bg-white/20 hover:bg-white/30 text-white px-4 py-2 rounded-lg text-sm font-medium">Save</button> </form> + + {{if .IsDoot}} + <div class="mt-4 pt-4 border-t border-white/10"> + <h4 class="text-sm font-medium text-white/70 mb-2">Recurrence</h4> + {{if .RecurrenceFreq}} + <p class="text-xs text-teal-300/80 mb-2"> + Repeats every {{if gt .RecurrenceInterval 1}}{{.RecurrenceInterval}} {{recurrenceUnit .RecurrenceFreq}}s{{else}}{{recurrenceUnit .RecurrenceFreq}}{{end}}{{if and (eq .RecurrenceFreq "weekly") .RecurrenceWeekdays}} on {{weekdayNames .RecurrenceWeekdays}}{{end}} + </p> + {{end}} + <form hx-post="/tasks/recurrence" hx-target="#task-edit-content" hx-swap="innerHTML"> + <input type="hidden" name="id" value="{{.ID}}"> + <div class="flex gap-2 mb-2"> + <select name="freq" class="flex-1 bg-input border border-white/20 rounded-lg px-3 py-2 text-sm text-white"> + <option value="" {{if eq .RecurrenceFreq ""}}selected{{end}}>None</option> + <option value="daily" {{if eq .RecurrenceFreq "daily"}}selected{{end}}>Daily</option> + <option value="weekly" {{if eq .RecurrenceFreq "weekly"}}selected{{end}}>Weekly</option> + <option value="monthly" {{if eq .RecurrenceFreq "monthly"}}selected{{end}}>Monthly</option> + <option value="yearly" {{if eq .RecurrenceFreq "yearly"}}selected{{end}}>Yearly</option> + </select> + <input type="number" name="interval" min="1" value="{{if gt .RecurrenceInterval 0}}{{.RecurrenceInterval}}{{else}}1{{end}}" + class="w-20 bg-input border border-white/20 rounded-lg px-3 py-2 text-sm text-white" title="Every N"> + </div> + <div class="flex flex-wrap gap-3 mb-3"> + <label class="flex items-center gap-1 text-xs text-white/60"> + <input type="checkbox" name="weekdays" value="0" {{if hasInt .RecurrenceWeekdays 0}}checked{{end}} class="h-3.5 w-3.5 rounded bg-black/40 border-white/30"> + Su + </label> + <label class="flex items-center gap-1 text-xs text-white/60"> + <input type="checkbox" name="weekdays" value="1" {{if hasInt .RecurrenceWeekdays 1}}checked{{end}} class="h-3.5 w-3.5 rounded bg-black/40 border-white/30"> + Mo + </label> + <label class="flex items-center gap-1 text-xs text-white/60"> + <input type="checkbox" name="weekdays" value="2" {{if hasInt .RecurrenceWeekdays 2}}checked{{end}} class="h-3.5 w-3.5 rounded bg-black/40 border-white/30"> + Tu + </label> + <label class="flex items-center gap-1 text-xs text-white/60"> + <input type="checkbox" name="weekdays" value="3" {{if hasInt .RecurrenceWeekdays 3}}checked{{end}} class="h-3.5 w-3.5 rounded bg-black/40 border-white/30"> + We + </label> + <label class="flex items-center gap-1 text-xs text-white/60"> + <input type="checkbox" name="weekdays" value="4" {{if hasInt .RecurrenceWeekdays 4}}checked{{end}} class="h-3.5 w-3.5 rounded bg-black/40 border-white/30"> + Th + </label> + <label class="flex items-center gap-1 text-xs text-white/60"> + <input type="checkbox" name="weekdays" value="5" {{if hasInt .RecurrenceWeekdays 5}}checked{{end}} class="h-3.5 w-3.5 rounded bg-black/40 border-white/30"> + Fr + </label> + <label class="flex items-center gap-1 text-xs text-white/60"> + <input type="checkbox" name="weekdays" value="6" {{if hasInt .RecurrenceWeekdays 6}}checked{{end}} class="h-3.5 w-3.5 rounded bg-black/40 border-white/30"> + Sa + </label> + </div> + <button type="submit" class="w-full bg-white/10 hover:bg-white/20 text-white/90 px-4 py-2 rounded-lg text-sm font-medium"> + {{if .RecurrenceFreq}}Update{{else}}Set{{end}} Recurrence + </button> + </form> + </div> + {{end}} </div> {{end}} |
