Skip to content

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

Closed
astracat-bot[bot] wants to merge 2 commits into
mainfrom
codebunny/fix/test-dropdownmenu-capture-geometry-after-its-frame-samples-settle-bbdd04
Closed

astracat-bot[bot] wants to merge 2 commits into
mainfrom
codebunny/fix/test-dropdownmenu-capture-geometry-after-its-frame-samples-settle-bbdd04

Conversation

@astracat-bot

@astracat-bot astracat-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

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. 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.

@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 17, 2026 2:27pm 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 Author

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 2:37 PM UTC

@astracat-bot

astracat-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

This test passed on main since, but it failed intermittently (DropdownMenuAudit.a11y.chromium.spec.ts › captures DropdownMenu states 4/4 with sensor receipts: red at 2026-11-13 11:51 UTC, 2026-11-17 13:29 UTC); this PR fixes the intermittency.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changes requested: waiting for the menu to stop moving is a sound fix for this flake, but the receipt it writes no longer shows whether the menu moved.

  • In DropdownMenuAudit.a11y.chromium.spec.ts, the poll overwrites firstBox on every pass (line 670), so after a retry settledRender.initial and maxDelta (line 1042) describe only the last, still pair, and a menu that moved 286 px before settling writes the same receipt as one that never moved: please keep the opening sample and the largest movement in settledRender beside the settled pair.

Everything else checks out: only this spec changes, the claimed-state and forced-colors assertions are untouched, and ESLint and Prettier pass on the file.

Claims and files checked

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

  • Claim: the release-evidence failure was the fourth audit chunk's geometry check receiving 286: verified in the failing job's log.
  • Claim: the spec polls the same x, y, width and height movement until the 0.5 px bound holds: verified (lines 660-682).
  • Claim: the measured pair is kept in settledRender: verified (line 1042); see the finding above.
  • Claim: a missing box still fails at once instead of waiting: verified (lines 665-669 and 683-685).
  • Claim: every claimed-state, focus, overflow, theme and forced-colors assertion is kept: verified; the diff touches only lines 650-685.
  • Claim: no product code, visibility wait, timeout, tolerance or baseline changes: verified; one test file changes, the 0.5 px bound is unchanged, and the poll uses the default expect timeout.
  • Claim: Prettier and ESLint pass: verified on the file at this head.
  • Claim: repeated local and lab runs of the audit pass: not verified; the audit was not rerun, and pull-request CI does not run a changed audit spec.
  • Claim: the test went red in two streaks in seven days: not verified beyond the one failing run read.
  • Claim: the older contract-shard failure is a separate MoreMenu sheet assertion: verified in that run's annotations.
  • Claim: another open pull request also edits this test file: verified from its file list.
  • File packages/core/src/DropdownMenu/__tests__/DropdownMenuAudit.a11y.chromium.spec.ts: one finding, above.

Automated review (maintainer link)

@astracat-bot

astracat-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

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 after the receipt change: 100/100 passed (20 complete audit repetitions); pnpm storybook:build, Prettier and ESLint passed; pnpm review:pre reported zero findings.

Addressed the review on 3b74548: settledRender.opening keeps the first box, and maxObservedDelta accumulates the largest x/y/width/height delta across every sampled pair. The existing initial, final, and maxDelta still describe the accepted settled pair. A menu that moves 286 px and then stops now keeps that 286 px observation beside its zero-delta settled pair.

A temporary receipt replay using the spec's exact sampling block and receipt expression failed the 286 px preservation case in 2/2 runs before this change. Afterward, four cases passed 80/80 checks over 20 repetitions: a 286 px move, several moving pairs with a later smaller delta, unchanged/subpixel geometry, and missing initial/subsequent boxes. This replay is not a product-browser reproduction and is not submitted. The real-browser audit above reran all original assertions. All 32 final receipts include both new fields, with settled deltas within 0.5 px.

