Skip to content

test(BottomSheet): judge a soft flick by the release the page read - #10661

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/sheet-flick-page-release
Nov 8, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:test/sheet-flick-page-release

Conversation

@vjeux

@vjeux vjeux commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

In WebKit, the two BottomSheet flick proofs that land on the half detent fail with TouchPageStallError on loaded runners. They failed four times on Nov 7–8, 2026, including both attempts of a release's interaction check. In those runs the page's listeners took 4–6 ms an event, so the page read 929–1000 px/s where the script throws 1,225. The sheet still lands on half at that speed.

Intended invariant

A flick proof judges the release the page read, not the script's. The touch driver reads it: Core's velocity estimator over the page's own event stamps (PlayedEvent.release). The proof asks Core's release rule where that release lands: resolveSnapPoint, with the arguments useSheetGestures passes for a touch release. With the hook's own sheet.release constants and the measured detents, the proof follows the rule if it changes. Unless the rule lands the release on half, the proof fails by name. The landing assertions do not change.

Change

  • The two half-detent proofs drop releaseTolerance. They judge the page's release with pageRelease, landingOf and expectLandsOnHalf. In Chromium the page reads the script's stamps, so the check takes the script's release.
  • HALF_FLICK_TOLERANCE goes, with its comment that half starts at 1,008 px/s. That is UIKit's flick threshold; slower releases still land on half through the projection.
  • Core's 8 px drag slop, local to useSheetGestures, is copied with a SYNC note.
  • The dismiss proof keeps its tolerance, whose floor already matches UIKit's dismiss floor.

Evidence

  • Failure before the change: with the page's pointer listeners taking 5 ms an event, main fails both proofs 6 of 6 with TouchPageStallError (vjeux/astryx@1445a1d). Over two runs the page read 765–891 px/s, slower than in CI's failures.
  • Success after the change: the same stall passes 6 of 6 (vjeux/astryx@baf4074).
  • It still fails by name, in both engines, for a flick too slow or too fast for half. A 400 px/s flick reads 375 px/s (vjeux/astryx@ff33b22). A 2,600 px/s flick over 40 ms reads 2,525–2,811 px/s (vjeux/astryx@4056455). With 10 ms pointer and touch listeners (vjeux/astryx@439338b) the page reads 355–374 px/s, where the sheet lands on tall, and the check fails by name.
  • A unit checks the call's arguments for a long travel, a short one and one within the slop. It fails when the flick threshold ignores the slop (vjeux/astryx@5f7c0f4).
  • Product/runtime behavior verified unchanged: one test file changes.
  • CI impact (for a change to workflows, actions or CI scripts): none.

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

All runs use CI=1, CI's WebKit container (4 CPUs) and a Storybook build of main c99ad4a. They run the two half-detent proofs unless noted.

Run Main This branch
Page pointer listeners take 5 ms an event, 1 worker ×3 6 TouchPageStallError 6 pass
No injected stall, 1 worker ×10, interleaved 20 pass 20 pass
Whole spec file, 1 worker ×2: WebKit / Chromium (not run) 14 / 16 pass
4 workers ×10, interleaved (previous head; same verdicts at these speeds) 8 pass, 12 TouchPageStallError 10 pass, 7 by name (lands on tall), 3 TouchPageStallError

How the 4-worker numbers compare with CI. CI's failures on Nov 7–8 read 929–1000 px/s, with listeners taking 4–6 ms. This branch passes that case. With the 5 ms stall the page reads 765–891 px/s (main's arm, over two runs), and this branch passes it 6 of 6. At 4 workers, 7 of its failures read 355–533 px/s, where the sheet lands on tall. In the other 3, one listener took 47–56 ms, so the page read a resting finger. Both are heavier than any of those CI runs. Main failed those runs too, and also runs that read 625–892 px/s, which this branch passes.

Gates. pnpm test:node (17,553 pass), typecheck (core), eslint and prettier pass.

Overlap. No open pull request touches this spec except three drafts of more than 250 files (#8242, #8344, #8375), each over 1,400 commits behind main.

@vercel

vercel Bot commented Nov 8, 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 8, 2026 9:14am UTC

Request Review

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

astracat-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 8, 2026, 9:25 AM UTC

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 33f4f31

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
BottomSheet 65.5 kB (0) · 7.5 kB CSS (0) — ✓ · ✓ · —
BottomSheetSwitcher 17.9 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: cli 29 rows, core 35 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.

Requesting changes: the half-detent proofs should judge the release the page read, but the band they judge it against copies the sheet's release rule instead of asking it.

  • halfLandingBand (BottomSheetDetent.interaction.browser.spec.ts:110-131) re-implements resolveSnapPoint's touch release rule (projection, minimum speed, flick at or past its projection, drag slop) and already disagrees with it at the edges: at the proofs' geometry Core lands 540 px/s, and anything just above 2,040 up to 2,050 px/s, on half, which the band rejects; decide the page's release by calling resolveSnapPoint with the arguments useSheetGestures passes, and fail by name unless it returns the half detent.

Non-blocking: since this branch's merge base, the harness's boundaries.releasePxPerS judges a play at a component threshold. After a rebase, consider using or extending it so that BottomSheet and SnapPaging judge a page's release one way.

[Automated review]

The two flick proofs that land on the half detent judged the release
the page read against the script's, within a share of it. A page whose
own listeners take a few ms reads a slower flick, so the play threw
TouchPageStallError while the sheet still landed on half.

Each now asks Core's release rule where the release the page read
lands: resolveSnapPoint, with the arguments the sheet passes for a
touch release. The release is Core's velocity reading of the page's
own event stamps. Unless the rule lands it on half, the proof fails by
name. A unit checks those arguments for a long and a short travel.
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 8, 2026
@vjeux
vjeux force-pushed the test/sheet-flick-page-release branch from 1527c64 to 33f4f31 Compare November 8, 2026 09:08

@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, because the pull request is still a draft; marking it ready for review runs it.

The half-detent proofs now ask resolveSnapPoint, with the arguments the sheet passes for a touch release, where the release the page read lands. That resolves the earlier request to stop re-deriving the release rule, and the landing assertions still decide each proof.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 8, 2026 09:35
@cixzhang
cixzhang merged commit d6ad12b into meta:main Nov 8, 2026
135 checks passed
@vjeux
vjeux deleted the test/sheet-flick-page-release branch November 8, 2026 10:02

This branch was successfully deployed

1 active deployment
Preview — 33f4f315 Deployed Nov 8, 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