Wait for the QR chunk and terminal-context autorun before Storybook snapshots - #771
Conversation
On a loaded WebKit runner the lazily-imported QrCode chunk can take longer than findByRole's 1 s default to arrive after the click, failing the Argos run on main (run 35907472490). Importing it in the play function first lets the panel's own lazy import resolve from the module cache.
Deploying mouseterm with
|
| Latest commit: |
6a5289e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://21d99a86.mouseterm.pages.dev |
| Branch Preview URL: | https://fix-ci-35907472490.mouseterm.pages.dev |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Every story that opens the terminal context captured whichever helper step
the runner had reached ("Waiting for shell…", "Running git status…", or
"autoran"), so Argos, rendering 550 captures at once on CI, saw a different
frame from its baseline. `settleTerminalContext` waits for the status
spinner to clear and the helper to paint; the six context-dialog stories,
Wall's alert modal, and Wall's TerminalContext (replacing its one-off gate)
all use it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Added 6a5289e. The 7 Chromium changes Argos reported here came from a separate race, not from this PR. Every story that opens the terminal context captured whichever helper step it had reached: "Waiting for shell…", "Running git status…", or "autoran". Main's baseline caught a different step than this PR's run did. The new Two full local Chromium runs differ only by ±1 colour-level antialiasing in SettingsDialog, which is below Argos's threshold. |
Makes two groups of Storybook stories wait for async UI before their snapshot is taken, so Argos stops capturing a different frame on each run.
QR setup story. The Argos run on main after #770 (run 35907472490) failed on
RemoteControlSection > Setup Phone Qrunder WebKit:Unable to find role="img" and name "Setup code for this machine". The setup panel had rendered, butScannableCode's<Suspense fallback={null}>was still waiting for the lazily importedQrCodechunk.findByRole's default 1 s timeout was racing a cold chunk fetch. On WebKit this story took 1.4 s and 2.3 s in the two green runs before it and 2.6 s when it failed. The play function now runsimport('../components/QrCode')before the click, so the panel'slazy()import resolves from the module cache. The rendered component is unchanged.Terminal-context stories. Every story that opens the terminal context captured whichever helper step it had reached: "Waiting for shell…", "Running git status…", or "autoran". So main's baseline and a PR's run could each catch a different step. This caused the 7 Chromium diffs Argos reported on this PR. The new
settleTerminalContextinlib/src/stories/settle-terminals.tswaits for the status row's spinner to clear, then runssettleTerminalsso the helper has painted. It is used by the sixcontextDialogStorystories, Wall → Alert Modal Open, and Wall → Terminal Context, where it replaces the one-offautorancheck from #770.Verification: all 23
RemoteControlSectionstories pass under the chromium Argos project, andtsc --noEmitis clean. Two full local Chromium runs differ only by ±1 colour-level antialiasing in SettingsDialog, which is below Argos's threshold. WebKit could not run locally, so this PR's Argos run is the WebKit check.