Skip to content

fix(menu press): swallow a Home Screen app's late click after a pick - #12179

Merged
cixzhang merged 171 commits into
meta:mainfrom
vjeux:menu-standalone-compat-click
Nov 23, 2026
Merged

cixzhang merged 171 commits into
meta:mainfrom
vjeux:menu-standalone-compat-click

Conversation

@vjeux

@vjeux vjeux commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Base: main. Stack: #12179 → #12216. Both merge together, #12179 first. Review only its own change, d93fa3d..414ea36.

User impact

In a web app added to the iOS Home Screen, a finger's drag-select pick in a menu could click the control beneath. On an iPhone 11 Simulator with iOS 26.1, it happened in 4 of 4 drags at #11859's head and 4 of 4 at main. A Safari tab did not show it in 32 tries.

Problem and solution fit

At the release, the menu press model picks the row with its own click, whose detail is 0, and arms the click guard.

The guard cancelled the touch's touchend, then disarmed: in a tab no click follows a cancelled touchend. In the Home Screen app, WebKit still sends a trusted mousedown, mouseup and click, with detail 1, 9 to 35 ms after the pick. They land at the touch's start point, with no pointerdown between, and reach the control beneath. This happens whether or not the touchstart was cancelable.

Now the menu press model's arm stays armed after the cancelled touchend, for 400 ms, and takes those three events. It takes only trusted ones: a page's own click has no tracked gesture behind it, and acts. The next pointerdown still disarms it, and a click with detail 0 still passes.

Expected behavior and authority

spec:AST-094 FR26: one gesture acts at most once, and the browser's click for that gesture acts on nothing. spec:AST-094 FR21: when a gesture takes a touch, no click or compatibility mouse event reaches the page.

Smallest restoration

The click guard's options gain staysArmedAfterTouchEnd, set only by the menu press model's arms. The guard reads trust itself, and the unit tests stand in for that read through a test-only setter. Other arms keep the old rule; only the outside pan's and the box hold's also cancel a touchend. No public API, attribute or default changes.

Evidence

  • Reproduction before the change: the new unit cases fail without it (Testing, steps 1 and 8).
  • Result after the change: they pass (Testing, steps 2 and 8); the devices pass (step 9).
  • Representative unchanged path: the menus' accessibility and interaction specs pass (Testing, step 3).
  • Regression test or other mutation-sensitive proof: the new unit cases fail without the change.

Scope

Components: the click guard and the menu press model (useMenuPress)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

