Skip to content

test(web): the text-selection list tests scroll the way a reader does - #574

Merged
badcuban merged 1 commit into
mainfrom
fix/note-in-progress-test
Oct 22, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/note-in-progress-test

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

"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 scrollTop directly. 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 lint and the web typecheck pass.

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.
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Oct 22, 2026 6:44am UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit e94aea3 Oct 22, 2026
@badcuban
badcuban deleted the fix/note-in-progress-test branch October 22, 2026 06:53

This branch was previously deployed

1 inactive deployment
Preview — 9f684850 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant