Repository navigation
fix(dashboard): arm the close tombstone at confirmed-removal sites - #13902
Conversation
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. [UX-REVIEWED] 3134586 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify issue #11255 actually records the per-site hold as the endorsed interim form — the description claims it, and the issue is the only place that claim lives. What this change shipsInventory (5 items) — 5 justifiedIntent: stop a server-removed chat row from flickering back for one frame at the two removal sites #11225's tombstone missed — a FIX.
Grep [FIRST-PRINCIPLES-REVIEWED] 3134586 |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify a real [DESIGN-REVIEWED] 3134586 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
switchSlot's 404 eviction and the artifact companion close remove a slot the server already confirmed gone, but armed no close hold, so a pre-pop straggler list could re-add the row for a frame. Add armConfirmedCloseHold, which writes the hold straight in its confirmed phase, and dispatch it at both sites. Closes #11255
a26bbb8 to
3134586
Compare
Problem / Motivation
Two places remove a chat row after the server already said the session is gone:
switchSlot's 404 eviction inwebsite/src/store/chatSlice.ts.website/src/pages/ArtifactDetailPage.tsx.Neither arms the close tombstone that #11225 added. A slot list built before the server dropped the row can still land after the removal. That list puts the row back for one frame, and the next list removes it again.
Why it matters
The sidebar flickers a dead session back in. #11225 fixed this for
deleteSlot. These two sites are the siblings it left open.What changed (motivation → approach → change)
Symptom: a removed row blinks back for one frame. Cause: only
deleteSlot.pendingwrites a hold intoclosingSlots, and these two sites have nodeleteSlotlifecycle to hang one on.Approach: the issue's per-site form. A new reducer,
armConfirmedCloseHold(key)inwebsite/src/store/dashboardSlice.ts, writes the hold straight into its confirmed phase. It reuses the same budget as a confirmeddeleteSlot:CLOSE_CONFIRMED_GRACE_FRAMESlists, theCLOSE_CONFIRMED_MAX_MSwall-clock cap, and thefetchSlotsrequests in flight at that moment. Both sites dispatch it right beforeremoveSlotOptimistic.The hold's
requestIdis a fixed'confirmed'marker. NodeleteSlotlifecycle action ever matches it, so only the budget retires it.addSlotOptimisticfor the same key still clears it, as for any hold. The server-generation redesign discussed on the issue is not attempted here. The close-tombstone paragraph indocs/system-specs/modules/learn-cron-dashboard.mdnow describes these two sites as armed.Backwards compatibility
Compatible: adds one reducer; no existing action, state shape or API changes.
Tests
website/src/test/dashboardSlice.closeTombstone.test.ts: the new hold survives three straggler lists and then yields to membership; it outlives afetchSlotsalready in flight; a same-key re-add clears it; prototype keys are refused.website/src/store/chatSlice.switchSlotRejection.test.ts: the announced 404 eviction dispatchesarmConfirmedCloseHoldthenremoveSlotOptimistic.website/src/test/ArtifactDetailPage.companionChat.test.tsx: after "New chat", a straggler frame listing the archived key does not bring it back.Red-before: with the two site dispatches removed, both site tests fail; with them in, all 98 tests in the three files pass.
tsc -p tsconfig.app.jsonandeslint --max-warnings 0on the changed files are clean.Manual verification
N/A — unit coverage sufficient: the race is between reducer actions, which the tests drive directly.
Screenshots / video
Why no screenshot: the fix removes a one-frame reappearance; no steady-state pixels change.
Related Issues
Closes #11255
Pattern harvest
Not generalizable: the general form (server-stamped list generations) is already tracked on #11255 as the preferred follow-up direction.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)