Skip to content

chore(gestures): a Storybook harness to check presented hit testing on a phone - #10067

Closed
cixzhang wants to merge 1 commit into
mainfrom
lane4/presented-hit-testing-lab
Closed

cixzhang wants to merge 1 commit into
mainfrom
lane4/presented-hit-testing-lab

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Supersedes #9400 by @vjeux: the same three files, rebuilt as one commit on today's main with his authorship. Its intermediate docsite commit conflicts with main and was replaced within the branch, so the net change is unchanged. Harness and story only: no library code, no API, and no changeset.

Maintainer impact

Presented hit testing (spec:AST-094 FR11, FR19) is proven in CI's WebKit lane and in the iOS Simulator. But no story, sandbox or docs page attaches the gesture host, so a phone that opens a preview cannot exercise it. A check on a physical iPhone needs a page that does.

Intended invariant

spec:AST-017 FR21 and architecture:react-component-runtime INV13: Core's internal entries and gesture source stay with Core and Lab. This pull request adds no import of them from outside Core. The harness is a Core file, and the story renders it the way the a11y stories render Core's __tests__ renderings.

Change

  • packages/core/src/__tests__/PresentedHitTestingLab.tsx (not exported): a sheet springs up over a full-page scrim on a spring slowed to a 3 s response, with Done in the sheet and a page behind it that scrolls.
    • It reads out what the engine hit-tested at each touch-down, Done's clicks and the scrim's taps, the sheet pan's translation, and how far the page scrolled in the last touch.
    • A native checkbox turns the gesture host's correction off, as the control.
    • Replay restarts the motion.
  • PresentedHitTestingLab.test.tsx: its unit test (3 cases).
  • apps/storybook/stories/PresentedHitTestingLab.stories.tsx: one full-screen story, "Presented hit testing" under "Core/Gestures".

Evidence

  • Unit test: passes (3 of 3). Strict ESLint passes.
  • Real Chrome at a phone viewport: the story renders the harness. Its correction only acts on iOS WebKit, which the status line says.
  • The check itself: opening this story on a physical iPhone, which the harness exists for.

…n a phone

A non-exported Core harness, PresentedHitTestingLab, that Storybook renders as
Core/Gestures "Presented hit testing": a sheet springs up over a full-page
scrim on a slowed spring, with Done in the sheet and a scrolling page behind
it, and reads out what the engine hit-tested at each touch-down. A native
checkbox turns the gesture host's correction off as the control.

Co-authored-by: Cindy Zhang <cindyxz@meta.com>
@vercel

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

Request Review

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

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot

astracat-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 5, 2026, 10:10 AM UTC

@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 a draft, and it starts once the pull request is marked ready for review.

The harness and story are test tooling only, with nothing exported or shipped. spec:AST-094 lets the real-device evidence for presented hit testing follow merge, so the iPhone run is the next step rather than a condition here. The corrected-tap test is a real guard: it fails when the harness host is forced to presentedHitTesting: 'never'.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 5, 2026 10:14
@cixzhang
cixzhang marked this pull request as draft November 5, 2026 10:14
@cixzhang cixzhang closed this Nov 5, 2026
@cixzhang
cixzhang deleted the lane4/presented-hit-testing-lab branch November 5, 2026 10:15

This branch was successfully deployed

1 active deployment
Preview — 18405d0a Deployed Nov 5, 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.

2 participants