Skip to content

feat(DropdownMenu): a finger or a pen opens the menu as it presses - #8078

Merged
cixzhang merged 9 commits into
meta:mainfrom
vjeux:uikit/c19-menu-press
Nov 11, 2026
Merged

cixzhang merged 9 commits into
meta:mainfrom
vjeux:uikit/c19-menu-press

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #9764 → #9769 → #8485 and #8080; #8078 → #8508 and #8080.

Behavior module: useMenuPress

User need

Under a finger or a pen, a DropdownMenu or MoreMenu opened only at a tap's lift or after a 500 ms hold. On iOS a pull-down menu opens on the press, so the finger slides straight to a row.

Problem and solution fit

An anchored menu's trigger now opens on the press, on every device (spec:AST-094 FR29, FR43). In a scroll view it first waits UIKit's 150 ms content-touch delay; a drift over 13 px in that time scrolls instead. The finger that opened the menu then picks only after the 10 px handoff.

useMenuPress with no longPressDelayMs follows the same rules (FR25).

Current specification

spec:AST-094 FR25, FR26–FR30 and FR43, and module:DropdownMenu/useMenuPress (current). The component:DropdownMenu record closes FR8's finger gap, in text only.

Public delta and caller burden

  • An anchored DropdownMenu or MoreMenu, under a finger or a pen: the trigger opens on the press. presentation="popover" keeps the tap's lift and the 500 ms hold. A bottom sheet and a mouse are unchanged.
  • Changed public default: useMenuPress's longPressDelayMs goes from 500 ms to unset, so a finger opens on the press, with the same handoff. longPressDelayMs: 500 keeps the previous hold.
  • App-level size: +532 B gzip, eager, on a 12-component page with DropdownMenu, MoreMenu, Popover, Dialog, BottomSheet and Selector.

Design and alternatives

  • One delay everywhere: a fixed bar would lag.
  • No delay: a scroll's first touch would open a menu.
  • UIKit's rule (chosen): open on press, except in a scroll view.

Evidence

  • Failure before the change: this head's tests on main's product fail 17 cases, each a finger or pen open.
  • Success after the change: those cases pass.
  • iOS 26.2 simulator, Safari, scrolling page, earlier head: "Actions" opens at 156 ms; on main, at 500 ms.
main this PR
main this PR
  • The first tap after page load paints no focus ring on the trigger in Chromium or WebKit, in 6 of 6 runs.

Writing rubric results

R1 narration, R2 research, R4 rejected alternatives, R5 change references, R6 open questions: none. R3 evidence: FR8's verification row names the press and tap cases, not the hold.

Scope

Components: DropdownMenu, MoreMenu, useMenuPress

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

At cab4595: 3b7e253 with main f27380a merged in, its own lines unchanged. 3b7e253 is a71e804 plus one commit, so every menu calls the one useMenuPress, as on main. a71e804 is 7419b9d with main ebb9dde merged in. 7419b9d is d08f0d3 with the text fix and a sandbox page. On the sandbox page /pages/menu-press-cases/, which scrolls, with touch emulation:

  1. Press "Actions" in the fixed bar: the menu opens with the finger still down. Slide to "Duplicate" and lift: it runs once.
  2. Tap "Actions": it opens on the press and stays open after the lift. Nothing is picked.
  3. Flick across "More", in the page: the page scrolls and no menu opens.
  4. With a pen, the press opens it at once. With a mouse, nothing changes.

A device run at this head is pending.

At cab4595, the ui project (24,377), the Node project (19,114), the core type check, strict ESLint, pnpm check:knowledge and pnpm review:pre pass. This commit changes no spec, and the interaction counts equal a71e804's. The DropdownMenu, motion, Layer, nav and Popover interaction specs pass in Chromium: 318 pass, 16 skip. In WebKit's CI container at one worker: 239 pass, 95 skip. The accessibility specs of those menus, ContextMenu and Selector pass in Chromium (391), and the browser ones in WebKit (19).

