fix(web): stale sibling cards degrade quietly, dialog quality % on ambiguous, honest conflict count #1056
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/web-stale-sibling-cards"
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?
Two layers against stale sibling cards (pending duplicates minted before the API mint-guard in #1055), plus two copy/consistency fixes.
1. Silent re-sync after every successful decision
DomainSuggestionsCarousel.sveltegainsresyncCandidates(), called first fromafterDecision()(so it covers every decide path: accept, reject, stash, disband, merge-into-existing, merge picker, merge-card actions):overlapRejections→markCandidateDecidedIfPending), and the sibling then disappears without user action;loadingflag (no skeleton), no list reset, existing cards never remount, scroller position untouched;requestId(owned byloadAll) so a concurrent full reload always wins; a failed re-sync never disturbs the working set.2. Stale decision failures degrade quietly
handleDecisionConflict→handleStaleDecisionFailure. Besides the existing 409code: "candidate_changed", a 400 whose detail is a candidate not-found ("Pending class-instance candidate not found" / "Class-instance candidate not found for current owner") now means "this card no longer exists":3. Detail dialog omits the quality % on ambiguous cards
Same rule and same reasoning comment as the card (the figure describes only the closest match and would contradict the "may include more than one person" copy).
4. Honest multi-person count
conflictingPersonIdsincludes the suggested target (ADR 0101), so the count now subtracts it only when the target id is actually present (never below 0), and the wording drops the overstated claim:Tests
4 new Playwright tests + 2 extended in
apps/web/tests/discovery-review.spec.ts:conflictingPersonIdswith 3 ids incl. target → "2 other named people…" (+ no-target card: 1 → "Another…", 3 → "3 other…").All 6 fail without the component fix (verified by stashing it), pass with it.
Verification:
npm run check→ 0 errors; fullnpm test(Playwright, desktop + mobile) → 810 passed / 0 failed (1 unrelated flaky inembedding-map.spec.ts, passed on retry);npm run test:unit(vitest) → 66/66.Web-only — no version bump (same as #1054), no API/spec/KNOWN_ISSUES changes. Not merged; needs review.