At 414ea36, which registers the trust read under a shared key, as the guard's state is. 00b99cf moves that read into utils/clickGuard.ts with no behavior change. The unit tests change only their import. 6aeaf3c merges #11859's head d93fa3d into 49fc0a1. That merge changes none of this pull request's 7 files. It brings #8080's 4651f21, which changes Popover/popoverSurfaceMotion.ts and Popover/usePopoverSurfaceMotion.ts. 49fc0a1 is one commit on 5fd736a that keeps the guard armed after a cancelled touchend, whatever the touchstart, for trusted events only (step 8). Steps 5 to 7 predate it, so they do not carry to it (spec:AST-094 DEC-31). Step 9 runs a real iPhone and an Android virtual device at 414ea36. 5fd736a merges #11859's stacked head 330eb1c into f396896. That merge brings main 4493a3c. It changes none of this pull request's 7 files. It changes DropdownMenu.tsx and utils/focusReturn.ts, which the tests here import. So step 7 at f396896 does not carry to 5fd736a. Step 9 repeats its held drag at 414ea36. Before that, f396896 merged #11859's b892503 into cc8b488, bringing main c1c5cdf. It changed none of this pull request's 7 files, and it changed the shared Layer/useLayer.tsx. Before that, cc8b488 merged #11859's c112acf, bringing main 230045a. That merge changed DropdownMenu's files, which the tests here import, and the shared gestures/GestureHost.ts. So the device runs in steps 5 to 7 at earlier heads do not carry to f396896 (spec:AST-094 DEC-31). Step 7 ran again at f396896. The Simulator steps 5 and 6 did not run again. Before that, 86bd90b merged #11859's 5752d21, bringing main cda6ca7. 7695cc7 merged #11859's ee30a11, bringing main 9e83b70. 8186977 merged #11859's 975f954 into d94f17e, bringing main be7f821's 39 files. None of those three merges changed a file here or a file they import. So the runs at d94f17e and 8186977 carried to 86bd90b. Earlier merges brought #11859's f5ce8f7 and 80a6e92 onto 4a5172d. The stack below changes useMenuPress.ts and its test, edited here, and Git merges both with no conflict. Through #9777, it also merges main ffd1c8e, which changes no direct import here. 4a5172d sits on #11859's ec5dba0. Its second commit changes only tests: one assertion, and the citations in test names and file headers. Its clickGuard.ts and useMenuPress.ts are 9c2a399's, and 8705b2d's. Every browser run serves a Storybook built at 8705b2d; its astryx-build-sha.txt names it.

  1. Red first at c3ef3a8: 4a5172d's unit tests on fix(menu press): cancel a pick's touchend on the node the touch began on #11859's ec5dba0, without the change.

    • jsdom, with pointer, touch and mouse events modeled. A touchstart that is not cancelable starts each case.
    • clickGuard.test.ts fails 2 of 21: the guard takes the compatibility events after the cancelled touchend, and its window restarts there.
    • useMenuPress.test.tsx fails 1 of 81: a pick's compatibility mousedown, mouseup and click reach the control the menu covered.
    • DropdownMenuPickTouchEnd.test.tsx fails 1 of 3: a radio item pick in a drill-in submenu, the same.
  2. With the change, at d94f17e (test): the three files pass (21, 84 and 3). useMenuPress.test.tsx gains feat(DropdownMenu): a finger's open grows the menu out of its trigger #8080's cases. A click with detail 0 still passes, and the next pointerdown still disarms the guard. After the window, a tap's click reaches the page.

  3. Unchanged paths: fix(menu press): cancel a pick's touchend on the node the touch began on #11859's browser spec passes in Chromium and in WebKit's CI container, 3 of 3 each, also at d94f17e. There DropdownMenu's, the hooks', Layer's and Popover's interaction specs pass in Chromium (194 pass, 11 skip) and in WebKit's container (151 pass, 54 skip). DropdownMenu's, ContextMenu's, Selector's, the hooks' and Layer's accessibility specs pass in Chromium (385). At 8705b2d, DropdownMenu's, ContextMenu's, Selector's and the hooks' accessibility specs pass in Chromium (293). DropdownMenu's and the hooks' interaction specs pass in Chromium (53 pass, 2 skip) and in WebKit's container at one worker (49 pass, 6 skip).

  4. In Chromium and in WebKit's CI container, the specs' touches start cancelable. So only an iPhone Simulator in a Home Screen web app shows the defect.

  5. iPhone 11 Simulator, iOS 26.1 (test), at d94f17e against main ffd1c8e. Each build opens from the Home Screen as a web app.

    • A temporary story puts a DropdownMenu over a native button and an Astryx Button. Both builds add it and a passive event logger; neither is committed.
    • Each take starts on the row over a control, drags up two rows and lifts. The takes are a swipe and holds of 2 s and 3 s.
    • Four takes start over each control, so each build has 8.
    • At main, the late mousedown, mouseup and click reached the control under the start point 10 to 35 ms after the pick. Its handler ran in 8 of 8.
    • At d94f17e, the same three events came, default-prevented and stopped before the window's bubble phase. The control acted in 0 of 8.
    • Earlier takes agree: 6 of 6 reached the control at fix(menu press): cancel a pick's touchend on the node the touch began on #11859's ec5dba0, and 0 of 6 at 9c2a399, which has this code.
  6. In a Safari tab, the same drags brought no late event in either build, in 4 of 4 takes each. Nothing beneath acted.

    • There the touchstart was not cancelable either, as in the Home Screen app. So the guard stays armed after the touchend, but no event comes for it to take.
    • Earlier, at 9c2a399, 8 of 8 tab takes were unchanged, and the next take's tap opened the menu.
  7. iPhone 14 (test), iOS 26.2 with Reduce Motion off, at f396896 against main c1c5cdf. The phone read each build's version.json before the takes, and the builds alternated.

    • On the ButtonVariants story, a finger opens Secondary's menu. It presses "Option 1", which lies over the Ghost button, drags onto "Option 2" and lifts.
    • From the Home Screen, each build gets 3 quick drags and 3 drags after a 2 s hold. In a Safari tab, each build gets 2 of each. Each reading comes about 1.2 s after the lift.
    • From the Home Screen, at f396896, the menu closes on "Option 2", and nothing opens under Ghost, 6 of 6.
    • At main, the menu closes the same way, and then Ghost's menu opens, 6 of 6. The late click reached the control beneath.
    • In a Safari tab, neither build opens Ghost's menu, 4 of 4 each.
    • The phone's accessibility tree has no aria-expanded. So "nothing opens" means no Ghost menu rows in the tree. Every frame of the six takes on the stills sheet agrees.
    • No take is left out.
    • This real-device take carries the iOS claim (spec:AST-094 DEC-27).
  8. The trust rule, at 49fc0a1 (test). An iPhone 17 Pro Simulator with iOS 26.2 motivates it; it is not device evidence (spec:AST-094 DEC-27). In 24 Home Screen takes, every picked touch's touchstart was cancelable.

    • In the 20 held takes, the late mousedown, mouseup and click still came after the cancelled touchend. They reached the control at f396896 and at main alike, 10 of 10 each; the 4 quick swipes brought none.
    • Red first at 5fd736a, with this commit's tests: 4 of 111 fail. Each is a trusted late event after a cancelable touchstart: two guard cases, one press model case and a radio item pick.
    • With the change, 111 of 111 pass. A page's own click after the cancelled touchend acts, in the guard's new case and in main's FR5 case.
    • DropdownMenu's, ContextMenu's, MoreMenu's, Popover's, Layer's and the gestures' unit files pass, with the hooks' and utils': 4,804 of 4,804.
    • Limits: no browser spec can reproduce WebKit's late click. Chromium sends no compatibility event after a cancelled touchend, so the real red is a Simulator or a device.
    • VoiceOver and Switch Control activations within 400 ms of a pick are unverified. They normally bring their own pointerdown, which disarms the guard. Real assistive-technology observation does not gate this change (spec:AST-009 FR17).

The grow and keyboard handling that this head carries from below have their device results in #8080 and #9777.

  1. Old against new (test), 6aeaf3c against 414ea36, on a real iPhone 14 with iOS 26.2 and an arm64 Android virtual device with Chromium 160. On the phone, the held pick ran in a Home Screen web app and in a Safari tab. The other rows ran in a Safari tab. Each row ran 3 times per head, with the same result at both heads.
    • The held pick: the menu closes on "Option 2", and Ghost's menu does not open beneath it.
    • A script click inside the guard's armed window, 50 ms after a tap pick, opens Ghost's menu. A page's own click still acts.
    • A plain script click on "Option 2" picks it, and the menu closes.
    • An open and close: the menu opens with its rows and closes on a tap outside. On the Android device the trigger shows no focus ring; on the phone its box does not move.
    • Each take was checked against a screenshot of the page.

