Repository navigation
fix(members): hold the driving-sessions order across slots frames too - #9728
Conversation
The sibling of the roster order fix, in the same file and with the same cause. `drivingSessions` sorted the live WS `liveSlots` by `lastActivityEpoch` on every render, and that list refreshes on every slots frame while the sort key advances whenever a worker does anything -- so a frame landing between the reader aiming at a row and clicking it moved the row, and each row is a `navigate()` into that session. A shifted row opens the WRONG session. The order also decides which rows sit behind the DRIVING_VISIBLE fold, so a live re-sort can pull a row out from under the pointer entirely. The order is now committed per DRIVEN SET, keyed by member: it re-sorts from scratch when the set of driven slot keys changes (a worker opens or closes) or when the active member changes, and otherwise maps the committed key order over the fresh slots. Status dot, title and timestamp keep updating from every frame; only the positions hold. Refs kirodotdev#9524
UX Review (Fable 5, fork) — ✅ PASSUX-level review of Reconciliation complete: the diff changes no user-visible control, label, string, or markup — the same rows render with the same classes; only the timing of reorders changes (held until the driven set or member changes, matching the committed-order idiom the roster already uses at UX-Verdict: PASS Rows stop shifting under the pointer mid-click; no control, string, or pixel changes, and the fix mirrors the roster's already-shipped ordering idiom. [UX-REVIEWED] 40f3415 |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Verified against the base file: the diff mirrors the committed-order idiom already shipped for the roster ( Design-Verdict: PASS Same root cause, same accepted idiom as the roster fix one panel up, correctly member-keyed, with a mutation-proven regression test. [DESIGN-REVIEWED] 40f3415 |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of All lenses run clean. Writing the review. First-Principles-Verdict: PASS Verify the mutation claim by running the new test against base — "1 failed / 81 passed" is author-asserted and unrunnable from this checkout. What this change shipsInventory (4 items) — 4 justifiedIntent: stop live activity frames from moving the driving-sessions rows a reader is about to click — a FIX.
The defect has checkable provenance: the #9537 roster fix and its identical rationale sit in the same file ( [FIRST-PRINCIPLES-REVIEWED] 40f3415 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
iamwhatever
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: the members drawer sorted its driving-sessions list on every WS slots frame, so a row moved under the pointer mid-click and navigated into the wrong session; the order is now committed per driven set and re-sorts only when a worker opens/closes or the member changes, while row content still updates per frame. CodeQL is not applicable on this fork PR (default-setup emits no check-run); SAST coverage is Semgrep only, latest run success with 0 annotations.
…kirodotdev#9728) The sibling of the roster order fix, in the same file and with the same cause. `drivingSessions` sorted the live WS `liveSlots` by `lastActivityEpoch` on every render, and that list refreshes on every slots frame while the sort key advances whenever a worker does anything -- so a frame landing between the reader aiming at a row and clicking it moved the row, and each row is a `navigate()` into that session. A shifted row opens the WRONG session. The order also decides which rows sit behind the DRIVING_VISIBLE fold, so a live re-sort can pull a row out from under the pointer entirely. The order is now committed per DRIVEN SET, keyed by member: it re-sorts from scratch when the set of driven slot keys changes (a worker opens or closes) or when the active member changes, and otherwise maps the committed key order over the fresh slots. Status dot, title and timestamp keep updating from every frame; only the positions hold. Refs kirodotdev#9524 Co-authored-by: LuisBrel <193017400+LuisBrel@users.noreply.github.com>
Problem / Motivation
Follow-up to the review of #9537, which counted this sibling in the same file:
drivingSessionsinwebsite/src/pages/members/MembersPage.tsxsorted the liveWebSocket
liveSlotsbylastActivityEpochon every render.That list refreshes on every slots frame, and the sort key advances whenever a
worker does anything, so a frame landing between the reader aiming at a row and
clicking it moves the row. Each row is a
navigate()into that session, so ashifted row opens a DIFFERENT session than the one that was under the pointer.
The order also decides which rows sit behind the
DRIVING_VISIBLEfold, so alive re-sort can remove the aimed-at row from the visible list entirely.
Why it matters
Same class and same consequence as the roster defect #9537 fixed -- a click that
lands somewhere the reader did not choose -- and it needs no unusual conditions:
one active worker session is enough, because a working member emits frames
continuously. #9537 fixed the roster one panel over and left this one, which the
First Principles lane flagged as the counted unfixed sibling.
What changed (motivation -> approach -> change)
Root cause: the display order was a function of frame timing rather than of the
list's contents.
The order is now committed per DRIVEN SET, keyed by member: it re-sorts from
scratch when the set of driven slot keys changes (a worker opens or closes) or
when the active member changes, and otherwise maps the committed key order over
the fresh slots. Row CONTENT still updates from every frame -- status dot, title,
timestamp -- so nothing about liveness is lost; only positions hold.
Keying by member as well as by key-set matters: the list is per active member and
the fold is keyed to the member, so a bare key-set comparison would try to map
one member's committed order onto another member's slots on a switch.
Deliberately the same idiom as the roster fix rather than a new mechanism, so the
two sit side by side in one file and read as one rule.
Tests
a slots frame never reorders the list; a change to the driven set re-sorts itin
website/src/pages/members/MembersPage.test.tsx: a frame that makes the lowerrow both the most recently active AND running must update its status dot in place
while the order holds, and a newly opened worker must re-sort the whole list by
recency. The existing
newest activity firstcase still passes, so the firstframe's ordering is unchanged.
Mutation-proven: with the previous per-render sort restored, the new test fails
(1 failed / 81 passed); with the fix, 82 passed.
npx eslinton both changed files exits 0.npx tsc -breports the same 30errors before and after my change (0 new) -- all in
PasteTokenNode.tsx, from anincomplete local install:
npm cifailsE401against the package registryconfigured on this machine, so the lexical packages are absent. Nothing in that
set touches the members page.
Manual verification
N/A -- the defect is a race between a WebSocket frame and a click, which the test
reproduces deterministically by dispatching a frame between assertions.
Screenshots / video
Why no screenshot: there is no visual delta. No styling, layout, markup or
component change -- the same rows render with the same classes, and the first
paint is byte-identical because the first frame still sorts by recency. What
changes is purely temporal: whether a later frame may reorder them. A still of
before and after is identical, and the regression test is what demonstrates the
behaviour.
Related Issues
Refs #9524
Follows up the First Principles review on #9537
Pattern harvest
Rule candidate: review-prompt
Pattern: an activity-keyed sort over live-refreshing data, feeding rows that are
click targets. The sort key advancing is indistinguishable from the list
changing, so ordering becomes a function of refresh timing -- and when each row
navigates, that turns a background refresh into a misroute. Worth asking wherever
a live list is sorted by a timestamp that the live data itself moves.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)