Skip to content

test(web): the selected-text actions test gives the list time to settle after each scroll - #731

Merged
badcuban merged 1 commit into
mainfrom
test/selection-actions-scroll
Oct 31, 2026
Merged

badcuban merged 1 commit into
mainfrom
test/selection-actions-scroll

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

"keeps the actions beside the selected text as the list scrolls" (MessagesTimeline.real-list.browser.tsx) failed on CI, on main (after #727) and on #728. The actions next to the selected text hadn't come back within Vitest's default one-second wait after a scroll.

Why. After a scroll, the chat list draws the rows coming into view and finishes the scroll on its own timers. Only then do the actions move to the text's new place. On a slow runner that takes longer than a second.

How I checked. I slowed Chrome down with its CPU throttle (via cdp(); not part of the change):

  • old test at 20x: fails;
  • plain scroll writes with a 5 s wait at 20x: 10/10 pass;
  • wheel scrolls with a 1 s wait at 20x: 20/20 pass;
  • wheel scrolls with a 5 s wait at 30x: 10/10 pass.

So the wait was the cause, and wheel scrolls settle faster than bare scrollTop writes.

Fix. The test now scrolls with the file's wheelScroll helper (what a reader does, and what the setup helper already uses since #574). It also waits up to 5 s after each scroll (AFTER_SCROLL), like the file's other list waits. The final version passes 10/10 repeats at a 20x throttle, and the whole file passes at normal speed.

…le after each scroll

"keeps the actions beside the selected text as the list scrolls" failed on
CI (on main and on PRs) when the actions hadn't come back within Vitest's
default one-second wait after a scroll. After a scroll the list draws the
rows coming into view and finishes the scroll on its own timers before the
actions move; on a slow runner that takes longer than a second.

With Chrome's CPU throttled 20x the old test failed; with a five-second
wait it passed every time, and wheel scrolls (what a reader does, and what
the file's other scrolls already use) settled faster than bare scrollTop
writes. The test now scrolls with the wheel helper and waits up to five
seconds after each scroll. It passes 10 of 10 repeats at a 20x throttle.
@vercel

vercel Bot commented Oct 31, 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 31, 2026 6:51am UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Oct 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 31, 2026
@badcuban
badcuban added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 313ff16 Oct 31, 2026
22 checks passed
@badcuban
badcuban deleted the test/selection-actions-scroll branch October 31, 2026 07:08

This branch was previously deployed

1 inactive deployment
Preview — 3e15a1c0 Deployed Oct 31, 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