feat(ui): queue position, elapsed time, filename, CPU-mode notice #46

Merged
goldstein merged 1 commit from feat/ui-polish into main 2026-04-18 20:06:36 +00:00
Owner

Summary

Addresses user confusion where a freshly-submitted job sits in pending for minutes with no explanation (single-worker queue + CPU-mode OCR).

  • FileRef.display_name (optional metadata) — UI preserves client-provided upload filename; pipeline ignores it for execution. Backward compatible with older stored rows.
  • jobs_repo.queue_position(job_id)(ahead, total_active). Fragment renders "Queue position: N ahead — M jobs total in flight (single worker)" / "About to start — the worker just freed up".
  • Elapsed time on running (Running for MM:SS) and finished (Finished in MM:SS).
  • /healthz gains additive ocr_gpu: true | false | null key (not part of the gate). Surya records torch.cuda.is_available() on first warm-up; UI surfaces a CPU-mode notice when false.
  • Fragment polish: status / result panels, Pico <progress>, live dot via CSS animation.
  • Persistent page header with Upload-a-new-extraction link + copy-to-clipboard job id button; <title> includes the job id.

Test plan

  • uv run pytest tests/unit tests/integration -v — 321 green (272 unit, 49 integration).
  • Lint clean.
  • Post-deploy: curl http://192.168.68.42:8994/healthz returns the new ocr_gpu key.
  • Post-deploy: curl http://192.168.68.42:8994/ui/jobs/ef08e00c-0b40-43ec-9ec9-58af136dc3d3/fragment renders without crashing on legacy rows that lack display_name.

🤖 Generated with Claude Code

## Summary Addresses user confusion where a freshly-submitted job sits in `pending` for minutes with no explanation (single-worker queue + CPU-mode OCR). - `FileRef.display_name` (optional metadata) — UI preserves client-provided upload filename; pipeline ignores it for execution. Backward compatible with older stored rows. - `jobs_repo.queue_position(job_id)` → `(ahead, total_active)`. Fragment renders "Queue position: N ahead — M jobs total in flight (single worker)" / "About to start — the worker just freed up". - Elapsed time on running (`Running for MM:SS`) and finished (`Finished in MM:SS`). - `/healthz` gains additive `ocr_gpu: true | false | null` key (not part of the gate). Surya records `torch.cuda.is_available()` on first warm-up; UI surfaces a CPU-mode notice when false. - Fragment polish: status / result panels, Pico `<progress>`, live dot via CSS animation. - Persistent page header with Upload-a-new-extraction link + copy-to-clipboard job id button; `<title>` includes the job id. ## Test plan - [x] `uv run pytest tests/unit tests/integration -v` — 321 green (272 unit, 49 integration). - [x] Lint clean. - [ ] Post-deploy: `curl http://192.168.68.42:8994/healthz` returns the new `ocr_gpu` key. - [ ] Post-deploy: `curl http://192.168.68.42:8994/ui/jobs/ef08e00c-0b40-43ec-9ec9-58af136dc3d3/fragment` renders without crashing on legacy rows that lack `display_name`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
goldstein added 1 commit 2026-04-18 20:03:54 +00:00
feat(ui): queue position, elapsed time, filename, CPU-mode notice
All checks were successful
tests / test (push) Successful in 1m18s
tests / test (pull_request) Successful in 1m21s
2d22b704b7
Address user confusion from "pending" jobs with no explanation:

* FileRef.display_name — optional UI-only metadata so the UI can show
  the client-provided upload filename instead of the on-disk UUID. The
  pipeline ignores it for execution; older stored rows stay valid
  because the field is optional.
* jobs_repo.queue_position — returns (ahead, total_active) so the
  fragment can render "Queue position: N ahead" for pending jobs and
  "About to start" when N == 0. Terminal jobs return (0, 0).
* Fragment polish — status / queue / elapsed / result panels; live dot
  via CSS animation; CPU-mode details block when /healthz reports
  ocr_gpu: false. Elapsed time formats as MM:SS (running or finished).
* /healthz gains an additive ocr_gpu key (true/false/null). Existing
  postgres/ollama/ocr gating is unchanged. Surya records CUDA availability
  on warm_up; FakeOCRClient has no attribute and probes to None.
* Persistent header with "Upload a new extraction" link and copy-to-
  clipboard button for the current job id; <title> includes job id.

Tests: +7 unit + +6 integration. Full suite 321 green (272 unit, 49
integration). Lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
goldstein merged commit 029c20c39e into main 2026-04-18 20:06:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: goldstein/infoxtractor#46
No description provided.