At 49fc0a1, the core type check, ESLint and Prettier pass on the changed files. At 414ea36, the utils folder and the two other unit files pass: 70 files, 1,384 of 1,384 (test). The core type check, ESLint and Prettier pass there too. scripts/shared-identity.test.mjs fails 1 of 7 at 00b99cf and passes 7 of 7 at 414ea36 (test). Local gates at f396896: the ui project (26,798, at 16 workers), the core type check, pnpm check:knowledge and pnpm check:repo pass. ESLint and Prettier pass on the changed files, with main's lint config. At 4a5172d, strict ESLint, Prettier and pnpm review:pre pass. This pull request changes no file under packages/cli.

At the live head (test), 46a28a5 has 67dc9e9's tree: an empty commit on it re-triggered the preview.
The held pick then ran on a real iPhone 14 against its own preview, side by side with 414ea36 (test). The record is https://github.com/vjeux/astryx/blob/f2c3b3df94403186247da3b0cccdb649db349a7f/index.md.

  • The held pick closes Secondary's menu, and Ghost's menu does not open, 3 of 3 on both heads. That holds in a Home Screen web app and in a Safari tab.
  • An open and an outside tap close the menu, and the trigger's box does not move, 3 of 3 on both heads, in both hosts.
  • In Safari, focus ends on Secondary after the pick and on the page body after the outside tap, on both heads.
  • So the focus difference below comes from fix(DropdownMenu): a finger's touch outside only closes the menu #12216's outside hold, not from this change.

67dc9e9 merges main c1edfa4, where #8080 and #11859 are merged. Its own change is byte-identical to 414ea36's, so its diff against main is only that change.