Earlier gates, at 7419b9d: the core units (21,435), the core type check, strict ESLint, the touch-bundle test (11), pnpm check:knowledge and pnpm review:pre pass. At c3bfa08, the 33 browser specs that open the menu, nav and tab stories passed in Chromium (200). They passed in WebKit's CI container too (54, with 29 engine skips). 7419b9d changes only the scroll-view helper and the nav menus' hook. At it, the touch-press spec (7) and the focus-ring and press audits (17) pass in Chromium. At the first merge (e8face7), the menu, nav and picker units (1,745) and the touch-bundle test (11) passed.

Public and internal API delta

  • Size: +1,554/−277 lines (f27380a..cab4595), tests included.
  • App-level size: +532 B gzip, eager, on the 12-component page above. Splitting the hook in two saved 8 B there, so this PR keeps one hook.
  • Public, a behavior-only default: UseMenuPressOptions.longPressDelayMs goes from 500 ms to unset. Unset follows UIMenu, so a finger opens the menu as it presses.
    • Why: the public hook shares DropdownMenu's finger rules (spec:AST-094 FR25, FR29, FR43).
    • Usage: useMenuPress({menuRef, itemSelector}); useMenuPress({menuRef, itemSelector, longPressDelayMs: 500}) keeps the released wait.
  • Internal, removed: useDropdownMenuPress and its types DropdownMenuPressOptions and DropdownMenuPressReturn. DropdownMenu calls useMenuPress, as every other menu does.
    • Why: one hook and one code path. DropdownMenu picks its touch model through the delay, so no second entry is needed.
    • Usage: useMenuPress({menuRef, triggerRef, itemSelector, longPressDelayMs: isPopover ? 500 : undefined}).
  • Internal, new: none. No new module, hook or export.

@vercel

vercel Bot commented Oct 24, 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 11, 2026 10:12am UTC

Request Review

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

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 11, 2026, 10:26 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.

This pull request can't be approved yet: its main changes — the 150 ms finger hold-open (300 ms in a scroller) with a 13 px drift allowance, the 10 px handoff before the finger that opened a menu can pick, and the new public continueGesture — are not stated in any approved spec, because module:DropdownMenu/useMenuPress FR9 and DEC-4 are still proposed and still describe a 500 ms delay and the settle rule. An engineering owner needs to decide that direction, together with the new draft spec:AST-094, the touchOpen DEC-8 and the adaptive-query change measured against Selector DEC-1; once the module record carries the proposed text, an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Independently of that decision, please address:

  • Land the four dependencies first, or base this pull request on their branch, so its diff is this change's own ~1,000-line commit rather than 24,416 lines.
  • useMenuPress.doc.mjs docsDense still says a finger never triggers onDismiss, which is no longer true with touchOpen: 'press', and it lists neither touchOpen nor continueGesture.
  • spec:AST-094 FR7 proposes amending spec:AST-090, which does not exist in the repository.

[Automated review]

