Skip to content

test(DropdownMenu): capture geometry after its frame samples settle - #12343

Merged
cixzhang merged 2 commits into
mainfrom
recut/12342-dropdownmenu-audit-settle
Nov 18, 2026
Merged

cixzhang merged 2 commits into
mainfrom
recut/12342-dropdownmenu-audit-settle

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Re-cut of #12342 by astracat-bot, byte for byte, on current main: the two commits' combined diff is identical to #12342's two commits (the settle poll, then keeping the opening box and the largest sampled movement in settledRender). Credit stays with astracat-bot (a Co-authored-by trailer on the commit). The drain shepherd drives it and closes #12342 when this one merges.


validation: ran pnpm exec playwright test packages/core/src/DropdownMenu/tests/DropdownMenuAudit.a11y.chromium.spec.ts --config playwright.config.ts --project chromium --repeat-each=20 --workers=4 --reporter=list: 100/100 passed, covering 20 complete audit repetitions; Prettier and ESLint passed; pnpm review:pre reported zero findings. CodeBunny's CI lab also passed 20/20 unchanged runs at the failing commit (repro 6674083777953085362).

Maintainer impact

Run 44088856748 (#43793), job 134066319568, failed the fourth DropdownMenu audit chunk at commit deb3b38: expect(geometryDelta).toBeLessThanOrEqual(0.5) received 286. A single pair of frame samples can straddle an opening layout update, preventing the audit from producing its settled-frame evidence.

Intended invariant and change

The screenshot and its receipt must describe a settled layout. Poll the same maximum x/y/width/height movement until it satisfies the existing 0.5-pixel bound, then retain that measured pair in settledRender, together with the opening box and the largest movement sampled before it settled, so the receipt shows what the poll waited out. A missing box still fails immediately rather than waiting for UI to reappear. Keep every claimed-state, focus, overflow, theme and forced-colors assertion.

No behavior change. Only this spec changes; no product code, visibility wait, timeout, tolerance or baseline changes.

Evidence

  • deflake_evidence: b. It went red in 2 streaks in 7 days (2026-11-13T11:51Z, 2026-11-17T13:29Z), passing between them.
  • The unchanged failing commit passed 20/20 local targeted repeats with four workers, and 20/20 CI-lab runs in repro 6674083777953085362. This is verified intermittency, not a claimed deterministic reproduction.
  • The change at base ab67aa1 passed all 100 checks across 20 full audit repetitions with four workers. All 32 final frame receipts reported zero settled movement.
  • A temporary real-browser probe sampled moving geometry at 50.1 and 116.6 pixels before settling at zero; the same bound accepted the settled pair and rejected continuously moving geometry. The probe is not submitted.
  • An initial full-repeat attempt was interrupted when a separate probe run cleared its results directory. The isolated rerun above passed.

The exact layout update behind the CI sample was not reproduced locally or in the lab. This deliberately corrects the sampling assumption, rather than guessing at a product positioning change.

Scope

Fixes: decb2da1cd586cd61a826365f5521732ae2b52797d21ba8eeb3a1e077c3442cd — captures DropdownMenu states 4/4 with sensor receipts.

The older contract-shard failure in run 44073648282 is a separate MoreMenu sheet-row assertion, not covered by this change.

See also #11297.

  • No intended public API, product behavior, visual direction, or policy change.
  • No unrelated product changes.
  • No private operational context in the submitted files.

#11297 by bezabyte also changes this test file.

Overlap checked: #12342, #11297 (#12342: astracat-bot's original of this same change, byte for byte; it closes when this re-cut merges. #11297: a community change to another behavior in the same spec file, so whichever lands second merges main)

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950); driven by the drain shepherd (66fc5b74). Land path: the shipper, through merge-guard.

Re-cut of #12342 by astracat-bot, byte for byte on current main.

