feat(web): delete manual face from marker toolbar #1169

Merged
chris merged 1 commit from feature/manual-face-toolbar-delete into main 2026-10-12 22:46:25 +02:00
Owner

Follow-up to the manual face bbox feature (docs/superpowers/specs/2026-10-12-manual-face-bbox-design.md).

What this adds

  • Trash button in the marker toolbar, shown only in edit mode (create sessions have no stored marker). Danish label "Slet markering", consistent pill styling, placed left of the red ✕.
  • On click it calls the existing POST /api/discovery/results/{faceAnnotationId}/reject. Success: session ends, face removed from the persons strip (tile + image marker), success toast "Markering slettet." Failure: error toast, toolbar stays open; 409/404 resync the face list via reloadFaces().

Reported "✕ does nothing" in edit mode

Verified code-wise: ✕ was and is correct in BOTH modes — cancelStagedFaceSession() sets stagedFace = null, which unmounts both the toolbar and the overlay ({#if stagedFace} mounts in MediaViewer). The perceived no-op is that ✕ only discards the local draft: the stored marker stays on the image and in the strip, so nothing visibly changes. The delete action is the missing affordance the user was reaching for. A new e2e test additionally proves ✕ closes the toolbar and does NOT hit the reject endpoint.

Wiring

FaceMarkerEditToolbar.svelte (onDelete prop, edit-mode-only button) → MediaViewer.svelte (onFaceMarkerDelete) → MediaDetailViewer.svelte (deleteStagedFaceMarker, guarded to edit mode + not busy).

Test evidence

  • npm run check: 0 errors (18 pre-existing warnings)
  • npm run test:unit: 157/157 passed
  • npm run build then Playwright manual-face-bbox, face-marker-visibility, edit-nav-guard, viewer-tentative-face: 56 passed, 0 failed (desktop + mobile)

New e2e coverage in manual-face-bbox.spec.ts:

  • edit toolbar shows the trash button; create toolbar does not
  • trash click → one POST to the reject endpoint, strip tile + image marker disappear
  • ✕ in edit mode closes toolbar + overlay, face untouched, no reject request
Follow-up to the manual face bbox feature (docs/superpowers/specs/2026-10-12-manual-face-bbox-design.md). ## What this adds - **Trash button in the marker toolbar**, shown only in `edit` mode (create sessions have no stored marker). Danish label "Slet markering", consistent pill styling, placed left of the red ✕. - On click it calls the existing `POST /api/discovery/results/{faceAnnotationId}/reject`. Success: session ends, face removed from the persons strip (tile + image marker), success toast "Markering slettet." Failure: error toast, toolbar stays open; 409/404 resync the face list via `reloadFaces()`. ## Reported "✕ does nothing" in edit mode Verified code-wise: ✕ was and is correct in BOTH modes — `cancelStagedFaceSession()` sets `stagedFace = null`, which unmounts both the toolbar and the overlay (`{#if stagedFace}` mounts in MediaViewer). The perceived no-op is that ✕ only discards the *local draft*: the stored marker stays on the image and in the strip, so nothing visibly changes. The delete action is the missing affordance the user was reaching for. A new e2e test additionally proves ✕ closes the toolbar and does NOT hit the reject endpoint. ## Wiring `FaceMarkerEditToolbar.svelte` (`onDelete` prop, edit-mode-only button) → `MediaViewer.svelte` (`onFaceMarkerDelete`) → `MediaDetailViewer.svelte` (`deleteStagedFaceMarker`, guarded to edit mode + not busy). ## Test evidence - `npm run check`: 0 errors (18 pre-existing warnings) - `npm run test:unit`: 157/157 passed - `npm run build` then Playwright `manual-face-bbox`, `face-marker-visibility`, `edit-nav-guard`, `viewer-tentative-face`: **56 passed, 0 failed** (desktop + mobile) New e2e coverage in `manual-face-bbox.spec.ts`: - edit toolbar shows the trash button; create toolbar does not - trash click → one POST to the reject endpoint, strip tile + image marker disappear - ✕ in edit mode closes toolbar + overlay, face untouched, no reject request
feat(web): delete manual face from marker toolbar
All checks were successful
Wiki Sync / Sync wiki from docs (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 / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Build postgres 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 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 / 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 / Run scoped PR tests (push) Successful in 12m16s
27c3fdfbd1
Add a trash action to the face marker toolbar, shown only in edit mode
(create sessions have no stored marker to delete). It calls the existing
rejectDiscoveryResult endpoint; on success the session ends, the face is
dropped from the strip, and a toast confirms. Failures keep the toolbar
open with an error toast; 409/404 resync the face list.

Note on the reported '✕ does nothing': code-wise ✕ was correct in both
modes (stagedFace=null unmounts toolbar + overlay). The confusion was
that ✕ only discards the local draft — the stored marker stays, which
looks like a no-op. The delete action is the missing affordance; a new
e2e test also proves ✕ closes the toolbar without hitting reject.
chris merged commit 091f5beda6 into main 2026-10-12 22:46:25 +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!1169
No description provided.