Comment thread packages/core/src/hooks/useMenuPress.ts Resolved
Comment thread packages/core/src/hooks/useMenuPress.ts Resolved
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · cab4595

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
DropdownMenuSubMenu 72.6 kB (+539 B) · 9.7 kB CSS (0) — ✗ · ✓ · ✓
DropdownMenu 101.5 kB (+500 B) · 17.6 kB CSS (0) — ✗ · ✓ · ✓
DropdownMenuCheckboxItem 23.4 kB (0) · 6.6 kB CSS (0) — ✗ · ✓ · ✓
63 more components
Component Size LoC Visual · A11y · RTL
DropdownMenuDivider 5.3 kB (0) · 548 B CSS (0) — ✗ · ✓ · —
DropdownMenuGroup 6.4 kB (0) · 3.4 kB CSS (0) — ✗ · ✓ · —
DropdownMenuItem 22.6 kB (0) · 6.3 kB CSS (0) — ✗ · ✓ · —
DropdownMenuRadioGroup 6.6 kB (0) · 3.3 kB CSS (0) — ✗ · ✓ · —
DropdownMenuRadioItem 23.4 kB (0) · 6.6 kB CSS (0) — ✗ · ✓ · —
NavHeadingMenu 17.9 kB (+1012 B) · 3.5 kB CSS (0) — — · — · —
lab/CommentThread 351.4 kB (+660 B) · 2.4 kB CSS (0) — — · — · —
lab/Comments 358.2 kB (+647 B) · 2.5 kB CSS (0) — — · — · —
BreadcrumbItem 89.3 kB (+570 B) · 12.1 kB CSS (0) — — · — · —
SideNavHeading 80.1 kB (+559 B) · 11.3 kB CSS (0) — — · — · —
Markdown 192.9 kB (+545 B) · 20.8 kB CSS (0) — — · — · —
TopNavMenu 79.1 kB (+538 B) · 11.3 kB CSS (0) — — · — · —
ContextMenu 112.6 kB (+534 B) · 17.5 kB CSS (0) — — · — · —
PowerSearch 298.1 kB (+532 B) · 24.5 kB CSS (0) — — · — · —
TopNavHeading 79.7 kB (+528 B) · 11.3 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 283.9 kB (+528 B) · 454 B CSS (0) — — · — · —
TableHeaderCell 113.4 kB (+521 B) · 17.7 kB CSS (0) — — · — · —
TabMenu 76.4 kB (+515 B) · 11.2 kB CSS (0) — — · — · —
TableCell 113.9 kB (+511 B) · 18.0 kB CSS (0) — — · — · —
MoreMenu · Storybook 101.8 kB (+503 B) · 17.6 kB CSS (0) 91 (0) ✓ · ✓ · ✓
Table 129.8 kB (+503 B) · 18.4 kB CSS (0) — — · — · —
Pagination 115.0 kB (+479 B) · 17.8 kB CSS (0) — — · — · —
Selector 104.8 kB (+449 B) · 17.5 kB CSS (0) — — · — · —
lab/TabBar 82.1 kB (+227 B) · 1.8 kB CSS (0) — — · — · —
lab/ChatVirtualizer 55.9 kB (+124 B) · 223 B CSS (0) — — · — · —
lab/Schedule 109.6 kB (+84 B) · 3.9 kB CSS (0) — — · — · —
Switch 106.6 kB (+13 B) · 10.0 kB CSS (0) — — · — · —
lab/NavigationScreen 83.5 kB (+11 B) · 1.5 kB CSS (0) — — · — · —
lab/NavigationStack 83.5 kB (+11 B) · 1.5 kB CSS (0) — — · — · —
AlertDialog 108.9 kB (0) · 14.6 kB CSS (0) — — · — · —
BaseTypeahead 76.3 kB (0) · 11.0 kB CSS (0) — — · — · —
BottomSheet 69.4 kB (0) · 7.7 kB CSS (0) — — · — · —
ButtonGroup 43.5 kB (0) · 3.7 kB CSS (0) — — · — · —
ChatComposer 82.5 kB (0) · 12.1 kB CSS (0) — — · — · —
ChatComposerInput 80.2 kB (0) · 11.3 kB CSS (0) — — · — · —
ChatComposerTokenElement 80.2 kB (0) · 11.3 kB CSS (0) — — · — · —
ComplexSelector 75.4 kB (0) · 11.9 kB CSS (0) — — · — · —
DateInput 192.3 kB (0) · 17.1 kB CSS (0) — — · — · —
DateRangeInput 97.0 kB (0) · 12.5 kB CSS (0) — — · — · —
DateTimeInput 214.5 kB (0) · 18.8 kB CSS (0) — — · — · —
Lightbox 125.8 kB (0) · 10.6 kB CSS (0) — — · — · —
MultiSelector 99.2 kB (0) · 16.9 kB CSS (0) — — · — · —
Popover 95.0 kB (0) · 14.3 kB CSS (0) — — · — · —
ResizeHandle 22.2 kB (0) · 4.3 kB CSS (0) — — · — · —
SegmentedControl 99.5 kB (0) · 6.9 kB CSS (0) — — · — · —
SideNav 118.0 kB (0) · 11.4 kB CSS (0) — — · — · —
SideNavItem 74.8 kB (0) · 11.2 kB CSS (0) — — · — · —
Slider 112.1 kB (0) · 8.8 kB CSS (0) — — · — · —
TimeInput 167.2 kB (0) · 16.1 kB CSS (0) — — · — · —
Toast 101.0 kB (0) · 10.3 kB CSS (0) — — · — · —
ToggleButton 89.8 kB (0) · 10.1 kB CSS (0) — — · — · —
ToggleButtonGroup 40.7 kB (0) · 3.7 kB CSS (0) — — · — · —
Tokenizer 101.2 kB (0) · 19.2 kB CSS (0) — — · — · —
TopNavMegaMenu 74.0 kB (0) · 11.9 kB CSS (0) — — · — · —
Typeahead 85.5 kB (0) · 12.5 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 110.3 kB (0) · 773 B CSS (0) — — · — · —
lab/ChatReactionBar 111.4 kB (0) · 1.1 kB CSS (0) — — · — · —
lab/CommentComposer 156.0 kB (0) · 1.9 kB CSS (0) — — · — · —
lab/PageControl 76.6 kB (0) · 709 B CSS (0) — — · — · —
lab/TabBarItem 3.9 kB (0) · 1.8 kB CSS (0) — — · — · —
lab/TourStep 101.3 kB (0) · 590 B CSS (0) — — · — · —
lab/TransferListSelector 114.0 kB (0) · 1.4 kB CSS (0) — — · — · —
ContextMenuItem 32.9 kB (−5 B) · 6.3 kB CSS (0) — — · — · —
Visual changes: 4 snapshots in 1 component

