jobs: header running/queued badges + GET /jobs/counts (phase 3d)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 15:48:52 +00:00
co-authored by Claude Opus 4.8
parent c277ceead7
commit f77ce3fb96
7 changed files with 83 additions and 7 deletions
+4 -6
View File
@@ -75,7 +75,7 @@ Favor power-user affordances over guardrails. See memory `sole-user-assume-compe
now returns mode/exitCode/isLive), `GET /jobs/:id`, `GET /jobs/:id/log?offset=`, `POST /jobs/:id/stop`.
Router mounted at `/jobs` and `/pipeline-jobs`. *Needs a restart to deploy; then curl/phone-testable.*
WS consolidation still pending (old `/api/tasks/run/ws` + `/api/tasks/pipeline/ws` still live).
- [~] 3 frontend
- [x] 3 frontend — master-detail `/jobs`, modal-as-creator, split list, header badges. Done.
- [x] 3a jobs UI — **master-detail** `JobsPage` (like `/chat`): `WorkspaceLayout` with a list panel
(left, polls `GET /jobs`, highlights active) + a detail panel (right) that branches by `mode`
`ScriptJobDetail` terminal (polls log + status, Stop) or `PipelineJobDetail`. One page serves
@@ -87,9 +87,7 @@ Favor power-user affordances over guardrails. See memory `sole-user-assume-compe
(queue → `/jobs`). Reuses the modal's per-group input UI in place — no separate `/jobs/new`
page or FileBrowser change needed. *(A standalone deep-linkable `/jobs/new` is deferred; the
phone creates jobs directly via `POST /jobs`.)*
- [ ] 3d header job indicators — two always-present badges next to the avatar + reload-tasks:
(1) **running** count (0/1) → links to the running job's `/jobs/:id`;
(2) **queued** count → links to the queue (`/jobs`). Backed by a lightweight
`GET /jobs/counts``{ running, runningJobId, queued }`, polled while mounted (cheap, avoids
fetching full lists). Badges hide/dim at 0.
- [x] 3d header job indicators — `JobsIndicator` (two always-present badges next to RescanButton +
UserMenu): **running** (→ running job's `/jobs/:id`) + **queued** (→ `/jobs`), polling
`GET /jobs/counts``{ running, runningJobId, queued }` every 3s; dim at 0.
- [ ] 4 push notifications