Skip to content

test(BottomSheet): the drag test waits for the sheet's own motion, not for fixed times - #9862

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c17-sheet-drag-test-wait
Nov 4, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c17-sheet-drag-test-wait

Conversation

@vjeux

@vjeux vjeux commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Maintainer impact

BottomSheetDrag.a11y.chromium.spec.ts's "a drag writes the transform per move and renders nothing between" fails under load. It waited a fixed 600 ms for the sheet's entrance and read the settle a fixed 40 ms after the release. When the entrance outlasts 600 ms, the drag starts mid-entrance; on a slow page the settle can be nearly over before the read. A loaded run of the BottomSheet folder failed it on #8105's head, while it passed alone.

Intended invariant

The test's assertions are unchanged: a drag writes the transform per move in a handful of commits, and the release animates back from where the finger left the sheet, then rests. No product code changes.

Change

  • openSheet waits for the entrance's own end: the panel's transform transition ending, the signal the panel itself waits on. The listener is added before the click.
  • The release reads where the settle starts from the settle transition's first keyframe, recorded on transitionrun, instead of the computed transform 40 ms later.
  • No timeout changes.

Related: #9772 made openStory wait until Storybook finishes the story's render. This spec opens its sheet with a button, so its wait is for the sheet's own entrance, which #9772 does not cover.

Evidence

Evidence arms, not for landing (on the fork), against one Storybook build of main b95497d, 10 runs each:

  • Failure before the change: 38c5e6a012 (main's waits), with the page's animations at 0.1× until the sheet counts as entered (DevTools Animation.setPlaybackRate): fails 20 of 20, in two order-balanced rounds of 10. The drag starts mid-entrance, so the trail steps back (23 of 24 samples rise).
  • Success after the change: e306bb561d (this change's waits), same rate: passes 20 of 20.
  • Control: at 1×, both pass 10 of 10. On main cd1e42c the same pair also passes at 0.5× and 0.25× and splits the same way at 0.1×.
  • DevTools CPU throttling (4×, 8×, 10×) does not separate them, because the entrance runs on the compositor: both pass 10 of 10 (c064c1635b, 47440a3526, on main cd1e42c, same spec).
  • Product/runtime behavior verified unchanged: test-only.

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

Local, at 1318fab on main b95497d (Linux): BottomSheet's Chromium a11y contracts and browser specs, 51 passed. Strict ESLint (CI=true) and prettier on the spec. Core tsc reports no error in it; its 3 errors, a generated locale file absent from this checkout, are the same on main.

…t for fixed times

BottomSheetDrag's "a drag writes the transform per move" waited a fixed
600 ms for the sheet's entrance and read the settle 40 ms after the
release. On a loaded page either race can be lost: the drag starts while
the sheet is still entering, or the settle is nearly over before the read.

It now waits for the entrance's own end (the panel's transform transition
ending, the signal the panel waits on), and reads where the settle starts
from the settle transition's first keyframe, recorded when it runs. No
timeouts change, and no product code changes.
@vercel

vercel Bot commented Nov 4, 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 4, 2026 2:58am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 4, 2026, 3:13 AM UTC

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

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 1318fab

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
BottomSheet 37.4 kB (0) · 7.5 kB CSS (0) — ✓ · ✓ · —
BottomSheetSwitcher 17.1 kB (0) · 3.4 kB CSS (0) — ✓ · ✓ · —

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

API changes: none in this pull request

Committed API report behind this build: core 2 rows; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


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.

This looks ready to approve. It is a test-only change, and the new waits key on the sheet's own CSS transitions instead of fixed delays.

The new waits hold when the sheet's entrance is slowed well past 600 ms, where the old fixed waits fail on the trail check, and both pass at normal speed. No changes are needed.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 4, 2026 03:14
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 4, 2026
@cixzhang
cixzhang marked this pull request as draft November 4, 2026 04:03
@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 04:03
@cixzhang
cixzhang merged commit 7d37fb5 into meta:main Nov 4, 2026
150 of 155 checks passed
@vjeux
vjeux deleted the uikit/c17-sheet-drag-test-wait branch November 4, 2026 05:22

This branch was successfully deployed

1 active deployment
Preview — 1318fab8 Deployed Nov 4, 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 A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) 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.

2 participants