feat(web): zoom suggestion-carousel face tiles onto the face box #1046
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/carousel-face-bbox"
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?
Problem
Suggestion-carousel face thumbnails showed the whole photo instead of zooming onto the face (user request: same framing as the people page's "Vis område" toggle).
Root cause
enrichEvidenceRefsonly enriched refs withtype: "face_annotation", butdiscovery_peoplerefs historically carry justmediaItemId+ face id (notype) — those fell into the else branch and got the whole-photo/derived/thumbnailURL, short-circuiting the client's face-crop builder.scope, so even a client-built URL had nothing to zoom with.Fix (additive both sides)
Backend (
ClassInstanceDiscoveryService):isFaceEvidenceRef(): declared type trusted when present, else face id ⇒ face (mirrors clientrefIsFace/occurrenceType()).scopeByFaceAnnotationIds(): batcheddiscovery_results.scopelookup (same filters asrepresentativeBboxByMediaItem:state <> 'superseded',lifecycle_state = 'active'),putIfAbsent("scope", …)in the face branch — purely additive, existing fields untouched.Web:
refPreview(): bbox present ⇒ whole-photo/derived/thumbnailzoomed viaScopedInstanceThumbnail(the people-page helper family) — bbox wins because it delivers the "Vis område" framing deterministically without the historically-absent face-crop asset (ISSUE-029: 0/16411 faces havethumbnail_derived_asset_id). No bbox ⇒ unchanged face-crop → derived → null chain.refIsFacetreats type-less refs with a face id as faces.ScopedInstanceThumbnail: optionaldataTestIdpassthrough socandidate-tilesurvives.Tests
discovery-review.spec.tstest: bbox ref renders/derived/thumbnailwith crop style, sibling without box keeps face crop with empty style, zero face-crop requests, same assertions onsuggestion-detail-crops.scope).:apps:api:testBUILD SUCCESSFUL.Version
gradle.properties1.21.66 → 1.21.67 (API-touching).Card tiles and detail-dialog crops showed the whole photo whenever a candidate ref's thumbnailUrl fell through to `/derived/thumbnail`, so the intended face was often unidentifiable. - api: `enrichEvidenceRefs` now detects face evidence the way `occurrenceType()` documents it — type-less discovery_people refs that carry a face id no longer fall into the whole-photo branch — and additively enriches face refs with `scope`, the normalized `discovery_results` face box (one extra batched query per listing, no N+1). - web: `refPreview()` resolves each ref into {croppedUrl, plainUrl, bbox}; card tiles and detail-dialog crops both render through `ScopedInstanceThumbnail`, so a ref with a box zooms the whole photo onto the face (same result as the people page "Vis område" toggle) while refs without a box keep their server face crop. - ScopedInstanceThumbnail gains an optional `dataTestId` passthrough. Bumps memoriesVersion to 1.21.67 (origin/main already moved to 1.21.66).