fix(web): keep face-suggestion thumbnails person-accurate #1250

Merged
chris merged 1 commit from fix/face-suggest-perf-thumbs into main 2026-10-16 00:20:12 +02:00
Owner

Fixes three related defects in the face-assignment dialog (Person zuweisen):

  1. Person-accurate rows: the suggestion list was rendered with an unkeyed {#each}, so rows were positionally reused and a row could keep showing the previous list's face. Rows are now keyed by instanceId.
  2. No stale-bitmap flash: browsers keep the previous bitmap visible until a new src decodes; ThumbnailImage only hid the image while 'pending'/'exhausted', not 'loading'. Added an opt-in hideWhileLoading prop, used only by the dialog rows (timeline/people keep their progressive-loading behavior).
  3. Stale-response hole: refreshFaceDialogState() applied a refreshed suggestion list without invalidating in-flight fetches, so a slow debounced loadFaceSuggestions could clobber the fresher list. It now bumps faceSuggestionRequestId and guards its own response with the captured id.

Also requests the small face rendition (?size=256, same convention as explore/shared-people; the backend face-thumbnail endpoint honours size, normalized to 256/512) for the 48px dialog rows instead of the widest/pointer asset.

Tests: new Playwright case in timeline.spec.ts asserting row N shows row N's own representativePreviewUrl (+size hint) and that a refetched list leaves no previous row's image src behind; vitest coverage for faceSuggestionThumbnailUrl and the hideWhileLoading SSR contract.

Fixes three related defects in the face-assignment dialog (Person zuweisen): 1. **Person-accurate rows**: the suggestion list was rendered with an unkeyed `{#each}`, so rows were positionally reused and a row could keep showing the previous list's face. Rows are now keyed by `instanceId`. 2. **No stale-bitmap flash**: browsers keep the previous bitmap visible until a new src decodes; ThumbnailImage only hid the image while 'pending'/'exhausted', not 'loading'. Added an opt-in `hideWhileLoading` prop, used only by the dialog rows (timeline/people keep their progressive-loading behavior). 3. **Stale-response hole**: `refreshFaceDialogState()` applied a refreshed suggestion list without invalidating in-flight fetches, so a slow debounced `loadFaceSuggestions` could clobber the fresher list. It now bumps `faceSuggestionRequestId` and guards its own response with the captured id. Also requests the small face rendition (`?size=256`, same convention as explore/shared-people; the backend face-thumbnail endpoint honours `size`, normalized to 256/512) for the 48px dialog rows instead of the widest/pointer asset. Tests: new Playwright case in timeline.spec.ts asserting row N shows row N's own representativePreviewUrl (+size hint) and that a refetched list leaves no previous row's image src behind; vitest coverage for `faceSuggestionThumbnailUrl` and the `hideWhileLoading` SSR contract.
fix(web): keep face-suggestion thumbnails person-accurate
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 3s
Build and Deploy / Build postgres image (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 / 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 Android CI image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build people 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 / Deploy API (push) Has been skipped
Build and Deploy / Build web 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 / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 13m46s
0b115b91fa
chris merged commit 632a9cad2d into main 2026-10-16 00:20:12 +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!1250
No description provided.