Repository navigation
test(web): the text-selection list tests scroll the way a reader does - #574
Merged
Merged
Conversation
The two text-selection tests on the real chat list wrote scrollTop directly to bring a word into view. The list hears a scroll a frame later; a row it measured in between (common on a busy CI runner) let its follow-the-end logic snap back to the bottom, the word left view and its selection dropped, so the Copy button never appeared. The helper now sends a wheel event before each scroll, as a real wheel does, which tells the list the reader left its end.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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.
"keeps a note in progress, and its highlight, while the list redraws the text" (and its sibling "keeps the actions beside the selected text as the list scrolls") kept failing on CI with a click timeout on the Copy button, most recently on #572.
Why. The tests bring the word into view by writing
scrollTopdirectly. The chat list learns about a scroll from the scroll event a frame later (longer on a busy runner). Until then, its follow-the-end logic still thinks it is at the bottom, so a row it measures in that gap snaps it back to the end. Traced under load: the word sat at 180px for one frame, then the list jumped to the bottom and the word ended up 629px above view. The row was then moved out of view and the selection dropped, so the actions never showed. A real reader's scroll starts with a wheel, key, scrollbar press or touch, and each of those turns following off immediately.Fix. The helper sends a wheel event before each scroll, the way a real wheel does.
Verified. Forcing a row restyle right after the scroll fails both tests the same way CI did (click timeout, and actions not shown). With the fix, both pass. The full file, run alongside the ChatView, Settings and Source Control browser specs, failed once every 2 to 8 runs before the fix and passed 10 of 10 runs (303 tests each) after it.
vp fmt,vp lintand the web typecheck pass.