The first audit invocation stopped in setup because the fresh Storybook build lacked CI's source stamp; after applying the existing CI stamping step, the full repeat run passed. No product code, assertion, timeout, tolerance, visibility wait, or baseline changed. No unresolved implementation doubt remains; the cause of the original transient product-layout sample remains unproven, as the existing description states.

See also #11297 and #12343.
#11297 by bezabyte also changes this test file.
#12343 by cixzhang also changes this test file.

@astracat-bot

astracat-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

This test passed on main since, but it failed intermittently (DropdownMenuAudit.a11y.chromium.spec.ts › captures DropdownMenu states 4/4 with sensor receipts: red at 2026-11-13 11:51 UTC, 2026-11-17 13:29 UTC); this PR fixes the intermittency.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Approved pending CI: waiting for the menu's box to settle before each frame fixes this flake, and the receipt now keeps the opening sample and the largest move beside the settled pair, so the earlier receipt finding is resolved.

CI finished on this head with one failure that this change does not cause: the UI test shard test-ui (1/4) timed out downloading dependencies before any test ran, which also fails the aggregate test check, so a rerun of that job is needed before merge.

Claims and files checked

Review mode: full; reason: author-not-engowner

  • Claim: the release-evidence failure was the fourth audit chunk's geometry check receiving 286: verified in that job's log.
  • Claim: one pair of samples two frames apart can straddle an opening layout update: verified as a description of the base, which takes exactly one such pair.
  • Claim: the spec polls the same x, y, width and height movement until the existing 0.5 px bound holds: verified (lines 661-684).
  • Claim: the settled pair is kept in settledRender: verified (lines 1047-1049), with the opening sample and the largest move beside it (lines 1045-1046).
  • Claim: a missing box still fails at once instead of waiting for it to reappear: verified (lines 651-653, 666-670 and 685-687).
  • Claim: every claimed-state, focus, overflow, theme and forced-colors assertion is kept: verified; the diff touches only the sampling block and the receipt.
  • Claim: no product code, visibility wait, timeout, tolerance or baseline changes: verified; one test file changes, the 0.5 px bound is unchanged, and the poll uses Playwright's default expect timeout.
  • Claim: repeated local and lab runs of the audit passed: partly verified; a full run and ten repetitions of the audit at this head passed, and the author's own runs were not reproduced at their scale.
  • Claim: every final frame receipt reports zero settled movement: verified at this head, where all 32 receipts also record a largest move of zero.
  • Claim: Prettier and ESLint pass and the pre-review checks report no findings: Prettier and ESLint verified on the file at this head; the pre-review script was not rerun.
  • Claim: the test went red in two streaks in seven days: partly verified; the later failure matches the release job read, and the earlier one was not read.
  • Claim: a temporary browser probe saw the box move before it settled: not verifiable, since the probe is not submitted.
  • Claim: the older contract-shard failure is a separate MoreMenu sheet assertion: verified in that job's annotations.
  • Claim: another open pull request also edits this test file: verified from its file list.
  • File packages/core/src/DropdownMenu/__tests__/DropdownMenuAudit.a11y.chromium.spec.ts: clear.

Automated review (maintainer link)

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · b5c0a2d

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 7 newest reports of other pull requests before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (probe, light) · inheritance unknown: not found in the 7 newest reports of other pull requests before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (neutral, dark) · inheritance unknown: not found in the 7 newest reports of other pull requests before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (neutral, light) · inheritance unknown: not found in the 7 newest reports of other pull requests before frame after frame diff frame

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

Package size: no published package changed; no new dependencies.

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

Current run: CI concluded failure; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

cixzhang added a commit that referenced this pull request Nov 18, 2026
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 added a commit that referenced this pull request Nov 18, 2026
…12343)

* test(DropdownMenu): capture geometry after its frame samples settle

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>

* test(DropdownMenu): retain opening geometry and peak sampled movement

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>
@github-actions
github-actions Bot deleted the codebunny/fix/test-dropdownmenu-capture-geometry-after-its-frame-samples-settle-bbdd04 branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — b5c0a2d6 Deployed Nov 17, 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.

0 participants