A change is a question for the reviewer, not a failure.

Component · story Before After Diff
DropdownMenu · Lab Checkbox Items (probe, dark) before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (probe, light) before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (neutral, dark) before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (neutral, light) before frame after frame diff frame

Package size: @astryxdesign/core 7.34 MB packed (+4.0 kB); no new dependencies.

API changes: core +0 · ~2 · −0

2 API changes (advisory)
Package Where Signature Usage
~ core . · Hooks · hook useMenuPress hook useMenuPress: (options: UseMenuPressOptions) => UseMenuPressReturn → hook useMenuPress: (input: UseMenuPressOptions) => UseMenuPressReturn import {useMenuPress} from '@astryxdesign/core'; useMenuPress(…)
~ core . · Types · interface UseMenuPressOptions longPressDelayMs?: number = 500 → longPressDelayMs?: number import type {UseMenuPressOptions} from '@astryxdesign/core'; const x: UseMenuPressOptions = {longPressDelayMs: …}

Touched components checked; add ci:run-visual 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 pull request can't be approved yet: its main changes — the 150 ms finger hold-open (300 ms in a scroller), the 10 px handoff before the finger that opened a menu can pick, the cleared highlight after a cancelled press and the new public continueGesture — are not stated in any approved spec, because module:DropdownMenu/useMenuPress FR9 and DEC-4 are still proposed and still describe a 500 ms hold and the settle rule. An engineering owner needs to settle that direction, together with the draft spec:AST-094, touchOpen (DEC-8) and the adaptive sheet query measured against Selector DEC-1; once the module record carries the proposed text, an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author, as an engineering owner, may do so. Independently of that decision, please address:

  • Land the four dependencies first, or base this pull request on their branch, so its diff is this change's own ~1,060-line commit rather than 26,635 lines.
  • .changeset/menu-press-uimenu.md should name the old 500 ms longPressDelayMs default and how to keep it, and say that the hook adds 150 ms to a caller's own value inside a scroller.
  • useMenuPress.doc.mjs docsDense still says a finger never triggers onDismiss, and it lists neither touchOpen nor continueGesture.
  • spec:AST-094 FR7 proposes amending spec:AST-090, which does not exist in the repository.

[Automated review]

Comment thread .changeset/menu-press-uimenu.md Resolved
@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:

This is about where the behavior lives, not about the PR's intent.

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

  • Raw touch listeners: the held finger's touchmove block moves onto the gesture host, in the shared-tracker change that follows this stack.
  • Long press: the held finger runs on useLongPress's detector (start, moveTo, cancel); the menu passes UIKit's hold-open values from the constants table as its delayMs and moveCancelPx.

@vjeux
vjeux force-pushed the uikit/c19-menu-press branch from 6b1e606 to 309b4eb Compare October 25, 2026 01:56
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 25, 2026
@github-actions
github-actions Bot requested a review from cvkxx October 25, 2026 01:57
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec c3bfa08

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.

