Skip to content

test(Tooltip): the fitting-tooltip wheel contract reads "still open" as the page starts to scroll - #8988

Merged
cixzhang merged 1 commit into
mainfrom
fix/tooltip-wheel-open-at-scroll
Oct 30, 2026
Merged

cixzhang merged 1 commit into
mainfrom
fix/tooltip-wheel-open-at-scroll

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Maintainer impact

The release-time accessibility contracts can go red on a correct Tooltip. In CI, TooltipTallContent.a11y.browser.spec.ts › "a wheel over a tooltip that fits still scrolls the page" failed with the tooltip no longer in the page at its final check. A red release check on a healthy commit holds the release.

Intended invariant

The contract is unchanged: a wheel over a tooltip that fits scrolls the page instead of being captured, the wheel does not dismiss the tooltip, and the tooltip has no scroll range of its own (spec:AST-025 FR14). Tooltip FR3 also still holds: once the pointer is over neither the trigger nor the tooltip, it closes after the hover bridge.

Change

The wheel scrolls the page 300 px, which carries the trigger and the tooltip out from under the resting pointer. That is a leave, so the tooltip closes about 100 ms later, as FR3 specifies. The test checked "still open" after it had polled for the scroll, so it only passed when that check ran before the hover bridge expired. On a slow runner it doesn't.

The test now records the tooltip's state at the page's first scroll event: the moment the wheel has been passed on to the page, before the pointer has left. The checks are the same (open, and no scroll range of its own), read at the point where they answer the contract's question. 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: 6/40 failures with the CPU saturated, with the same error and line as CI; 20/20 passes at normal load. A probe showed that after the wheel the trigger is above the viewport and the tooltip has moved beside it, away from the pointer, and that the tooltip closes about 36 ms after the old check ran.
  • Success after the change: 40/40 under CPU saturation and 40/40 at normal load. The whole file passes repeated runs.
  • Product/runtime behavior verified unchanged: no source change. Closing after the pointer leaves is the specified FR3 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/Tooltip/__tests__/TooltipTallContent.a11y.browser.spec.ts --project chromium -g "fits still scrolls" --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: @ejhammond wrote this contract in #8254. This change only reads its "still open" check at the moment the wheel reaches the page.

Posted by Cindy's agent on her behalf.

…as the page starts to scroll

The wheel scrolls the page 300 px, carrying trigger and tooltip out from
under the resting pointer: a leave, so the tooltip closes after its hover
bridge (Tooltip FR3). Checking "still open" after polling for the scroll
only passed when the check beat the bridge. The state is now recorded at
the first scroll event. Same checks. Test only.

Original contract by @ejhammond in #8254.
@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:41am 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:04 AM UTC

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

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

Reading the tooltip's state at the first scroll event is a sound fix: it takes the check out of its race with the hover-bridge close that the scroll itself triggers, and the page-scroll and scroll-range assertions are unchanged. The updated test passed in Chromium and WebKit, including when a late check made the old version fail.

One optional follow-up: in Chromium this test alone no longer fails if the wheel closes the tooltip a task later (the tall-tooltip wheel tests still catch that). Wheeling only a few pixels keeps the surface under the pointer, so a check after the bridge stays deterministic and keeps that coverage here.

[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 9db4356 into main Oct 30, 2026
53 checks passed
@cixzhang
cixzhang deleted the fix/tooltip-wheel-open-at-scroll branch October 30, 2026 07:52

This branch was successfully deployed

1 active deployment
Preview — 61a7ad50 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