Repository navigation
test(Spinner): wait for announcements before tracing rotor paints - #10174
Closed
astracat-bot[bot] wants to merge 2 commits into
Closed
astracat-bot[bot] wants to merge 2 commits into
astracat-bot[bot] wants to merge 2 commits into
Conversation
astracat-bot
Bot
requested review from
cixzhang,
imdreamrunner and
josephfarina
as code owners
November 5, 2026 23:17
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
AI review status for this pull request.
|
Contributor
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Spinner · Storybook | 20.3 kB (0) · 6.1 kB CSS (0) | 351 (0) | ✓ · ✓ · — |
Package size: no published package changed; no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 19 rows, core 23 rows; run pnpm api:report.
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
4 tasks done
…ments-before-tracing-rotor-paints-2ff82b
vjeux
reviewed
Nov 6, 2026
vjeux
left a comment
Contributor
There was a problem hiding this comment.
Checked locally in Chromium (Storybook built at main ab7facf, one worker, no retries):
- Main's test fails 3 of 3 with Paint 1. In a trace of the same window, the only Paint (on
#document, after one style recalc and two layouts) lands 4 ms after the polite live region's text is cleared. A trace started after the clear has no paint, layout or style recalc in 2 s, so the turning itself paints nothing. - With this change the test passes 5 of 5. A mutant whose rotor animates
box-shadowstill fails it (Paint 600, style recalc 120). Abackground-colormutant, which Chromium composites, fails on the style-recalc bound (20). - Non-blocking:
every()is also true before any region exists, and in the frame before the write. Waiting for the region to hold text, then to empty, would make the wait prove that the announcement ran and ended.
imdreamrunner
approved these changes
Nov 6, 2026
cixzhang
approved these changes
Nov 6, 2026
cixzhang
left a comment
Contributor
There was a problem hiding this comment.
Approved by Cindy's agent with her authorization
Contributor
Author
github-actions
Bot
deleted the
codebunny/fix/test-spinner-wait-for-announcements-before-tracing-rotor-paints-2ff82b
branch
November 6, 2026 06:04
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Maintainer impact
The Spinner motion contract fails on main with one Paint event where it expects zero. The failure reproduces on all three runs of the unchanged test at 1ef21f8.
Intended invariant
The motion test measures the ring's steady-state compositor animation, as described by the Spinner contract's motion verification map. The standalone Spinner also announces loading through the shared channel, and AST-086 FR9 requires that channel to clear its text shortly afterward. That one-time clear is not a rotor repaint.
Change
Wait for the shared live regions to become empty before starting the rendering trace. The new mount announcement's two-second clear previously fell inside the two-second tracing window and caused the unrelated Paint event. This change separates setup from the motion measurement without disabling announcements or removing any trace events. The measurement duration, zero-Paint and zero-Layout assertions, style-recalculation bound, and test timeout are unchanged.
No behavior change. Only seven lines of test setup are added; component code, stories, public APIs, visual direction, and policy are unchanged. No Changeset is needed.
Evidence
The original test fails 3/3 runs with Paint = 1. With the setup fix, it passes 5/5 repeated runs, and all six tests in SpinnerMotion.a11y.chromium.spec.ts pass, including the busy-main-thread, timing, reduced-motion, phase, and storyboard checks. A temporary SVG stroke animation still fails the corrected test with Paint = 240; that mutation is removed.
The 65 Spinner unit tests pass. The Storybook build,
pnpm check:repo, strict ESLint for the changed file, Prettier, diff whitespace check, and pre-review report pass. The pre-review report has no findings.Testing
Run
pnpm exec playwright test packages/core/src/Spinner/__tests__/SpinnerMotion.a11y.chromium.spec.ts --config=playwright.config.ts --project=chromiumagainst a built Storybook. The repeated regression check uses the same command with--grep='turning paints nothing on the main thread' --repeat-each=5. Unit coverage usespnpm exec vitest run packages/core/src/Spinner/Spinner.test.tsx --project ui --maxWorkers=1.Review note
The test now waits for the actual announcement lifecycle rather than guessing a longer delay. It also permits no shared regions when page-load announcements are suppressed. I considered silencing the story's Spinners, but kept their normal accessibility behavior intact and scoped the correction to tracing setup instead. Full repository unit tests and package builds were not run; validation is focused on the changed browser contract and unchanged Spinner behavior.