Repository navigation
test(BottomSheet): the drag test waits for the sheet's own motion, not for fixed times - #9862
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| 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
There was a problem hiding this comment.
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]
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
openSheetwaits for the entrance's own end: the panel'stransformtransition ending, the signal the panel itself waits on. The listener is added before the click.transitionrun, instead of the computed transform 40 ms later.Related: #9772 made
openStorywait 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
mainb95497d, 10 runs each:38c5e6a012(main's waits), with the page's animations at 0.1× until the sheet counts as entered (DevToolsAnimation.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).e306bb561d(this change's waits), same rate: passes 20 of 20.maincd1e42c the same pair also passes at 0.5× and 0.25× and splits the same way at 0.1×.c064c1635b,47440a3526, onmaincd1e42c, same spec).Scope
Testing
Local, at 1318fab on
mainb95497d (Linux): BottomSheet's Chromium a11y contracts and browser specs, 51 passed. Strict ESLint (CI=true) and prettier on the spec. Coretscreports no error in it; its 3 errors, a generated locale file absent from this checkout, are the same onmain.