Jonas c5fd4de09b Implement labeling frontend and the backend support it needs
Add a framework-free HTML/CSS/JS labeling UI: set/session/status
filters, a frame browser, drag-to-draw/move/resize bounding boxes with
a per-set class picker, per-frame status control, and Left/Right frame
navigation. No login - a locally cached username is sent for
attribution only, matching the backend's get-or-create user model.

Backend additions the frontend needed: serve frame images from a
configurable FRAMES_ROOT via a /images static mount, permissive CORS
(internal tool, not publicly exposed), and a GET /sets/{id}/frames
endpoint returning frames joined with their per-set label status
(defaulting missing rows to unlabeled) for the frame browser.

Verified the full call chain end-to-end against a running backend +
static frontend server (set/class creation, frame ingest, image
serving, label CRUD, status updates, CORS preflight) - every field
name the JS reads matches the API responses. 18/18 backend tests
pass. Not yet verified: actual interactive browser use (no browser
tooling available here) - try drag-to-draw/resize locally.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 11:34:26 +02:00

15 lines
471 B
Python

def test_image_is_served_from_frames_root(client, tmp_path):
frames_root = tmp_path / "frames"
frames_root.mkdir(parents=True, exist_ok=True)
(frames_root / "hello.png").write_bytes(b"fake-png-bytes")
resp = client.get("/images/hello.png")
assert resp.status_code == 200
assert resp.content == b"fake-png-bytes"
def test_missing_image_returns_404(client):
resp = client.get("/images/does-not-exist.png")
assert resp.status_code == 404