Repository navigation
Conversation
…erwrites the saved position After reopening, the test rendered a bare MessagesTimeline whose onManualNavigation was a no-op, so live follow stayed on. Once the restore settled, the next scroll save stored the manual position as atEnd: true, and the final switch back landed at the end. Render the reopened timeline through the Chat wrapper and turn off live follow on manual navigation, as ChatView does.
2 tasks done
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped browser-test-only flake fix confined to an ignored path, with no production runtime or product-default changes. Its impact is limited to test execution. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Contributor
Member
|
Note Grok responding on behalf of Julius. Thanks for tracking this down. #22557 just landed on main and deleted the "restores a manual reading position after reopening and switching threads" test this PR fixes, so there's nothing left for it to change. That also takes care of item 5 in #22324. Closing as superseded. |
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.
Problem
MessagesTimeline.browser.test.tsx› "MessagesTimeline scroll position › restores a manual reading position after reopening and switching threads" fails intermittently withexpected 600 to be less than or equal to 1at the final switch back to the saved thread (#22324, item 5; also reported in #21968). The 600 is the test's wheel distance.rememberTimelinePositionstoresatEnd: liveFollowEnabled || position.atEnd. After reopening, the test rendered a bareMessagesTimelinewithbaseProps(), which hasliveFollowEnabled: trueand a no-oponManualNavigation. The restore effect callsonManualNavigation()for a manual position, but nothing turned live follow off. Once the restore settled, the nexthandleScrollframe saved the same offset asatEnd: true, so the final switch back scrolled to the end. The test only failed when that frame ran before it switched threads, which is why it passed on rerun.ChatViewwiresonManualNavigationtosetTimelineLiveFollowEnabled(false), so the app itself is not affected.Change
The reopened timeline now renders through the test's existing
Chatwrapper. The wrapper takesrouteThreadKeyand passesonManualNavigation={() => setLiveFollowEnabled(false)}, matchingChatView. The component is unchanged.The fix proposed in #22324 (reusing the wrapper alone) isn't enough: the wrapper only turns follow off on wheel, and nothing wheels after the reopen.
Scope and approval
A test-only fix for one flaky test. It's item 5 of #22324, and @juliusmarminge invited picking up the remaining #22324 flakes. This PR fixes only that item.
Verification
{"atEnd":true,"scrollOffset":3174}with the expected offset of 3174. The wrapper withoutonManualNavigationfails the same way. With this change, it passes.vp test run --project browser src/components/chat/MessagesTimeline.browser.test.tsx: 77/77 pass. The target test passed 10/10 repeated runs.Investigated and written by Claude Opus 5.5 in Claude Code (T3 Code).