Web UI: FastAPI server + bun/React frontend#26
Conversation
Overhaul the UI as a local web app while keeping the PyQt5 desktop app working until parity: - Extract the analysis frame loop from the Qt AnalysisWorker into UI-free ecl_analysis/analysis/runner.py, shared by both UIs via callbacks. - New ecl_analysis/server/ (FastAPI, optional [web] extra): video sessions with server-side JPEG frame decoding, threaded cancellable analysis jobs with polled progress, threshold preview overlays, directory browsing for the picker, and export through the existing CSV/plot pipeline with allowlisted file serving for plot previews. - New web/ frontend (bun + Vite + React 19 + TS): dark instrument-style theme, canvas ROI draw/move/resize with background-region designation, frame scrubber with analysis-range selection and desktop keyboard shortcuts, live results chart with crosshair tooltip, inline export. - Remove stale leftovers of the abandoned ecl-v2 spike; ignore its data dir. Verified end-to-end in a browser against a synthetic ECL clip (open, draw ROIs, analyze, chart, export). 108 Python + 11 web tests pass. Claude-Session: https://claude.ai/code/session_01NTGWZgxVNFYjBAcKfZudYj
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (35)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Close the remaining parity gaps with the desktop app:
- Extract the brightest-frame and per-ROI mask scan loops from the Qt
workers into UI-free ecl_analysis/analysis/scans.py; the workers now
delegate, mirroring the earlier runner extraction.
- Generalize the server job layer to kind-aware jobs (/api/jobs/*) and add
POST /videos/{id}/mask-scan (global + per-ROI modes). Analysis accepts a
mask_job_id and fails loudly with 409 when region geometry no longer
matches the captured masks instead of silently ignoring them.
- Add POST /videos/{id}/detect-range wrapping the audio completion-beep
detector: the beep marks the run's end, counting back the expected
duration (501 when audio extras are not installed).
- Frontend: Masks panel (jump-to-brightest, capture with provenance and
coverage readout, use-masks toggle auto-invalidated on any geometry
change), audio range detection in the Run panel with multi-beep chooser,
and 0.25x-4x playback speeds (frame-striding above 1x).
Verified in-browser: capture found each synthetic blob's exact peak frame
(70 and 95), masked analysis ran with the masked indicator, silent clip
reports no beeps. 111 Python + 11 web tests pass.
Claude-Session: https://claude.ai/code/session_01NTGWZgxVNFYjBAcKfZudYj
Summary
Overhauls the UI as a local web app while keeping the PyQt5 desktop app working until parity.
ecl_analysis/analysis/runner.pyandscans.py(progress/cancel via plain callbacks). The Qt workers are now thin adapters; the web server is a second adapter over the same code — one copy of the science.ecl_analysis/server/(FastAPI, new optional[web]extra): video sessions with server-side JPEG frame decoding (browsers can't decode lab codecs, and this keeps scrubbing frame-accurate), kind-aware threaded cancellable jobs (/api/jobs/*) with polled progress, L* threshold preview overlays, brightest-frame / per-ROI mask scans, audio completion-beep range detection, directory listing for the file picker, and export through the existing CSV/plot pipeline. Exported plot files are served back only from a per-job allowlist; analysis with stale masks 409s instead of silently ignoring them.web/(bun + Vite + React 19 + TypeScript): dark instrument-style UI (users judge faint ECL glows by eye), canvas ROI draw/move/resize with background-region designation, scrubber with analysis-range selection and 0.25×–4× playback speeds, the desktop app's keyboard shortcuts, a Masks panel (jump-to-brightest, capture with per-region provenance/coverage, auto-invalidated on geometry changes), audio range detection with a multi-beep chooser, interactive results chart with crosshair tooltip, inline export with plot previews. ROI/series colors use a CVD-validated categorical palette.ecl-v2spike.Run it:
pip install -e ".[web]",cd web && bun install && bun run build, thenpython -m ecl_analysis.server→ http://127.0.0.1:8765.python main.pyis unchanged.Still deferred: drag-and-drop open (browsers hide file paths; needs an upload path).
Test plan
pytest— 111 pass (12 API tests: open/frame/analyze/cancel/export/fs/mask-scan/masked-analysis/geometry-409/audio)bun run typecheck && bun run test && bun run build— 11 tests passhttps://claude.ai/code/session_01NTGWZgxVNFYjBAcKfZudYj