Co-authored-by: astracat-bot[bot] <323722387+astracat-bot[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Nov 17, 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 Nov 18, 2026 10:30am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 11:31 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 3be09df

@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 45169ba

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
DropdownMenu 108.3 kB (0) · 18.9 kB CSS (0) — ✗ · ✓ · ✓
DropdownMenuCheckboxItem 28.6 kB (0) · 7.3 kB CSS (0) — ✗ · ✓ · ✓
DropdownMenuDivider 5.3 kB (0) · 548 B CSS (0) — ✗ · ✓ · —
6 more components
Component Size LoC Visual · A11y · RTL
DropdownMenuGroup 6.4 kB (0) · 3.4 kB CSS (0) — ✗ · ✓ · —
DropdownMenuItem 27.8 kB (0) · 6.9 kB CSS (0) — ✗ · ✓ · —
DropdownMenuRadioGroup 6.6 kB (0) · 3.3 kB CSS (0) — ✗ · ✓ · —
DropdownMenuRadioItem 28.7 kB (0) · 7.3 kB CSS (0) — ✗ · ✓ · —
DropdownMenuSubMenu 78.7 kB (0) · 10.5 kB CSS (0) — ✗ · ✓ · ✓
ContextMenuItem 35.5 kB (0) · 7.1 kB CSS (0) — — · — · —
Visual changes: 4 snapshots in 1 component

A change is a question for the reviewer, not a failure.

Component · story Before After Diff
DropdownMenu · Lab Checkbox Items (probe, dark) · inheritance unknown: not found in the 4 newest reports of other pull requests before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (probe, light) · inheritance unknown: not found in the 4 newest reports of other pull requests before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (neutral, dark) · inheritance unknown: not found in the 4 newest reports of other pull requests before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (neutral, light) · inheritance unknown: not found in the 4 newest reports of other pull requests before frame after frame diff frame

Inheritance checked against the 4 newest reports of other pull requests.

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet.

The audit now waits for the menu's box to hold still before it captures a frame, keeps the 0.5 px bound and every state assertion, and still fails a frame whose box disappears or never settles. A menu moved by script for six frames after opening fails the current capture and passes this one, and a menu that keeps moving still fails with the new poll message.

  • Optional: settledRender.initial now holds the earlier sample of the settled pair, so a receipt no longer shows that the menu moved before capture; recording the first measured box and the poll count would keep the next occurrence diagnosable.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the diff is byte-identical to the original pull request it re-cuts, on current main: verified.
  • Claim: the original author keeps credit through a co-author trailer: verified in the commit message.
  • Claim: repeated local and lab runs passed: not re-run here; one full Chromium run of the audit at this head passed all 32 frames.
  • Claim: Prettier, ESLint and the pre-review report are clean: verified at this head.
  • Claim: the failing CI run measured a 286 px movement in the fourth chunk: the failing commit's copy of this spec matches the base; that run's log was not available to this review.
  • Claim: one pair of frame samples can straddle an opening layout update: verified; a six-frame scripted shift fails the current capture and passes this one.
  • Claim: the poll uses the same maximum movement and 0.5 px bound and keeps the settled pair in the receipt: verified in capture().
  • Claim: a missing box still fails at once: verified.
  • Claim: every claimed-state, focus, overflow, theme and forced-colors assertion is kept: verified, unchanged.
  • Claim: no product code, visibility wait, timeout value, tolerance or baseline changes: verified; the poll is bounded by Playwright's default expect timeout.
  • Claim: the bound rejects continuously moving geometry: verified with a scripted continuous movement.
  • Claim: the change targets the audit's fourth-chunk test: verified title and chunk count.
  • Claim: another open pull request edits this spec: verified.
  • Claim: the older MoreMenu contract-shard failure is separate: not checked; outside this change.
  • File: packages/core/src/DropdownMenu/__tests__/DropdownMenuAudit.a11y.chromium.spec.ts: clear, one optional suggestion.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 09:55

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the settle poll itself is a sound fix for this flake, but the pull request no longer matches the change it says it re-cuts.

  • Regression: The description says this is a byte-for-byte re-cut of #12342 that closes #12342 on merge, but #12342 now has a second commit that keeps the opening box and the largest sampled movement in settledRender (DropdownMenuAudit.a11y.chromium.spec.ts:1042 here still writes only the settled pair), so merging this as described would drop that change; please bring that commit into this branch, or update the description so #12342 is not closed on merge.

Everything else checks out: only this spec changes, the 0.5 px bound and every claimed-state and forced-colors assertion are untouched, and a missing or never-settling box still fails the frame.

Claims and files checked

Review mode: same-head; reason: none

  • Claim: the diff is byte-identical to the original pull request it re-cuts: false; the original has since gained a second commit that changes the receipt.
  • Claim: the original author keeps credit through a co-author trailer: verified in the commit message.
  • Claim: repeated local and lab runs of the audit passed, at the failing commit and with the change: not re-run; one full Chromium run of the audit at this head passed all 32 frames.
  • Claim: Prettier, ESLint and the pre-review report are clean: verified; the Lint workflow also passes at this head.
  • Claim: the failing CI run measured a 286 px movement in the fourth chunk: that run's log was not available; the failing commit's copy of this spec matches the base.
  • Claim: the audit went red twice in a week and passed between: not checked.
  • Claim: one pair of frame samples can straddle an opening layout update: verified; a six-frame scripted shift fails the current capture and passes this one.
  • Claim: the poll uses the same maximum movement and 0.5 px bound and keeps the settled pair in the receipt: verified in capture().
  • Claim: a missing box still fails at once: verified.
  • Claim: every claimed-state, focus, overflow, theme and forced-colors assertion is kept: verified, unchanged.
  • Claim: no product code, visibility wait, timeout value, tolerance or baseline changes: verified; the poll is bounded by Playwright's default expect timeout.
  • Claim: the bound rejects continuously moving geometry: verified with a scripted continuous movement.
  • Claim: the change targets the audit's fourth-chunk test: verified title and chunk count.
  • Claim: another open pull request edits this spec: verified.
  • Claim: the older MoreMenu contract-shard failure is separate: not checked; outside this change.
  • Claim: no public API, product behavior, visual or policy change, and no unrelated product change: verified.
  • Claim: no private operational context in the submitted files: verified for the changed file.
  • File: packages/core/src/DropdownMenu/__tests__/DropdownMenuAudit.a11y.chromium.spec.ts: one blocking finding (its receipt no longer matches the re-cut original), otherwise clear.

Automated review (maintainer link)

Re-cut of #12342's second commit (b5c0a2d) by astracat-bot, byte-identical.

Co-authored-by: astracat-bot[bot] <astracat-bot[bot]@users.noreply.github.com>
@cixzhang
cixzhang marked this pull request as draft November 18, 2026 10:21
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 45169ba

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. CI has run on this head and passes.

The audit now waits for the menu's box to hold still before it takes a frame, keeps the 0.5 px bound and every state assertion, and still fails a frame whose box disappears or never settles. Each receipt keeps the opening box and the largest movement the wait saw, and the diff still matches #12342 byte for byte, so closing #12342 on merge loses nothing.

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim: the two commits' combined diff is byte-identical to the original pull request's two commits: verified; the two diffs are identical, and the original has not changed since.
  • Claim: the re-cut sits on current main: verified; it was cut on the tip of main at the time, main has not changed this spec since, and the head merges onto today's main cleanly.
  • Claim: the original author keeps credit through a co-author trailer: verified; both commits carry one.
  • Claim: the original pull request closes when this one merges: not checked; a process step outside the code.
  • Claim: 20 repeated audit runs with four workers passed all 100 checks, with zero settled movement in every final receipt: not re-run as repeats; one full Chromium run at this head passed all 32 frames with zero settled movement.
  • Claim: Prettier, ESLint and the pre-review report are clean: Prettier and ESLint verified, and the Lint workflow passes on this head; the pre-review report was not re-run.
  • Claim: a separate lab passed 20 of 20 unchanged runs at the failing commit: not checked.
  • Claim: the failing CI job received 286 against the 0.5 px bound in the fourth chunk at the named commit: verified in that job's log.
  • Claim: the audit went red in two streaks in a week and passed between: partly verified; the second streak's time matches the failing job's log, and the first was not checked.
  • Claim: the unchanged failing commit passed 20 of 20 local repeats: not re-run.
  • Claim: a single pair of frame samples can straddle an opening layout update: verified; a six-frame scripted move fails the current capture and passes this one.
  • Claim: the poll uses the same maximum movement and 0.5 px bound, and the receipt keeps the settled pair, the opening box and the largest sampled movement: verified in the code and in a receipt from the scripted move.
  • Claim: a missing box still fails at once: verified in the code.
  • Claim: every claimed-state, focus, overflow, theme and forced-colors assertion is kept: verified, unchanged.
  • Claim: no product code, visibility wait, timeout value, tolerance or baseline changes: verified; the poll uses Playwright's default expect timeout.
  • Claim: the bound rejects continuously moving geometry: verified with a scripted continuous move.
  • Claim: a temporary browser probe saw movement settle to zero, and an interrupted repeat run was rerun in isolation: not checked; neither is submitted.
  • Claim: the change fixes the audit chunk that captures DropdownMenu states 4 of 4: verified; the test title and chunk count match the failing job.
  • Claim: the older MoreMenu contract-shard failure is separate: not checked; outside this change.
  • Claim: another open pull request edits this spec: verified; it is still open and still edits this file.
  • Claim: no public API, product behavior, visual or policy change, and no unrelated product change: verified; Core's build skips the changed file, and CI's API report lists no change.
  • Claim: no private operational context in the submitted files: verified for the changed file.
  • File: packages/core/src/DropdownMenu/__tests__/DropdownMenuAudit.a11y.chromium.spec.ts: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 11:09
@cixzhang
cixzhang merged commit 816ae39 into main Nov 18, 2026
149 checks passed
@github-actions
github-actions Bot deleted the recut/12342-dropdownmenu-audit-settle branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 45169bad Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) 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