@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. A finger or a pen now opens a DropdownMenu or MoreMenu as it presses (after the 150 ms content-touch delay inside a scroll view), the public useMenuPress with no longPressDelayMs follows the same rule, and presentation="popover" or longPressDelayMs: 500 keeps the released behavior, as spec:AST-094 FR25, FR29 and FR43 state.

Next: mark the pull request ready for review, and a maintainer adds the ci:run label so CI runs on this fork branch.

Non-blocking:

  • useMenuPress.doc.mjs says the press opens the menu "on a touch screen" and never mentions a pen, while the hook opens on press for any touch or pen pointer on every device, as the changeset says.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 75391ad

@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 press itself follows spec:AST-094 FR29: under a finger or a pen, an anchored DropdownMenu or MoreMenu now opens as its trigger is pressed (after the 150 ms content-touch delay inside scrolling content), the opening finger picks only past the 10 px handoff, a mouse is unchanged, and presentation="popover" or longPressDelayMs: 500 keeps the released behavior.

Blocking

  • Miss: .changeset/menu-press-uimenu.md (and the description's public delta) says every DropdownMenu and MoreMenu trigger now opens on press, but a menu shown as a bottom sheet (presentation="bottom-sheet", or adaptive on a compact touch screen) still opens at the tap's click, so the release note should name the anchored menu only.

Non-blocking

  • useMenuPress.doc.mjs still says the press opens the menu "on a touch screen" and names only a finger, while the hook opens on press for any touch or pen pointer on every device.

Next: fix the changeset wording, then mark the pull request ready for review so CI runs; every job was skipped on this draft head. #8508 is based on an earlier commit of this branch, so it needs restacking onto this head before the Stack: line holds.

[Automated review]

Comment thread .changeset/menu-press-uimenu.md Resolved
A menu shown as a bottom sheet still opens at the tap's click, so the
release note names the anchored menu, as the press does. The hook's doc
names a finger or a pen on every device, as the hook acts.
A raw page that scrolls with the document. Its Actions menu sits in a
fixed top bar, so it opens as a finger presses it, and a slide onto a
row runs that row once. Its More menu sits in the page, so a flick that
starts on it scrolls the page. The bar shows which row ran and how many
times.

@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, since every job was skipped on the draft. Under a finger or a pen, an anchored DropdownMenu or MoreMenu now opens as its trigger is pressed (after the 150 ms content-touch delay inside scrolling content), useMenuPress with no longPressDelayMs follows the same rule, and presentation="popover" or longPressDelayMs: 500 keeps the released behavior, as spec:AST-094 FR25 and FR29 state. The release note now names the anchored menu only, which fixes the last review's blocking point.

Next: mark the pull request ready for review, and a maintainer adds the ci:run label so CI runs on this fork branch. #8508 sits on an earlier commit of this branch, so it needs restacking onto this head before its Stack: line holds.

Non-blocking:

  • Miss: menuPressValues.ts adds a second DELAYS_CONTENT_TOUCHES_MS, while motion/uikit/scroll.ts already exports that constant on its own for the press clocks; importing it there drops the copy and its sync test line.
  • Miss: the comment above longPressApiRef in useMenuPress.ts still says the detector hook is created in that file after fireLongPress; both now live in menuTriggerPress.ts.

[Automated review]

Comment thread packages/core/src/hooks/useMenuPress.ts Resolved
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec a71e804

@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, since every job was skipped on the draft.

Under a finger or a pen, an anchored DropdownMenu or MoreMenu trigger now opens as it is pressed, and 150 ms after the press inside scrolling content, as spec:AST-094 FR29 states; useMenuPress with no longPressDelayMs follows the same rule (FR25), and longPressDelayMs: 500 or presentation="popover" keeps the released hold. The new DropdownMenu cases fail on main and pass here, and a mouse is unchanged.

Two optional cleanups from the last review still stand: import DELAYS_CONTENT_TOUCHES_MS from motion/uikit/scroll.ts instead of keeping a copy in menuPressValues.ts, and update the comment above longPressApiRef in useMenuPress.ts, which still says the detector is created in that file.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 3b7e253

@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; every job was skipped while the pull request is a draft, and it runs once it is marked ready for review.

Under a finger or a pen, the trigger of an anchored DropdownMenu or MoreMenu now opens its menu as it is pressed, and after the 150 ms content-touch delay inside scrolling content, as spec:AST-094 FR29 requires. useMenuPress with no longPressDelayMs follows the same rule (FR25). presentation="popover" and longPressDelayMs: 500 keep the released hold. The new cases fail on main and pass here. In Chromium with touch, the menu opens 2 ms after the press, or 153 ms after it on a page that scrolls; a mouse is unchanged.

Non-blocking comment fixes:

  • Regression: motion/uikit/gestures.ts:256-259 says the press model reads a copy of holdOpenSlop in hooks/menuPressValues.ts, but that file now copies only handoff; the drift allowance is MENU_PRESS_TRIGGER_DRIFT_PX in useMenuPress.ts.
  • useMenuPress.ts:80-84 describes MENU_PRESS_LONG_PRESS_MS for "the 'pointer' touch model and no longPressDelayMs", which the hook no longer produces.
  • useMenuPress.ts:108-110 explains the trigger context by a hook argument that no longer exists, now that the trigger half lives in useMenuPress.

Automated review (maintainer link)

Comment on lines +256 to +259
* `holdOpenSlop`: how far a finger on the button may drift and still open
* the menu. `handoff`: how far the finger that opened it travels before it
* picks. The menu press model reads copies of them in
* `hooks/menuPressValues.ts`.

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.

Regression (non-blocking): hooks/menuPressValues.ts now copies only handoff. The drift allowance the hook uses is MENU_PRESS_TRIGGER_DRIFT_PX = 13 in useMenuPress.ts:93, and no test ties it to holdOpenSlop since MENU_PRESS_HOLD_OPEN_SLOP_PX and its test line were removed. Perhaps: "The menu press model reads a copy of handoff in hooks/menuPressValues.ts; holdOpenSlop matches MENU_PRESS_TRIGGER_DRIFT_PX in hooks/useMenuPress.ts." Or restore that copy and its test line.

Comment on lines +81 to +83
* How long a finger rests on the trigger before the menu opens under it,
* with the 'pointer' touch model and no `longPressDelayMs`. A tap released
* sooner opens the menu through the trigger's click.

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: the hook no longer runs the pointer model without a longPressDelayMs (the pointer model now means a delay was set, line 383). Perhaps: "The released finger hold. DropdownMenu passes it for presentation="popover"; a caller keeps it by passing longPressDelayMs: 500."

Comment on lines +108 to +110
// The model's own state changes through these calls, never through a
// write to one of its refs. React Compiler reads a write through a hook
// argument as mutating it.

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 (INV29): the trigger half moved back into useMenuPress, so this context is no longer a hook argument. MenuTriggerContext, installRef, attachRef and holdDetectorsRef now only route calls inside one function. Calling the refs directly would drop them; otherwise this comment should give the reason the indirection still has.

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 3b7e253

@cixzhang

Copy link
Copy Markdown
Contributor

Decision: D-20261111-245

@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. Under a finger or a pen, the trigger of an anchored DropdownMenu or MoreMenu now opens its menu as it is pressed, and after the 150 ms content-touch delay inside scrolling content, as spec:AST-094 FR29 requires; useMenuPress with no longPressDelayMs follows the same rule (FR25), and presentation="popover" or longPressDelayMs: 500 keeps the released hold. The new cases fail on main and pass here, CI passes on this head, and in Chromium with touch the menu opens 3 ms after the press, or 152 ms after it on a page that scrolls, while a mouse is unchanged.

Three non-blocking comment fixes from the earlier review still apply (motion/uikit/gestures.ts:255-260, hooks/useMenuPress.ts:80-84 and :108-110); they are on the open inline threads.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec cab4595

@cixzhang

Copy link
Copy Markdown
Contributor

Decision: D-20261111-256

This branch was successfully deployed

1 active deployment
Preview — cab45951 Deployed Nov 11, 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