Skip to content

Lock down the three flaky visual snapshots - #770

Merged
nedtwigg merged 1 commit into
mainfrom
lock-flaky-snapshots
Sep 23, 2026
Merged

nedtwigg merged 1 commit into
mainfrom
lock-flaky-snapshots

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

The first Argos runs (#765) showed three stories rendering differently on every run. The cause was in the stories, not in Argos, so Chromatic was capturing the same instability.

Story Cause Fix
RemoteControlSection → Setup Phone QR The setup code encodes expiresAt = Date.now() + TTL, so each run drew a different QR. The stories file freezes Date.now in its meta beforeEach. The story drops its import-time setupQrResult() and lets the stub mint the code at request time, under the frozen clock.
WorkspaceStrip → Close Confirm (and every kill confirmation) randomKillChar() uses Math.random(). A new cfg.killConfirm.char pins the letter; the preview's visual-snapshot block sets it to q.
Wall → Terminal Context The capture showed whichever helper state it reached first: "Waiting for shell…", "Running git status…", or "autoran". The play function now waits for "autoran" and for the terminals to settle.

What's left is ±1 colour-level antialiasing on rounded focus-ring corners in SettingsDialog, which is below Argos's diff threshold.

Test plan

  • The four affected story files are pixel-identical across 4 consecutive runs, and the full Chromium suite differs only in that antialiasing.
  • KillConfirm.test.ts fails when the cfg.killConfirm.char ?? is deleted.
  • pnpm --filter dormouse-lib test, spec-lint

🤖 Generated with Claude Code

- RemoteControlSection: freeze `Date.now` for the file and let the stub mint
  the setup code under it; the QR encodes its expiry, so a real clock drew a
  new code every run.
- Kill confirmation: `cfg.killConfirm.char` pins the letter, set under
  visual snapshots.
- Wall TerminalContext: hold the capture until the helper's autorun has
  finished rather than whichever of waiting/running it had reached.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@nedtwigg
nedtwigg marked this pull request as ready for review September 23, 2026 18:52
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: fd51559
Status: ✅  Deploy successful!
Preview URL: https://fc43dfaa.mouseterm.pages.dev
Branch Preview URL: https://lock-flaky-snapshots.mouseterm.pages.dev

View logs

@argos-ci

argos-ci Bot commented Sep 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
storybook-chromium (Inspect) 👍 Approved by Ned Twigg 2 changed Sep 23, 2026, 6:57 PM
storybook-webkit (Inspect) 👍 Approved by Ned Twigg 1 changed Sep 23, 2026, 6:57 PM
Deployment Status Branch Updated (UTC)
preview (Open) Ready lock-flaky-snapshots Sep 23, 2026, 6:57 PM

@nedtwigg
nedtwigg merged commit ec92981 into main Sep 23, 2026
22 checks passed
@nedtwigg
nedtwigg deleted the lock-flaky-snapshots branch September 23, 2026 19:09

This branch is waiting to be deployed

1 waiting deployment
hosted-preview fd515592 Waiting Sep 23, 2026 by nedtwigg via cleanup #320
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