feat(web): manual face bbox drawing + editing toolbar #1164

Merged
chris merged 2 commits from feature/manual-face-bbox-frontend into main 2026-10-12 22:01:21 +02:00
Owner

Frontend half of the manual face bbox feature (design spec: docs/superpowers/specs/2026-10-12-manual-face-bbox-design.md).

What this adds

  • Plus card in the persons strip (always visible) to start drawing a manual face bbox.
  • Draw / move / resize overlay over the viewer image, with a confirm/cancel toolbar (✓ / ✕). No auto-save on pointer release — scope is staged locally until ✓.
  • Edit badge on faces with manual: true (auto-detected faces untouched).
  • Scope is clamped (min edge 0.05, normalized 0–1) and sent as normalized coordinates.

API contract (implemented, pending the parallel backend PR)

  • POST /api/media/{mediaItemId}/discovery/faces with body {"scope":{x,y,width,height}}
  • PATCH /api/discovery/faces/{faceAnnotationId}/scope with body {"scope":{x,y,width,height}}
  • FaceAssignmentView gains manual: boolean

New helpers: createManualFace, updateFaceScope in apps/web/src/lib/api/discovery.ts.

Test evidence

  • npm run check (svelte-check): 0 errors.
  • npm run test:unit (vitest): 133 passed (incl. new mediaUtils face-scope/clamp/draft-style tests).
  • Playwright: manual-face-bbox.spec.ts + face-marker-visibility, edit-nav-guard, viewer-tentative-face, plant-marker-move, timeline → 138 passed, 0 failed, 11 skipped.

The new e2e spec mocks the two endpoints via page.route (the preview server has no API proxy) but asserts method, URL, and request body to lock the backend contract. Assertions that hit the real endpoints await the backend PR.

Note for review

showPersonsSection gating is unchanged, so the plus card is only reachable when the persons strip renders (faces exist or people overlays). Flagged for orchestrator decision — see task notes.

Frontend half of the manual face bbox feature (design spec: docs/superpowers/specs/2026-10-12-manual-face-bbox-design.md). ## What this adds - **Plus card** in the persons strip (always visible) to start drawing a manual face bbox. - **Draw / move / resize overlay** over the viewer image, with a confirm/cancel toolbar (✓ / ✕). No auto-save on pointer release — scope is staged locally until ✓. - **Edit badge** on faces with `manual: true` (auto-detected faces untouched). - Scope is clamped (min edge 0.05, normalized 0–1) and sent as normalized coordinates. ## API contract (implemented, pending the parallel backend PR) - `POST /api/media/{mediaItemId}/discovery/faces` with body `{"scope":{x,y,width,height}}` - `PATCH /api/discovery/faces/{faceAnnotationId}/scope` with body `{"scope":{x,y,width,height}}` - `FaceAssignmentView` gains `manual: boolean` New helpers: `createManualFace`, `updateFaceScope` in `apps/web/src/lib/api/discovery.ts`. ## Test evidence - `npm run check` (svelte-check): 0 errors. - `npm run test:unit` (vitest): 133 passed (incl. new mediaUtils face-scope/clamp/draft-style tests). - Playwright: `manual-face-bbox.spec.ts` + `face-marker-visibility`, `edit-nav-guard`, `viewer-tentative-face`, `plant-marker-move`, `timeline` → **138 passed, 0 failed, 11 skipped**. The new e2e spec mocks the two endpoints via `page.route` (the preview server has no API proxy) but asserts method, URL, and request body to lock the backend contract. Assertions that hit the real endpoints await the backend PR. ## Note for review `showPersonsSection` gating is unchanged, so the plus card is only reachable when the persons strip renders (faces exist or people overlays). Flagged for orchestrator decision — see task notes.
feat(web): manual face bbox drawing + editing toolbar
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 7m15s
737a622813
Add a plus card in the persons strip to draw a manual face bbox, a
drag/resize overlay with confirm/cancel toolbar (no auto-save), and an
edit badge on manual faces. Scope is clamped (min edge 0.05, 0-1) and
sent as normalized coords via POST /media/{id}/discovery/faces and
PATCH /discovery/faces/{id}/scope.

E2E mocks the endpoints via page.route to lock the request contract;
full end-to-end behavior awaits the parallel backend PR.
feat(web): show Persons section for owned media even with no faces
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 5m22s
0ecf70f417
Per decision 'Sektion immer für Owner': extend showPersonsSection so the
header, strip, and manual-add plus card render for media the current user
can edit even when there are zero faces and no people overlays. Hidden
for viewers and non-owned media (unchanged).

Update three timeline.spec.ts assertions that expected the Persons heading
absent for owned media with no faces; they now expect it present plus the
plus card. Non-owned cases keep asserting absence.
chris merged commit 2628d17401 into main 2026-10-12 22:01:21 +02: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
chris/memories!1164
No description provided.