Repository navigation
test(desktop): click a mounted rail in the retry-while-filtered story - #6020
Merged
Merged
Conversation
RetryWhileWorkFiltered clicked the first .workhub-message-rail right after the send failed. The send follows the latest Turn, and the virtualized transcript can still be unmounting older Turns at that moment. Under CPU load the first rail (Turn 1) detached between user-event's hover and press, so pointerdown and click went to a node outside the document: nothing handled them, user-event raised no error, and the filter never appeared. Click the newest linked Turn's rail instead, which stays mounted while the transcript follows the latest Turn. Fixes apache#5995. Generated-by: Claude Code Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ARE404
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes the last open item of #5995: the Storybook story
product-workhub--retry-while-work-filteredintermittently never shows the work filter.Root cause. The play function sends a message, waits for the first-attempt failure alert, and then clicks
canvasElement.querySelector('.workhub-message-rail'), which is the first rail in the DOM. The send follows the latest Turn (followLatest), andChatView'svirtuavirtualizer (packages/ui/src/chat-view.tsx:959) unmounts Turns that scroll out. It keeps only Turns that hold focus or a selection endpoint (:1155); hover doesn't count. When the alert lands before that scroll has settled, the first rail is still Turn 1's, and it can detach between user-event's hover and press. Thepointerdownandclickthen go to a node outside the document. React never sees them and user-event raises no error, so the filter never appears, andwaitFortimes out on "显示全部对话". In the common case Turn 1 has already been unmounted, the first rail belongs to Turn 2, and the story passes. This is a race in the test only; the product behaves correctly.Fix. Click the newest linked Turn's rail, which stays mounted while the transcript follows the latest Turn. The other WorkHub stories click rails only before any send, so they don't share the race.
Fixes #5995 (items 1 and 2 already landed in #6008 and #6007).
Verification
I reproduced and verified this on Linux CI in a temporary fork workflow (ubuntu-24.04, Node 24, Chromium headless shell). The workflow ran this story through the CI smoke's own
smokeStory(), two copies in parallel with two other WorkHub stories as load, with page instrumentation (rail pointer/mouse events, filter and alert mutations):main, 4-way load (run 37868451921)main, alonemain, instrumented (run 37870979040)paymentsrail and never receivedpointerdown; the other never received the hoverIn every failing timeline, the rails left in the DOM at the failure were Turn 2's and Turn 3's; Turn 1's had been unmounted. Passing timelines clicked Turn 2's
releaserail. I also ruled out the WorkHub reveal animation'spointer-events: nonegate: it never runs in Storybook, and the history'spointer-eventsstayedautothroughout.Not yours: under the same 4-way load,
product-workhub--usage-inspectoralso fails sometimes (toBeVisible). The smoke's existing alone-retry absorbs it ("passed alone; not a failure"), and this PR does not address it.AI use
Select exactly one:
Tool(s) and scope: Claude Code built the instrumented CI repro, identified the root cause and wrote the one-line fix. I reviewed the evidence and the change.
Checklist
Does this PR entail a change in behavior?
🤖 Generated with Claude Code