fix(web): grid refresh after suggestion decisions no longer flashes skeletons #1439

Open
chris wants to merge 2 commits from fix/suggestion-grid-skeleton-flash into main
Owner

Problem

Every Accept/Reject (and merge) in the suggestions carousel refetches the people grid below it. That refetch flipped loading = true, which swaps the whole grid for the 12-tile pulsating skeleton row until the response lands — person thumbnails + labels blink away and back on every decision. The carousel itself already behaves correctly (optimistic card removal + silent re-sync, no flash); only the grid refresh below was never ported to that pattern.

Fix (DiscoveryDomainInstances.svelte, one component)

  • refetchInstances (with loading flip) → silentRefetchInstances: same coalescing (one fetch in flight, one queued trailing rerun) and same parallel stashed listing, but it never touches loading/error. The keyed grid re-renders in place from the fresh list, so existing cards keep their mounted DOM and images until the new list swaps in.
  • Used by the carousel onchanged path and the two stashed-action error fallbacks (previously refetchInstances).
  • A failed silent refresh keeps the last good grid (the next decision or thumbnail-pending signal retries it); the initial-load error surface is untouched.
  • Search typing and the initial page load keep their old behavior (skeleton stays for genuinely empty first loads).

Verification

  • svelte-check: 0 errors, same 20 pre-existing warnings as baseline.
  • tests/discovery-domain-instances.spec.ts + tests/discovery-stashed-people.spec.ts: 25/25 green.
  • Full tests/discovery-review.spec.ts (95 tests incl. the carousel decision flows): green.
  • New regression test accepting a card never swaps the people grid to the skeleton row: holds the post-decision refetch back and asserts the grid card stays visible with zero .animate-pulse nodes. Proven red against the old behavior (reintroduced loading = true on a fresh build → test fails exactly at the skeleton assertion), green with the fix.

Notes

  • Runs 5937/5939 (Daily Full Tests / PR tests on main) flaked in PersonRelationServicePostgresTest (unrelated, API) — logged as ISSUE-222 in the second commit.
## Problem Every Accept/Reject (and merge) in the suggestions carousel refetches the people grid below it. That refetch flipped `loading = true`, which swaps the whole grid for the 12-tile pulsating skeleton row until the response lands — person thumbnails + labels blink away and back on every decision. The carousel itself already behaves correctly (optimistic card removal + silent re-sync, no flash); only the grid refresh below was never ported to that pattern. ## Fix (`DiscoveryDomainInstances.svelte`, one component) - `refetchInstances` (with `loading` flip) → `silentRefetchInstances`: same coalescing (one fetch in flight, one queued trailing rerun) and same parallel stashed listing, but it never touches `loading`/`error`. The keyed grid re-renders in place from the fresh list, so existing cards keep their mounted DOM and images until the new list swaps in. - Used by the carousel `onchanged` path and the two stashed-action error fallbacks (previously `refetchInstances`). - A failed silent refresh keeps the last good grid (the next decision or thumbnail-pending signal retries it); the initial-load `error` surface is untouched. - Search typing and the initial page load keep their old behavior (skeleton stays for genuinely empty first loads). ## Verification - `svelte-check`: 0 errors, same 20 pre-existing warnings as baseline. - `tests/discovery-domain-instances.spec.ts` + `tests/discovery-stashed-people.spec.ts`: 25/25 green. - Full `tests/discovery-review.spec.ts` (95 tests incl. the carousel decision flows): green. - New regression test `accepting a card never swaps the people grid to the skeleton row`: holds the post-decision refetch back and asserts the grid card stays visible with zero `.animate-pulse` nodes. **Proven red** against the old behavior (reintroduced `loading = true` on a fresh build → test fails exactly at the skeleton assertion), green with the fix. ## Notes - Runs 5937/5939 (Daily Full Tests / PR tests on main) flaked in `PersonRelationServicePostgresTest` (unrelated, API) — logged as ISSUE-222 in the second commit.
Accepting/rejecting a suggestion-card decision (or a stashed-action error
fallback) refetched the people grid with `loading = true`, swapping every
person thumbnail + label for the 12-tile pulsating skeleton row until the
response landed — a visible blink on every single decision.

The carousel itself already removes its card optimistically and re-syncs
silently ("no skeleton flash"); the grid below now does the same:
`silentRefetchInstances` keeps the keyed grid mounted, so Svelte 5
re-renders it in place and existing cards never remount. Coalescing
(one in flight + one queued trailing rerun) and the parallel stashed
listing are unchanged. A failed silent refresh keeps the last good list
(initial-load errors remain the only error surface).

Regression test: while the post-decision refetch is held back the grid
card must still be visible with zero `.animate-pulse` nodes — red with
the old behavior (asserted on a fresh build), green now.
docs(known-issues): log ISSUE-222 — flaky PersonRelationServicePostgresTest representative assertion (run 5937)
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 plants 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 postgres image (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (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 / 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 / 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 / Deploy review instance (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 14m4s
39b0bf0c9d
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 plants 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 postgres image (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (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 / 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 / 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 / Deploy review instance (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 14m4s
This pull request has changes conflicting with the target branch.
  • KNOWN_ISSUES.md
  • apps/web/tests/discovery-review.spec.ts
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin "fix/suggestion-grid-skeleton-flash:fix/suggestion-grid-skeleton-flash"
git switch "fix/suggestion-grid-skeleton-flash"
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!1439
No description provided.