feat: task management admin UI at /admin/tasks #7

Merged
erik merged 11 commits from spec/task-mgmt-ui into main 2026-05-19 22:42:13 +00:00
Member

Summary

Implements the task queue admin UI for issue #3.

What's in this PR

  • Queue helpers in queue.ts: restartTask, listTasks, getTask — all writes still go through queue.ts as the sole writer
  • Admin middleware: 302 to /sign-in for unauthenticated /admin/* requests
  • List route /admin/tasks: filter by type, status, run_after; paginated table (100/page); empty-state copy
  • Detail route /admin/tasks/:id: same TaskListPage component with drawer open
  • TaskDrawerIsland: fetches JSON on mount, renders full task details + Restart form (no-JS compatible)
  • JSON endpoint /admin/tasks/:id/index.json: returns task row or 404
  • Restart handler: POST-only, calls restartTask, 302 back to detail

Tests

  • 13 unit tests covering all queue helpers and filter combinations
  • 2 e2e tests: restart flow end-to-end + unauth guard

Validation

just check and just test::units pass. just validate passes except the pre-existing deno audit failure (same 8 vulnerabilities on main before this change).

Closes #3

## Summary Implements the task queue admin UI for issue #3. ### What's in this PR - **Queue helpers** in `queue.ts`: `restartTask`, `listTasks`, `getTask` — all writes still go through `queue.ts` as the sole writer - **Admin middleware**: 302 to /sign-in for unauthenticated /admin/* requests - **List route** `/admin/tasks`: filter by type, status, run_after; paginated table (100/page); empty-state copy - **Detail route** `/admin/tasks/:id`: same `TaskListPage` component with drawer open - **TaskDrawerIsland**: fetches JSON on mount, renders full task details + Restart form (no-JS compatible) - **JSON endpoint** `/admin/tasks/:id/index.json`: returns task row or 404 - **Restart handler**: POST-only, calls `restartTask`, 302 back to detail ### Tests - 13 unit tests covering all queue helpers and filter combinations - 2 e2e tests: restart flow end-to-end + unauth guard ### Validation `just check` and `just test::units` pass. `just validate` passes except the pre-existing `deno audit` failure (same 8 vulnerabilities on `main` before this change). Closes #3
spec: task management admin UI (closes #3)
Some checks failed
Validate / validate (pull_request) Failing after 2s
3e55ded1a9
Adds an OpenSpec proposal for /admin/tasks: an authenticated page that
lists tasks with filters for type/status/run_after, opens a detail
drawer via URL, and exposes a restart action that resets a row to
pending regardless of current status.

- New capability: task-admin-ui (page, drawer, filters, restart button)
- Modified capability: task-queue (adds restartTask helper as the sole
  reset writer, preserving the queue-writes invariant)
feat: task management admin UI at /admin/tasks (closes #3)
Some checks failed
Validate / validate (pull_request) Failing after 2s
ac2c7c5758
Adds /admin/tasks with type/status/run_after filters, paginated table, and
a Shoelace drawer (TaskDrawerIsland) that opens at /admin/tasks/<id> to
show full task details and a Restart form. New queue helpers: restartTask,
listTasks, getTask. Auth guard via admin/_middleware.ts. 13 unit + 2 e2e tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
agent-dev changed title from spec: task management admin UI (#3) to feat: task management admin UI at /admin/tasks 2026-05-19 18:58:42 +00:00
feat: redesign Task Details drawer layout
Some checks failed
Validate / validate (pull_request) Failing after 2s
0cf4eedb70
Replace tabular dl with pills + stacked fields. Status and Attempts
render as rounded-full pills at the top; ID/Type stack below; Run After
and Age sit in a two-column grid; Payload and optional Last Error follow.
Drawer label renamed Task detail -> Task Details.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: use sl-badge with semantic variants for Task Details pills
Some checks failed
Validate / validate (pull_request) Failing after 2s
6dba15401a
Status: done=success, failed=danger, pending/processing=neutral/primary.
Attempts: <2=primary, <max=warning, =max=danger.

Adds sl-badge to the web-components bundle entry and JSX type declarations.
Run `just components` to rebuild static/components.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
docs: prefer Shoelace components over bespoke elements
Some checks failed
Validate / validate (pull_request) Failing after 2s
7a9e850fa2
Add guidance to AGENTS.md to reach for sl-badge, sl-button, etc. before
hand-rolling with Tailwind. Includes the three-step process for adding a
new Shoelace component to the bundle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: remove pill variant from sl-badge (too rounded)
Some checks failed
Validate / validate (pull_request) Failing after 2s
8ba438a00b
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: Task Details drawer nits
Some checks failed
Validate / validate (pull_request) Failing after 2s
89a76c6f8b
- ID and Type each on a single line (label + value inline)
- Run After / Age use flex with Age shrink-0 and Run After filling remaining space
- Badges larger via inline font-size/padding override
- Badges use justify-between
- attempts=0 now neutral (not primary)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: badges justify-around and larger size (1rem / 0.5em 1.1em padding)
Some checks failed
Validate / validate (pull_request) Failing after 2s
5e5c5211c6
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: more badge padding and spaced colon separator
Some checks failed
Validate / validate (pull_request) Failing after 2s
b0d5309ef4
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: zero vertical body padding on detail panel drawers
Some checks failed
Validate / validate (pull_request) Failing after 2s
797723b727
Set --body-spacing: 0 var(--sl-spacing-large) on the task details drawer
so content is flush top/bottom while keeping Shoelace's horizontal padding.
Noted the pattern in AGENTS.md for all future detail panel drawers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: standardise task type names to kebab-case
Some checks failed
Validate / validate (pull_request) Failing after 2s
cc71757208
Rename all underscore task types to hyphens to match the existing
cleanup-poi-storage / cleanup-trip-storage / optimize-photo convention:

  compute_local_signals  -> compute-local-signals
  crop_photo             -> crop-photo
  curate_photo           -> curate-photo
  embed_photo            -> embed-photo
  extract_signal_from_camera -> extract-signal-from-camera
  extract_signal_via_llm -> extract-signal-via-llm
  flag_duplicates        -> flag-duplicates
  tag_photo              -> tag-photo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
erik self-assigned this 2026-05-19 22:41:47 +00:00
erik merged commit 8106515f25 into main 2026-05-19 22:42:13 +00:00
erik deleted branch spec/task-mgmt-ui 2026-05-19 22:42:13 +00:00
Sign in to join this conversation.
No description provided.