The device runs above do not carry to it: main changes code its menus run (spec:AST-094 DEC-31). Those changes include Layer/inputHold.ts (#13436, #13526), utils/scrollView.ts (#12888), motion/animator.ts (#9763, #13138), Popover/Popover.tsx and hooks/useAttachment.ts (#13155), and utils/focusReturn.ts (#11156, #13555).
They ran again side by side with 414ea36 (test). The record is https://github.com/vjeux/astryx/blob/3ce1f44223f224cd7b2d9d582d347ec5ab0e577e/index.md. Every pass rule gives the same result on both heads.

  • The real Pixel 8 and iPhone 14 rows ran on fix(DropdownMenu): a finger's touch outside only closes the menu #12216's head a9e8913, which holds all of this head. 67dc9e9's own preview did not deploy. The Android emulator rows ran on a static build of 67dc9e9.
  • The held pick passed 3 of 3 on both heads in every profile, in an iPhone Home Screen web app too. Secondary's menu closed on "Option 2", and Ghost's menu did not open.
  • A page's click on Ghost 50 ms after a tap pick opened Ghost's menu, 3 of 3 on both heads. A page's click on "Option 2" picked it, 3 of 3.
  • On an open and an outside tap, the rows show and the menu closes, 3 of 3 on both heads. The trigger shows no ring, and its box does not move.
  • One difference shows in the iPhone's Safari tab. After the outside tap, focus returns to the trigger at a9e8913, and goes to the page body at 414ea36 and at main.
  • fix(DropdownMenu): a finger's touch outside only closes the menu #12216's outside hold makes that difference. The tap's compatibility mouse events no longer reach the page, so the returned focus stays on the trigger.

The strict pnpm preflight --browser passes at 67dc9e9, which has 46a28a5's tree, and it reports "ready to flip". Its Chromium interaction step passes 1,946 tests and skips 54.

#12179 and #12216 are merged together as one stack by the maintainers' merge guard (merge-guard --stack 12216), #12179 first. #12179 never merges alone.

Public and internal API delta

None public. No export, prop, type, default or attribute changes. The click guard's internal ClickGuardOptions gains staysArmedAfterTouchEnd.

Review only this pull request's change: vjeux/astryx@d93fa3d...414ea36

Stack: #12179 → #12216

vjeux and others added 30 commits November 3, 2026 06:35
progressCurve, mapProgress, mapRange and presentedProgressVelocity in
motion/progress.ts, internal, one velocity unit (progress per second).
Rebuilt on main from the pull request's own change, without the open
dependency chain it no longer needs.

Co-authored-by: Cindy Zhang <[email protected]>
…ressCurve

CodeBunny on meta#9755: springProgress solved the same spring as progressCurve.
It now reads progressCurve (remaining = 1 - progress), so one implementation
remains. Same curve, same settle epsilon (0.001) and duration.
…shows at each progress

lerpPath, edgeGrowPath, each path's restartFrom and morphCurves in
motion/morphPath.ts, internal. Pure geometry over a progress curve: the
caller chooses the timing. Rebuilt on the progress module from the pull
request's own change, without the open chain it no longer needs.

Co-authored-by: Cindy Zhang <[email protected]>
# Conflicts:
#	packages/core/src/motion/README.md
… source rect

createRectMorph in motion/rectMorph.ts, internal: present along a path and
dismiss back onto a copy or the element, each continuing the other from the
rect on screen. Rebuilt on main from the pull request's own change and
ported to main's engine (createMotionAnimator).

Timing follows the owner's rule for touch motion: present and dismiss take
a motion, either a theme duration and easing (a tap, a key, the program) or
a spring (a gesture's release, from its velocity). timedProgressCurve joins
the progress helpers. architecture:react-component-runtime INV12 records the
implementation gap: the size-change glide moves onto the morph next.

Co-authored-by: Cindy Zhang <[email protected]>
Each passes its input to `useMobileKeyboard` from its own render, with
no prop and no Effect of its own. On focus the field decides where it
is: inside a keyboard target such as a Tall BottomSheet it moves
nothing; in an app's bar docked at the viewport's bottom, the bar rides
the keyboard, its bottom on the keyboard's top; in scrolling content,
its nearest scroller, the document included, scrolls it 10 px above the
keyboard in the keyboard's report. In a fixed container the app
positions itself, a scroller around the field reveals it, and with none
the browser's own reveal stays. Its first tap and focus moves into it
arrive without the browser's reveal where the module places the field,
so the page never pans there.

A scroll area does not gain the range it lacks at its end yet. Where a
field's scroll area cannot place it, the document reveals it, in the
page and in a fixed container where the document's scroll moves the
container, as in Safari while its keyboard shows; elsewhere Core scrolls
the document back. Where the document cannot scroll far enough, as at a
short page's end in Chrome, a pan of the visual viewport takes the rest
in the same frame (`panVisualViewportTo`): a probe fixed in the layout
viewport is scrolled into view, as the reveal-pan watch puts a pan back.
The watch takes Core's own pan as the new rest. Firefox for Android does
not pan for the probe. A page with nothing to scroll keeps the browser's
own reveal.

On Chrome's show, a docked bar first sets its field 4 px above the
keyboard's top at once, as the Tall sheet does, and only the rest rides,
so Chrome's own pan finds the field clear. Every viewport report now
feeds the ride's reveal-pan watch, so a pan Chrome still makes is put
back, and a pan made at one keyboard height goes back at the next.
Under Remove animations, Gboard first reports a keyboard 48 px tall,
and Chrome may then reveal the bar's field itself: it scrolls the page
behind the bar, then pans. In Chrome, the ride's watch scrolls the
document back as well, when the scroll and the pan centre the field as
Chrome's reveal does; the app's own scroll to another element stays.

On iOS, a reveal that places the field rises on the browser's smooth
scroll from the keyboard's first report, which comes as the keyboard
starts to slide, so the field rises beside it (`risesSmoothly`, which
reads Core's iOS WebKit check, `isIosWebKit`). The scroll back records
where the rise is headed, and a rise still on its way when the keyboard
changes height carries on from its target. Under Reduce Motion, in a
theme that reduces motion for everyone, and in Chrome, which checks the
field in the resize's own commit, the reveal moves at once. The rise and
the scroll back ask the motion module's new `reducesMotion`, beside
`reducedMotionFade`, which now uses it, so a theme that reduces motion
for everyone counts as the setting for both. A scroll area's reveal goes
through its own `scrollBy` with an explicit behavior where it has one,
so a smooth `scroll-behavior` on the area cannot slow an instant reveal,
as the Tall sheet's reveal already does.

When the keyboard closes, each scroller a reveal moved scrolls back to
where it was (keyboardScrollBack.ts), on the browser's smooth scroll.
Safari on iOS reports the keyboard gone about half a second after the
blur that closes it, once it is down. There the scroll back starts at
that blur, once the focus change settles on nothing that brings up a
keyboard with no finger on the screen, and slides down beside the
keyboard; the report only confirms it. A finger then can be a tap that
brings the keyboard back, so the report decides, as elsewhere and under
Reduce Motion, where the scroll lands at once. Safari applies a scripted
scroll a frame late, so a scroll set each frame jitters. A scroller the
person scrolled meanwhile keeps their scroll. A field that gains focus
during the slide stops the scroll back where the page is
(`stopKeyboardScrollBack`), and its reveal goes on from there as Core's
own scroll. A sandbox page puts three fields in the middle of a page
that scrolls the document.

Each field's `.keyboard.test.tsx` drives the keyboard module's test
double. Mobile keyboard stories on TextInput place the fields low in the
page, a TextInput in a toolbar fixed at the bottom (docked, floating
above the edge, or with its own `translate`), a last field at the end of
a short page and of a scroll area, a scroll area low on the page, a
scroll area in a floating panel and in a full-viewport panel, and a
field in a sheet of a set height.

Firefox for Android can carry the reveal's document scroll as a
visual-viewport offset, show the document where it was before the
reveal at the keyboard's hide report, and turn the offset back into a
document scroll only after it. The scroll back then waits up to a
second for the first document scroll: one that lands where Core left
the document is the browser's own, and the scroll back follows it. A
touch, a keyboard that comes back, the field's page going, or the
wait's end puts nothing back.

The reveal-pan watch's touch flag now holds through a report that comes
while a finger is on the screen. In Firefox the toolbar hides in a drag,
which changes the measured keyboard height mid-drag; the watch then took
the drag's own pan for the browser's and put it back. The input stream
now counts the fingers on the screen from touch events
(`isTouchOnScreen`), only while `touchend` and `touchcancel` are heard.
A native pan keeps a finger there, though its `pointercancel` drops the
press from `getDownPresses`, so that record cannot serve. The watch's
shared touch subscription hears those two types, and a report reads the
count.

After the show's first reveal, a keyboard report reveals nothing while a
press that started after the last reveal is down. In Firefox the toolbar
hides in a drag, and the reveal re-applied itself with small scrolls
under the person's finger. The report's height is kept, so the field
stays where the person put it, and a later report with the finger up
reveals it as before. The press that focused the field holds nothing: a
long press focuses with the finger still down, and Gboard can report a
48 px keyboard first, then its full height. The input stream also counts
the touches that start (`getTouchStartCount`), and each reveal notes
that count. The keyboard module reads the finger count through
`isFingerOnScreen`: a finger down at the keyboard's last hide counts no
more until a touch starts, since a touch whose target leaves the page
ends at a node the window never hears. The count includes a stylus,
whose drag moves the page as a finger does.

Nine unit tests cover the scroll back from the blur on iOS: it starts at
the blur and the report moves nothing more; focus that moves on to
another field or into a frame keeps the page; a finger on the screen at
the blur leaves it to the report; a person's scroll stands; Reduce
Motion waits for the report; a field focused again during the slide
stops the scroll back and rises from where the page is, or stays where a
touch stopped it with nothing left to raise; and the next close goes
back to the first place, at a blur or at a report.

Six unit tests cover the scroll back: the page's smooth scroll at the
report (nothing before it), Reduce Motion, a theme that reduces motion,
a person's scroll kept, a scroll area after Back, and a focus move to
another field. Firefox-shaped cases carry the reveal as an offset and
close the keyboard before the fold: the scroll back follows the fold, a
touch-drag control keeps the page, only the first document scroll
counts, and each way the wait ends leaves no scroll listener. Safari's
and Chrome's close sequences still decide at the report, with no wait. A
Firefox-shaped drag grows the viewport twice with the finger down and
finds no put-back; after the finger is up, a browser pan is put back.
Another drags the page with the toolbar hiding twice and finds no reveal
scroll until the finger is up. A long press focuses the field while
Gboard grows from 48 to 290 px, and the field is revealed at 290; the
next show's first reveal runs again under the same press, and a press
that starts after the reveal holds the next report until it lifts. After
the keyboard goes with no finger down, a long press that brings it back
is revealed with that press still down. Another holds a report while the
long press's finger stays down after a second finger tapped and lifted.
Another misses a touch's end, as when its target leaves the page, and
finds a browser pan put back once the keyboard has hidden and shown
again. The input stream's tests count fingers through a second finger, a
cancel and a native pan's `pointercancel`, count nothing while a touch
end could go unheard, and count the touches that start. Six cover the
rise on iOS: its smooth scroll, Reduce Motion, a theme that reduces
motion, the scroll back after a rise drawn later, a rise carried on at a
new height, and no second reveal while a scroll area's rise is drawn.
Their CSS.supports stub answers both of Safari's forms, a property and
value or a condition. Another drives a scroll area with a smooth
`scroll-behavior` and finds its own `scrollBy` called at once. Two in
the motion module cover `reducesMotion`: the setting, and a theme that
reduces motion for everyone.
…opy dismissal

CodeBunny on meta#9769: a dismissal onto a copy detached the animator, and a
handed-in one was never attached again, so its owner's writes stopped
reaching the element. Only the morph's own animator lets go now.

Co-authored-by: Cindy Zhang <[email protected]>
…er and the morph

CodeBunny on meta#9769: solveAnimatedPageScroll already played this curve and
keeps the velocity of the move it retargets. timedCurve in progress.ts is
now that one curve; the pager and the morph's timed motion call it, so a
timed present that interrupts a dismissal keeps its velocity. The INV12
note states the system only. File header and comments trimmed.

Co-authored-by: Cindy Zhang <[email protected]>
CodeBunny on meta#9769: with nothing in flight the morph handed timedCurve a
velocity of 0, which it treats as a retarget and uses to cancel the
easing's starting slope. Only a motion in flight hands its velocity on now;
tests check a present from rest and a dismissal from a settled present
against the easing itself. Header and comments shortened.

Co-authored-by: Cindy Zhang <[email protected]>
The type's doc, the example and the changeset name no rule of their own
about which input plays which timing: each play takes the timing the
adopting component's motion record names (AST-094 FR45).

Co-authored-by: Christopher Chedeau <[email protected]>
FR9's scrolling-content bullet adds the spec owners' sentence: where a
browser carries out the document's scroll by moving the visual viewport,
that offset is the reveal, not a pan. Gap 2 is met. Gaps 1, 10 and 11
say what the three fields now do. Gap 11 keeps the missing scroll range
as the fix; until a scroller gains it, Core pans the visual viewport
where the document cannot scroll far enough.

Two verification rows cover Firefox for Android (the offset equals the
computed reveal) and Chrome (no pan added after Core places the field).
Chrome's names the cases Core pans, and fails a field Core pans that
ends other than 10 CSS px above the keyboard. In Firefox for Android
the pan moves nothing where the page has no scroll range; Gap 11 names
those cases.
The device-evidence row records that a docked toolbar resting under the
keyboard while a field outside it has focus is not a failure.
BottomSheet's height doc says what such a field gets in a sheet that is
not a fully expanded Tall sheet.

FR9's scrolling-content bullet adds the close: each scroller that
revealed the field scrolls back to where it was before the reveal, and
a scroll the person made while the keyboard showed is kept. A
verification row covers a field in the middle of a page that scrolls
the document.

FR9's scrolling-content bullet adds the open: on iOS the field rises on
the browser's own smooth scroll beside the keyboard's slide, settling
within 0.15 s after the keyboard settles, and it moves in one frame
under Reduce Motion, in a theme that reduces motion for everyone, and in
other browsers. A verification row reads every drawn frame of the rise.
Gap 13 records Chrome's rise, which stays in one frame because Chrome
checks the field in the resize's own commit; Firefox for Android takes
the same path. The device-evidence row's
failure for a reveal later than the keyboard's report notes that on iOS
the rise starts in that frame and settles as FR9 states.

FR9's scrolling-content bullet adds the hold: a show's first report
always places the field, and a later report that comes while a finger
is down, after a touch has begun since the field's last placement,
moves nothing.

FR9's close adds that at the hide report, Firefox for Android can still
show the document where it was before the reveal, and turns the reveal
back into a document scroll only after that report; the scroll back
follows that scroll. A row closes the keyboard with Back in
Firefox for Android at normal speed and on a slow profile.

The input-fields family's FR13 status says the same: the three fields
meet FR13 through FR9, apart from Gap 11.

FR9's close now starts the scroll back at the blur that closes the
keyboard in Safari on iOS, beside the keyboard's slide; the report that
the keyboard has gone comes later and only confirms it. Elsewhere it
starts at that report, and under Reduce Motion, and in a theme that
reduces motion for everyone, it lands at once there. A scroller the
person scrolled keeps the person's scroll, a finger on the screen at the
blur leaves the scroll back to the report, and a field that gains focus
during the slide stops the scroll back where the page is. Safari's close
row reads every drawn frame from Done until the page rests, and adds a
tap on the field 80 ms and 150 ms after Done. The open sentence is
rewrapped, word for word.
Main renamed the engine's factory to createMotionEngine. The merge
takes that name in the test bundle and in rectMorph and its tests.
The morph's comment cited AST-094 FR45 as its only link to that
record. AST-094 now lists the file, and the comment keeps the fact
without the citation. The proof imports `test` from the a11y-spec
package, whose contexts reach no remote host, as main's lint asks.
The pager's timed settle takes its curve from motion/progress.ts, so
the hook adds that module over Carousel alone. The bundle test lists
it as pager code.
The morph's popover proofs played a copy of Popover's growth that had
drifted: it lacked the overlap rule, so an overlapping popover grew
from its left edge where Popover grows from its top. The proofs now
import popoverCollapsedState, popoverFrame and frameOf from Popover.
A new overlapping case, which the deleted copy fails, pins the growth
from the top edge.
The rect morph's timedProgressCurve played, from rest, the curve that
easedProgress already plays for Popover, SegmentedControl and the
layout glide. easedProgress moves into progress.ts and takes an
optional velocity: the Hermite carry that the pager and the morph use.
From rest its values do not change. Its velocity is a central
difference that stays inside the curve, and from rest it starts on the
curve's own slope. timedProgressCurve goes, and timedCurve maps
easedProgress onto values, keeping only its carry for no distance.
The morph's turn-around proof compared restartFrom with lines written
in the test, so a change to Popover's readState or surfaceCurves left
it green. Popover exports both for the proofs, which now replay its
own turn-around. morphPath.ts's header keeps only its tags: the
paths' own JSDoc says the rest.
The note said timedProgressCurve joins the progress helpers, which
this pull request no longer adds. It now says easedProgress moves to
them with a retargeted velocity, and timedCurve joins them.
Main's Popover touch growth, which plays on the surface and floors its
opacity curve with motion/opacityFloor.ts, meets the rect morph's move
of easedProgress into motion/progress.ts in the imports of
popoverSurfaceMotion.ts. The merge keeps both: the floor's import, and
easedProgress from progress.
Popover's surface curves now stop their opacity at 0 or a floor above
it. Past its end, a turn-around toward the source takes the popover
path's opacity below 0, where Popover's stops at 0. An opacity draws
clamped to 0 through 1, so both draw 0. The proof now compares the two
as drawn, which holds with Popover's curves before and after the
floor.
A popover's grow path read its opacity on a straight line, so before
its start and past its end it went below 0: a turn-around toward the
source read -0.025 at 1.05. An opacity below 0 draws as 0, so
opacityAt now stops at 0. The popover proofs compare opacities as
drawn, since Popover's own model still reads below 0 there.
Under a finger or a pen, a DropdownMenu or MoreMenu trigger opens its
menu as it is pressed, instead of after a 500 ms hold (spec:AST-094
FR29, FR43). Inside a scroll view it opens once the 150 ms
content-touch delay passes with no scroll, so a scroll that starts on
the trigger still scrolls. The finger that opened the menu picks a row
only after moving 10 px. presentation="popover" keeps the previous
behavior.

useMenuPress with no longPressDelayMs follows the same rules, and
longPressDelayMs: 500 keeps the previous hold.
The anchored menu's case modeled a straight line from a 22 px square on
its control. The menu now grows out of its trigger on Popover's edge
path, which the popover cases already check, so the case no longer
describes any presentation's model. The file header follows.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 00b99cf

@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 pull request is reviewed as part of its stack; see the review on #12216.

Automated review (maintainer link)

The trust read is module state that the test-only setter changes, so it
sits under a registered key (sharedKey and realmValue), as the guard's
own state does. A second copy of Core then reads trust the same way.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 414ea36

@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 pull request is reviewed as part of its stack; see the review on #12216.

Automated review (maintainer link)

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

Engineering-owner approval at this exact head (414ea36), posted by Cindy's agent on her instruction. CodeBunny approves at this head, CI (including heavy) is green, and Cindy checked the stack's previews herself.

@vercel

vercel Bot commented Nov 23, 2026

Copy link
Copy Markdown

Deployment failed for project astryx with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

vjeux added a commit to vjeux/astryx that referenced this pull request Nov 23, 2026
# Conflicts:
#	packages/core/src/Layer/inputHold.ts
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 67dc9e9

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

Changes requested: the click-guard change reads correctly and its new menu tests fail without it, but no real-iPhone take has run this revision's own code.

  • The iPhone rows the description adds ran on #12216's head, which also changes Layer/inputHold.ts (imported by hooks/useMenuPress.ts) with its own handling of WebKit's late Home Screen click, and the earlier takes do not carry across this revision's merge of main (spec:AST-094 DEC-27, DEC-31), so the description needs the held drag-select pick run on the iPhone against a build of this revision, in a Home Screen web app and a Safari tab, side by side with the previous revision.

Non-blocking: the comment at utils/clickGuard.ts:251 still contradicts the header lines this change adds (see the existing inline note). This review covers this pull request's own change as the bottom of its stack with #12216; CI has not run on this revision yet because the pull request is a draft.

Claims and files checked

Review mode: same-head; reason: none

  • Claim, release note: a finger's pick in a Home Screen web app no longer clicks the control beneath, for every press-model menu: the code does this (clickGuard.ts:248-262, useMenuPress.ts:694, :728); an iPhone take of this revision is missing.
  • Claim, release note: the guard stays armed for 400 ms from the cancelled touchend or until the next press: verified (clickGuard.ts:79, :197, :261; clickGuard.test.ts:451).
  • Claim: the menu model picks with its own detail 0 click and arms the guard: verified (useMenuPress.ts:633-638, :689).
  • Claim: after the touchend only browser-sent events are taken, and a page's own click acts: verified (clickGuard.ts:156, :215; clickGuard.test.ts:426).
  • Claim: the next pointerdown disarms and a detail 0 click passes: verified (clickGuard.ts:197, :361).
  • Claim: the new option is set only by the press model; only the outside pan and box hold arms also cancel a touchend: verified (Layer/outsidePanClaim.ts:51, utils/boxHold.ts:84).
  • Claim: the guard reads trust itself, and tests substitute it through a test-only setter: verified (clickGuard.ts:60-72, :331-335).
  • Claim: no public API, attribute or default changes: verified (the API generator lists no changed rows).
  • Claim: +388/−24 lines: verified.
  • Claim: the new unit cases fail without the change: verified (removing the press model's option fails exactly the four new menu cases).
  • Claim: this revision merges a main that already holds the lower pull requests, and its own change is byte-identical to the previous revision's: verified.
  • Claim: that merge changes code the menus run, so the earlier device runs do not carry: verified.
  • Claim: the new real-phone rows ran on the top pull request's head, which holds this revision: it holds it, but it also changes the input hold and the menu component, so those rows do not cover this revision.
  • Claim: this revision's own preview did not deploy: verified (the deployment status failed).
  • Claim: the Android emulator rows ran on a build of this revision: stated; the release note makes no Android claim.
  • Claim: one iPhone difference between the two heads comes from the top pull request's outside hold: consistent with that pull request's input-hold change, and it confirms the heads behave differently.
  • Claim: the strict browser preflight passes at this revision: stated, not rerun; CI has not run.
  • Claim: the two pull requests merge together, this one first: the stack declaration holds; the merge tool is outside the repository.
  • Claim: shared-module size deltas on the four reference pages: reported.
  • Claim: no file under the CLI package changes: verified.
  • File .changeset/menu-pick-late-click-home-screen.md: needs an iPhone take of this revision.
  • File packages/core/src/utils/clickGuard.ts: clear, one non-blocking comment at line 251.
  • File packages/core/src/hooks/useMenuPress.ts: clear.
  • File packages/core/src/utils/clickGuard.test.ts: clear.
  • File packages/core/src/hooks/useMenuPress.test.tsx: clear.
  • File packages/core/src/DropdownMenu/DropdownMenuPickTouchEnd.test.tsx: clear.
  • File packages/core/src/DropdownMenu/__tests__/DropdownMenuPickTapThrough.interaction.browser.spec.ts: clear (comment and title only).

Automated review (maintainer link)

// No click follows a cancelled touchend.
disarmClickGuard(doc);
if (!staysArmedAfterTouchEnd) {
// No click follows a cancelled touchend.

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.

Non-blocking (source comments): this line now contradicts the header lines 41-43 added here, which say WebKit can still send that click. Suggested: // Other arms keep the old rule and disarm here.

vjeux added a commit to vjeux/astryx that referenced this pull request Nov 23, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 46a28a5

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

Changes requested: the click-guard change reads correctly and its new menu tests fail without it, but no real-iPhone take has run this revision's own code.

  • The iPhone rows in the description ran on #12216's head, which also changes Layer/inputHold.ts (imported by hooks/useMenuPress.ts) with its own handling of WebKit's late Home Screen click, and the earlier takes do not carry across this revision's merge of main (spec:AST-094 DEC-27, DEC-31), so the description needs the held drag-select pick run on the iPhone against a build of this revision, in a Home Screen web app and a Safari tab, side by side with the previous device-tested revision.

This revision's preview has deployed, so one stated take on it settles this; the spec approval posted for this revision does not stand in for that take. Non-blocking: the comment at utils/clickGuard.ts:251 still contradicts the header lines this change adds (see the existing inline note). This review covers this pull request's own change as the bottom of its stack with #12216; CI has not run on this revision because the pull request is a draft.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none.
  • Claim, release note: a finger's pick in a Home Screen web app no longer clicks the control beneath, for every press-model menu: the code does this (clickGuard.ts:250-261, useMenuPress.ts:694, :728); an iPhone take of this revision is missing.
  • Claim, release note: the guard stays armed for 400 ms from the cancelled touchend or until the next press: verified (clickGuard.ts:79, :197, :261; clickGuard.test.ts:451).
  • Claim: the menu model picks with its own detail 0 click and arms the guard: verified (useMenuPress.ts:630-638, :689).
  • Claim: WebKit sends the late events shortly after the pick, where the touch began, whatever the touchstart's cancelability: a device observation; the unit cases model both kinds of touchstart.
  • Claim: after the touchend only browser-sent events are taken, and a page's own click acts: verified (clickGuard.ts:156-160, :215-217; clickGuard.test.ts:426).
  • Claim: the next pointerdown disarms and a detail 0 click passes: verified (clickGuard.ts:197, :361).
  • Claim: the new option is set only by the press model; only the outside pan and box hold arms also cancel a touchend: verified (Layer/outsidePanClaim.ts:51, utils/boxHold.ts:84).
  • Claim: the guard reads trust itself, and tests substitute it through a test-only setter: verified (clickGuard.ts:60-72, :331-335).
  • Claim: no public API, attribute or default changes: verified (the API generator lists no changed rows).
  • Claim: +388/−24 lines: verified.
  • Claim: the new unit cases fail without the change: verified (removing the press model's option fails exactly the four new menu cases; all 113 pass with it).
  • Claim: this revision's own change is byte-identical to the earlier device-tested revision's: verified.
  • Claim: the merge of main changes code the menus run, so the earlier device runs do not carry: verified.
  • Claim: the real-phone rows ran on the top pull request's head, which holds this revision: it holds it, but it also changes the input hold and the menu component, so those rows do not cover this revision.
  • Claim: this revision's own preview did not deploy: no longer true; its preview has now deployed.
  • Claim: the Android emulator rows ran on a build of the previous revision: its tree equals this revision's; the release note makes no Android claim.
  • Claim: one iPhone difference between the two heads comes from the top pull request's outside hold: consistent with that pull request's input-hold change, and it confirms the heads behave differently.
  • Claim: the strict browser preflight passes: stated, not rerun; CI has not run.
  • Claim: the two pull requests merge together, this one first: the stack declaration holds; the merge tool is outside the repository.
  • Claim: shared-module size deltas on the four reference pages: reported.
  • Claim: no file under the CLI package changes: verified.
  • File .changeset/menu-pick-late-click-home-screen.md: needs an iPhone take of this revision.
  • File packages/core/src/utils/clickGuard.ts: clear, one non-blocking comment at line 251.
  • File packages/core/src/hooks/useMenuPress.ts: clear.
  • File packages/core/src/utils/clickGuard.test.ts: clear.
  • File packages/core/src/hooks/useMenuPress.test.tsx: clear.
  • File packages/core/src/DropdownMenu/DropdownMenuPickTouchEnd.test.tsx: clear.
  • File packages/core/src/DropdownMenu/__tests__/DropdownMenuPickTapThrough.interaction.browser.spec.ts: clear (comment and title only).

Automated review (maintainer link)

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

The click-guard change keeps WebKit's late mousedown, mouseup and click after a pick's cancelled touchend from reaching the control beneath, its four new menu cases fail without it, and the real-iPhone side-by-side now stated for this revision closes the earlier device-evidence gap. The pull request is a draft, so marking it ready for review starts CI with the ci:run label it already carries. This review covers this pull request's own change as the bottom of its stack with #12216.

  • Non-blocking: the comment at packages/core/src/utils/clickGuard.ts:251 ("No click follows a cancelled touchend.") now contradicts the file header this change adds at lines 41-47, and reads better as "Other arms keep the old rule and disarm here."
Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none.
  • Claim, release note: a finger's pick in a Home Screen web app no longer clicks the control beneath, for every press-model menu: verified in code (clickGuard.ts:248-262, useMenuPress.ts:694, :728) and by the stated real-iPhone take of this revision.
  • Claim, release note: the guard stays armed for 400 ms from the cancelled touchend or until the next press: verified (clickGuard.ts:79, :195-198, :199-207, :261; clickGuard.test.ts:451).
  • Claim: the menu press model picks the row with its own detail 0 click and arms the guard: verified (useMenuPress.ts:620-657, :689).
  • Claim: WebKit sends those events a few ms after the pick, where the touch began, whatever the touchstart's cancelability: a device observation; the unit cases model both kinds of touchstart.
  • Claim: after that touchend only browser-sent events are taken, and a page's own click acts: verified (clickGuard.ts:156-160, :215-217; clickGuard.test.ts:426).
  • Claim: the next pointerdown disarms, and a detail 0 click passes: verified (clickGuard.ts:195-198, :360-365; clickGuard.test.ts:394).
  • Claim: the new option is set only by the press model, and only the outside pan and box hold arms also cancel a touchend: verified (Layer/outsidePanClaim.ts:51, utils/boxHold.ts:84).
  • Claim: the guard reads trust itself and the unit tests stand in for that read through a test-only setter: verified (clickGuard.ts:60-72, :327-335).
  • Claim: no public API, attribute or default changes: verified (no entry point of the package reaches the guard module; no new data attribute, event or default).
  • Claim: +388/−24 lines: verified at the issued revision.
  • Claim: the new unit cases fail without the change: verified (removing the two option lines fails exactly the four new menu cases; 113 of 113 pass with them).
  • Claim: this revision's own change is byte-identical to the previously device-tested revision's, and this revision is an empty commit on the merge of main: verified.
  • Claim: the merge of main changes code the menus run, so the earlier device runs do not carry: verified (four direct imports of the press model, plus shared layer and motion modules).
  • Claim: a real iPhone 14 held pick ran at this revision against its own preview, side by side with the previously approved revision, 3 of 3 on both heads in a Home Screen web app and a Safari tab: taken from the description's text, and this revision's preview deployment is reported complete.
  • Claim: the Safari focus difference comes from the other pull request's outside hold: consistent with that pull request's change; this revision and main behave alike there.
  • Claim: scripts/shared-identity.test.mjs passes: verified here (7 of 7), covering the new registered key.
  • Claim: Prettier passes on the changed files: verified here.
  • Claim: the strict browser preflight passes: stated, not rerun; CI has not run on this revision.
  • Claim: shared-module first-load gzip deltas on the four reference pages: reported in the description (139, 123, 130 and 106 B).
  • Claim: the two pull requests merge together, this one first: the stack declaration holds; the merge tool is outside the repository.
  • Claim: no file under the CLI package changes: verified.
  • File .changeset/menu-pick-late-click-home-screen.md: clear.
  • File packages/core/src/utils/clickGuard.ts: clear, with the non-blocking comment note above.
  • File packages/core/src/hooks/useMenuPress.ts: clear.
  • File packages/core/src/utils/clickGuard.test.ts: clear.
  • File packages/core/src/hooks/useMenuPress.test.tsx: clear.
  • File packages/core/src/DropdownMenu/DropdownMenuPickTouchEnd.test.tsx: clear.
  • File packages/core/src/DropdownMenu/__tests__/DropdownMenuPickTapThrough.interaction.browser.spec.ts: clear (header and titles only).

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 23, 2026 07:04

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

Engineering-owner approval at this exact head (46a28a5), posted by Cindy's agent (agent-made, not a human review) under her standing instruction. Stack member of #12216: CodeBunny approved this head and the stack, CI is green at this head, and Specs records are current.

@cixzhang
cixzhang merged commit dd706d0 into meta:main Nov 23, 2026
221 of 224 checks passed
@vjeux
vjeux deleted the menu-standalone-compat-click branch November 23, 2026 09:18

This branch was successfully deployed

1 active deployment
Preview — 46a28a57 Deployed Nov 23, 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) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) 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