You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 13171fd
Browse filesBrowse the repository at this point in the historyBrowse files
test(desktop): stop four E2E specs racing scroll settles and focus
Units 2-5 of the 23-30 Oct desktop Playwright flake audit. All four are
test-only. origin/main (1eb67bb, now including #8680) hasn't touched
these specs since fae3f03. Of the open PRs, #8622 adds an unrelated
test at the end of navigation.spec, and #7812 (stale since 10-06) adds
tests elsewhere in three of them. #8680 didn't touch them, but it
carried navigation:472 mode A's product half (eb88a98), which is not
part of this commit. The code confirms each cause, so none is dropped.
navigation.spec.ts:472, "composer Buzz chip labels wrap without
orphaning their icons"
Runs: 11 jobs in the window, 6 after the earlier fixes, and 4 of the 7
main runs that carry every fix. Run 40970053997 (Smoke shard 7) failed
all three attempts.
Mode A: jobs 122971493553, 123066839967, 123572467962, 123819180597
and retry 2 of 123784825042. Signature: fragmentStep is null at :634.
Cause: rows key on renderKey = localKey ?? id. On main,
reconcileChannelWindowMessages keeps only pending sends and thread
replies from the cache, so a head refetch or live echo after the ack
drops the localKey. The key flips and the row remounts, losing the
220 px width the test set in an earlier evaluate.
Change: re-land the test half of closed PR #6852, which never merged.
Set the width and measure in one expect.poll, and set the width again
before each fragment measurement.
Mode B: jobs 123573056202, 123784199542, 123784825042 (twice),
123804428893, 123818728963, 123819543461, and 122924164125 (the
Infinity variant). Signature: the |tooltipCenter - cursorX| < 1 poll
at :667 receives 81.35 or Infinity. In failing attempt 40970053997 the
post-send settle (scrollTop 200, 296, 260, 302) took its last step
21 ms or less before focus, and the tooltip read closed 12 ms after
it. In the passing retry 40980513346, scrolling had stopped at least
15 ms before focus.
Cause: Radix Tooltip 1.2.16 closes when an ancestor of its trigger
scrolls (a capture-phase window listener). Reopening by pointer needs
a pointermove while hasPointerMoveOpenedRef is false, then the chip
provider's 500 ms delay. Any close clears that timer, and only
pointerleave resets the flag. useInlineTooltipPosition moves the
content only on pointermove and placement. So a scroll after focus can
leave the tooltip closed, or open without the fragment offset, and the
spec's single mouse.move never recovers it.
Change: before focusing the chip, poll until the timeline sits at its
floor (scrollHeight - clientHeight - scrollTop <= 1) at the start of
one poll, is still there two animation frames later, and its scrollTop
hasn't moved. Waiting only for scrollTop to hold for two frames isn't
enough: a timeline whose settle hasn't started yet reads as still, and
the failing run's last step landed under two frames before focus. The
settle's end state is the floor. useVirtualizedBottomSettle scrolls
only when Virtua's ResizeObserver reports a layout change, and after
the send and the 220 px wrap the timeline sits short of the floor
until the settle catches up. Focusing the chip and moving the pointer
over it don't change layout. The send's ack does. It removes the row's
"Sending…" status, and the confirmed row can lose its header, since a
pending row is never shown as a continuation (MessageRow.tsx:167). The
send's bottom intent is still armed, so that re-pins the timeline. So
before the floor poll, wait for the sent row's message-send-status to
reach count 0. If the ack has already landed, that wait is a no-op. The
standalone toBeVisible after focus is gone. positionOverFragment
asserts data-state matches /open/ instead, because a closing tooltip
stays visible through its exit animation.
No retry. Wrapping the measure, move and check in toPass, leaving and
re-entering the chip on each attempt, would also pass, but it retries
around the race instead of removing it. The ack and floor waits close
the scroll window. The only other way to scroll under the tooltip was a
remount that drops the row's 220 px width (mode A), and #8680's
retainAcknowledgedLocalKeys, on this branch's base (1eb67bb), keeps
the row's key. So positionOverFragment is a single pass, as on main,
plus mode A's width re-set: set the width, measure, move, assert open,
then poll the centre with the default timeouts.
huddle-transcription.spec.ts:637, "animates the responding agent with
the shared speaker ring"
Runs: 9 jobs, always Smoke shard 4 attempt 1. Main: 39896948198,
40718743531, 40732061485, 40840949170, 40906253761, 40969965981 and
40983029157. PRs: #8715, #8666. Signature: toBeFocused() at :697
reads inactive for all 14 polls over 5 s. At +3.0 s in the failure
video (40983029157, job 123827818084) the caret is in
"Message #huddle".
Cause: useComposerAutofocus re-runs when `focus` changes. That's
focusEnd, which depends on the editor, so it runs again once the
editor mounts. It backs off only for input, textarea, select and
contentEditable focus, so it takes focus from the focused trigger.
Change: wait for message-input to be focused before focusing the
trigger. The same spec already does this at :855.
scroll-history.spec.ts:1289, "fast middle-page scroll settles with
continuous mounted coverage"
Runs: 9 jobs in the window. After the fixes: main 40980404335 (Smoke
shard 9, job 123819180518), two attempts on #8720, and the
brain/native-account-setup branch. Signature: the viewportCoverage
poll expects < 100 and receives 200. The failure screenshot shows the
timeline at the floor. The 200 px is the bottom spacer
(--composer-overlay-height) under the last row.
Cause: TimelineMessageList arms useVirtualizedBottomSettle when the
channel first positions. Its ResizeObserver then pins to the floor
until listenForReaderScroll input or an accepted target cancels it.
handleScroll deliberately doesn't cancel, and a prepend delta doesn't
settle, so the intent survives the prepend and the spec's scrollTop
writes. Virtua's re-measure after the jump pulls the list back down.
Change: before the fast scroll, hover the timeline and wheel up 120 px.
Then poll until it is more than 32 px from the floor (the timeline's
at-bottom band) and scrollTop holds for two frames, so the writes stay
the last scroll.
custom-emoji.spec.ts:370, "reacting with a custom emoji renders via
the loopback media proxy"
Runs: main 40787609859 (10-28), main 40983029157 (Smoke shard 3, a
run with every fix), and #8241 (agent and auth files only). Signature:
the poll at :453 expects the inline "Add reaction" opacity "0" and
receives "1". The error context marks button "Open reactions"
[active].
Cause: the non-modal Radix Popover returns focus to its trigger when
the picker closes. FocusScope does that in a setTimeout(0) after the
content unmounts, and the content unmounts after its 100 ms exit
animation. That can land after the spec's blur. The action bar is
hidden by opacity only, so the trigger takes focus, and
group-focus-within/message keeps the button visible.
Change: wait for the "Open reactions" trigger to be focused, then
blur. The note suggested waiting for em-emoji-picker to reach count 0.
That still leaves the setTimeout window open. Focus reaches the
trigger only after unmount, so this wait covers both.
Verification
Not run locally: the Flake Check lane will repeat the touched specs.
pnpm typecheck and pnpm check pass. biome's 3 warnings are in
untouched files. An ad hoc tsc ran over the four specs, using the
desktop tsconfig with only those files, and over HEAD's copies of
them. Both gave the same error counts: navigation 7, huddle 17,
scroll-history 0, custom-emoji 2. The messages are identical once
line numbers are stripped, and all are pre-existing: no Node types,
findLast against the ES2022 lib, and the leadingBounds narrowing at
navigation:576. With the floor wait in place and the retry dropped,
navigation still gives the same 7.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>
0 commit comments