feat(web): merge suggestion card redesign + subset merge selection #1006
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/merge-card-redesign"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Was sich ändert
A — Card
Similar to X(Name des Bestandsmenschen),text-xl font-semiboldstatt Klein-Text; der lange Erklär-Satz entfällt komplett (nur Duplikat-/Ambiguitäts-Hinweise bleiben mit eigener Begründung).Merge all(Verhalten unverändert: alle Bilder, kein Subset-Feld im Body).aria-haspopup="dialog") statt direkt den Person-Picker.Reject-/Disband-Footer-Buttons: Semantik unverändert (People-Cluster →disbanded, alle anderen →rejected), gleiche Test-IDs (candidate-disband/candidate-reject).B — Ein Merge-Dialog für alles
N of M selected,Select all/Deselect all,Show more photos(24er-Schritte). Leere Auswahl sperrt alle finalen Aktionen mitSelect at least one photo to continue.Choose a different person…) für Bestands- und Cluster-Cards.New person instead…+ Namensfeld, ButtonCreate new person.accepted+existingInstanceId, Picker-Confirm undcreateNewInstance) senden das Subset.C — API-Vertrag
ClassInstanceCandidateDecisionRequest: neuselectedOccurrenceRefs?: string[] | null,createNewInstance?: booleanexistiert auf main bereits.candidate.occurrenceRefsliefert:faceAnnotationIdbei Face-Refs (type: "face_annotation") → sonstoccurrenceId→occurrenceKey→mediaItemId. 1 Ref = 1 gerenderte Kachel = 1 Face-Vorkommen (mehrere Refs können dieselbemediaItemIdhaben, daher ref- statt media-basiert).null/abwesend = alle Bilder (Rückwärtskompatibilität), leeres Array wird nie gesendet (UI blockiert es). Card-Aktionen ohne Dialog senden das Feld nie.fail-on-unknown-propertieskonfiguriert), bis der Backend-Lane landet.D — Copy
Stash away→Hide person(gleiche Aktion, gleiche Test-IDcandidate-stash/merge-suggestion-stash).StashDisbandSplit.sveltehatte keine Nutzer mehr und wurde entfernt. Merge-Suggestion-Card (Namenspaar) hat dasselbe X (merge-suggestion-disbandbei unnamed Party,merge-suggestion-dismissbei named×named) plusHide person-Button.E — Konflikt-/Ergebnis-Verhalten (finaler Backend-Vertrag)
outcome: "applied"→ normaler Erfolg, Vorschlag weg, kein Fehler.outcome: "all_faces_already_assigned"+state: "rejected"(Zero-Write-Stash) → stiller Erfolg: Vorschlag weg, kein Error, kein Notice.code: "candidate_changed"→ ausschließlich dieser Fall löst den Toleranz-Pfad aus: Card optimistisch entfernt,loadAll(), ruhiger, nach 6 s selbst verschwindender NoticeThis suggestion was outdated — list refreshed.describeApiError.Geänderte Dateien
apps/web/src/lib/api/discovery.ts(Request-/Result-Typen inkl.outcome)apps/web/src/lib/components/DomainSuggestionsCarousel.svelte(Card, Dialog, Auswahl, Konfliktbehandlung)apps/web/src/lib/components/StashDisbandSplit.svelte(gelöscht, keine Nutzer mehr)apps/web/tests/discovery-review.spec.ts(Erwartungen aktualisiert + neue Tests)Testnachweis (
apps/web)npm run check→svelte-check found 0 errors and 22 warnings(Warnings vorab vorhanden)npm run build→ oknpm run test:unit→8 test files, 60 tests passednpx playwright test(voller Suite,CI=1,--workers=4 --retries=0) → 725 passed, 23 skipped, 0 failed, davontests/discovery-review.spec.ts90 passed (desktop + mobile). Ein Zwischenlauf mit 9 Fails in unberührten Specs (accessibility/plants/albums/explore) war Fluke — alle 9 sofort grün mit--last-failed.Merge allohne Subset-Feld,candidate_changed-Notice ohne Rohfehler + nachweisbarer Listen-Reload, 409 ohnecodebleibt sichtbarer Fehler (Card bleibt stehen), sichtbarer 400-Fehler, stillerall_faces_already_assigned-Erfolg,createNewInstance+ Subset bei allen finalen Dialog-Aktionen.CI
88fa82e1: Run 3566 (Scopeweb) → success, Run 3567 (api/worker) korrektskippeddurch die Scope-Erkennung.87f1edb2(nur Konflikt-Vertrag) aktualisiert den PR.Card (A): large "Similar to X" headline as the only headline copy, primary button labelled "Merge all", chevron opens the same detail dialog as the photo grid. The old Reject/Disband footer buttons are replaced by an X icon at the top of the card (44px, mobile reachable, same handlers: disband for people clusters, reject otherwise). Dialog (B): one shared merge dialog now offers photo-subset selection (all selected by default, per-photo checkboxes, select/deselect all, "Show more photos"), changing the merge target (existing picker) and creating a new person. Every final action in the dialog is limited to the selected photos; "Select at least one photo to continue." blocks an empty selection. API (C): ClassInstanceCandidateDecisionRequest gains optional selectedOccurrenceRefs (ids taken from candidate.occurrenceRefs: faceAnnotationId -> occurrenceId -> occurrenceKey -> mediaItemId) and createNewInstance. Dialog actions always send the subset; card actions ("Merge all", X, Hide person) never send it. Absent/null keeps meaning "all", an empty array is never sent. Copy (D): "Stash away" -> "Hide person"; StashDisbandSplit dropped (no remaining usages). Errors (E): 409 with code candidate_changed (or the legacy conflict detail) optimistically removes the card, reloads the list and shows a short "This suggestion was outdated — list refreshed" notice; outcome all_faces_already_assigned stays a silent success; every other failure stays visible. Verified: npm run check (0 errors), npm run build, npm run test:unit (60 passed), full Playwright suite 723 passed / 23 skipped.