feat(api): expose per-face boundingBox on carousel candidate refs #1053
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/carousel-face-zoom-api"
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?
What
Adds the contracted
boundingBoxfield to every face-annotation ref of the suggestions-carousel candidates listing (GET /api/discovery/domains/{domainKey}/class-instance-candidates), so the carousel can zoom to the face like the people page's "Vis område" mode.The enrichment already existed for
mediaItemId/thumbnailUrl/scope(withEvidencePreviewEnrichment→enrichEvidenceRefs); this extends it:boundingBox: {x, y, width, height}(numbers, normalized 0..1, same values asdiscovery_results.scope) is written from the same batched lookup — no extra query, no N+1 (onediscovery_resultsscope query + one media query per listing).occurrenceRefsandrepresentativeEvidence(the shared enrichment walks both arrays).boundingBoxkey at all (absent, not null), matching the existing "no null fields added" convention; unresolvable refs stay untouched.boundingBox(camelCase).Compatibility note
scope(same values, snake_case) was already shipped to this view by commit20abc0b5and is consumed byapps/web; it is kept unchanged —boundingBoxis purely additive and always mirrorsdiscovery_results.scope. The shared enrichment also runs ontentativeCandidates(people page), where the new field is additive alongside the existingrepresentativeBboxview field; that behavior is otherwise unchanged.Scope
apps/apionly:ClassInstanceDiscoveryService+ its test +gradle.properties(1.21.68 → 1.21.69).apps/web, no KNOWN_ISSUES/specs.Tests
rtk ./gradlew :apps:api:test→ BUILD SUCCESSFUL, 1573 tests, 0 failures/errors, 9 pre-existing skips.New
candidateEvidenceRefsCarryBoundingBoxFromDiscoveryScopeasserts:boundingBox(andscope) inoccurrenceRefsandrepresentativeEvidenceof thecandidatesPagedprojection the endpoint serves;CountingJdbcClientbatching guard: exactly 1 scope query + 1 media query for the whole listing despite multiple candidates/refs (no N+1).The suggestions-carousel candidates listing (GET /api/discovery/domains/{domainKey}/class-instance-candidates) already enriches face-annotation refs with mediaItemId, thumbnailUrl and the normalized scope box, but the parallel carousel face-zoom lane is contracted on the camelCase field name boundingBox. - enrichEvidenceRefs now writes boundingBox alongside scope from the SAME batched discovery_results lookup (one scope query + one media query per listing, no N+1), on refs in both occurrenceRefs and representativeEvidence. - Faces whose scope is unusable/absent keep the existing convention: no boundingBox key at all (absent, not null); unresolvable refs stay untouched. - scope (shipped by the original zoom lane, consumed by apps/web) is kept unchanged, so both fields carry identical normalized values. - Adds a listing test covering both arrays, the absent-box case, and a CountingJdbcClient batching guard. - Bumps memoriesVersion to 1.21.69.