Skip to content

Fix flaky SettingsDialog watcher snapshots - #1155

Merged
nedtwigg merged 1 commit into
mainfrom
flaky-settings-snapshot
Oct 17, 2026
Merged

nedtwigg merged 1 commit into
mainfrom
flaky-settings-snapshot

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

Every PR has been showing settings-page snapshot deltas that mean nothing. Argos builds 1179–1205 show which stories flip: WithRules, ManyRules, DeferralDisabled, WatcherEmpty, and Light/Dark/Narrow, which reuse WithRules. Every one of them runs showWatcher in its play, in both Chromium and WebKit.

Root cause. showWatcher selects Notifications, then scrolls instantly to the animation watcher. waitForTopicScroll returned once scrollTop was within 2px of the topic, but the topic animation's last requestAnimationFrame step could still be queued. That step re-reads the topic's position and calls scrollTo, so on some runs it ran after the watcher scroll and put the view back on the Notifications heading. In PR #1150's ManyRules diff, the base is the heading and the compare is the watcher.

Fix. Once the scroll settles, waitForTopicScroll fires a wheel event, which cancels the animation the same way user input does. ScrollFollowsContents already does this. Nothing can move the scroller after that.

Verified locally with vitest.argos.config.ts on the SettingsDialog stories, comparing screenshot hashes for the 7 stories × 2 browsers:

  • before the fix, 5 runs: 8 of 14 produced two different images
  • after the fix, 3 runs: all 14 were identical on every run, showing the watcher as intended

The first Argos build on this PR may report the watcher stories as changed against a baseline that captured the heading. Approve that build once.

🤖 Generated with Claude Code

The watcher stories (WithRules, ManyRules, DeferralDisabled, WatcherEmpty,
and Light/Dark/Narrow) flipped between two snapshots on most PRs since
#1179's builds. `waitForTopicScroll` returned once scrollTop was within 2px
of the topic, which could leave the animation's last frame queued; that
frame re-reads the topic's position, so on some runs it undid
`showWatcher`'s scroll and Argos captured the Notifications heading instead
of the watcher. A wheel event cancels the animation, as user input does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: aa1f8e9
Status: ✅  Deploy successful!
Preview URL: https://eb0a2a53.mouseterm.pages.dev
Branch Preview URL: https://flaky-settings-snapshot.mouseterm.pages.dev

View logs

@nedtwigg
nedtwigg merged commit daba343 into main Oct 17, 2026
17 of 18 checks passed

This branch is waiting to be deployed

1 waiting deployment
hosted-preview — aa1f8e9a Waiting Oct 17, 2026 by nedtwigg via deploy #1420
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants