Skip to content

test(MultiSelector): the create-row contract reads the live region's newest message - #8987

Merged
cixzhang merged 1 commit into
mainfrom
fix/createrow-announce-latest-message
Oct 30, 2026
Merged

cixzhang merged 1 commit into
mainfrom
fix/createrow-announce-latest-message

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Maintainer impact

The release-time accessibility contracts can go red on a correct MultiSelector. CreateRow.a11y.chromium.spec.ts fails intermittently in CI (it failed two of the last five release checks) with the polite region reading something other than exactly Create "Urgent". The empty value in the CI log is the region after its auto-clear: the poll had been reading a longer, joined message until then. A red release check on a healthy commit holds the release.

Intended invariant

The contract is unchanged. The live region says 1 result for a partial match, Create "Urgent" when the create row is the whole result (not "No results found"), and Urgent created after Enter. Highlight handling and the created row's selection are untouched.

Change

Since #8244, messages written before the region exposes the previous one are joined, in order, in one update (spec:AST-086 FR9). The test types with pressSequentially, which can send several keystrokes within one frame on a fast runner. The region then reads, for example, Create "Urgen" Create "Urgent": the previous keystroke's message, then the current one. The test compared the whole region text for exact equality, so it passed or failed depending on how many keystrokes fell into a frame.

The three live-region checks now assert the region's newest message (it ends the region text after a space, or is the whole text), which is what the current state is. Test only: no product code and no Changeset.

Evidence

All runs were in Chromium against the Storybook built for the failing commit, with Playwright 1.61.1.

  • Failure before the change: 9/20 failures at normal load (4 workers), and 1/40 with the CPU saturated, where slower typing rarely joins. Recording the region showed Create "Urgen" Create "Urgent" in failing runs, then the 2 s auto-clear to "".
  • Success after the change: 40/40 at normal load and 40/40 under CPU saturation. The whole file passes repeated runs.
  • Product/runtime behavior verified unchanged: no source change. The joined output is the specified FR9 behavior.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec playwright test packages/core/src/MultiSelector/CreateRow.a11y.chromium.spec.ts --project chromium --repeat-each=40 --fully-parallel, at normal load and under CPU saturation, before and after.
  • prettier --check and eslint on the file are clean.

Credit: @vjeux wrote this contract in #6829. This change only makes its live-region reads robust to typing faster than a frame.

Posted by Cindy's agent on her behalf.

…newest message

Since #8244, messages written before the region exposes the previous one
are joined in order (spec:AST-086 FR9). Typing several keys in one frame,
as pressSequentially can on a fast runner, leaves the previous keystroke's
message ahead of the current one, so an exact whole-text match raced. The
three live-region checks now assert the newest message. Test only.

Original contract by @vjeux in #6829.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 30, 2026
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 30, 2026 5:40am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 30, 2026, 6:03 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended for approval: the three live-region reads now accept the in-order joined update that spec:AST-086 FR9 specifies, and they still fail on an empty region, a wrong newest message, or a message joined after the expected one. Repeated Chromium runs against a Storybook built from this head reproduce the flake with the old exact comparison and show none with the new reads. Nothing further is needed from you.

[Automated review]

@cixzhang cixzhang closed this Oct 30, 2026
@cixzhang cixzhang reopened this Oct 30, 2026
@cixzhang cixzhang closed this Oct 30, 2026
@cixzhang cixzhang reopened this Oct 30, 2026
@cixzhang
cixzhang merged commit dc4b88e into main Oct 30, 2026
53 checks passed
@cixzhang
cixzhang deleted the fix/createrow-announce-latest-message branch October 30, 2026 07:52

This branch was successfully deployed

1 active deployment
Preview — 8904f0a0 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant