Skip to content

spec(DropdownMenu, AST-094): the menu grows out of its trigger under a finger (FR21); a phone menu stays beside its trigger (DEC-19) - #8515

Merged
cixzhang merged 7 commits into
mainfrom
spec/dropdownmenu-touch-motion
Oct 27, 2026
Merged

cixzhang merged 7 commits into
mainfrom
spec/dropdownmenu-touch-motion

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Decided (Cindy, 2026-10-26: D23, the DropdownMenu grows from its trigger under a finger; D27, a phone menu stays beside its trigger).

  • component:DropdownMenu FR21 is marked decided. The record itself stays draft.
  • spec:AST-094 OQ9 is resolved as DEC-19: covering placement is rejected, and the menu keeps the layer runtime's normal placement beside its trigger, inside the gutter.

Summary

On a phone, a DropdownMenu today appears with the desktop layer entrance and stays open when the person starts scrolling the page. Proposed component:DropdownMenu FR21 applies AST-094's touch rules to it:

  • Under the touch modes (presentation not pinned to 'popover'), the menu grows out of its Trigger button and collapses back into it (spec:AST-094 FR31).
  • A pan that starts outside the menu closes it (FR32). That's the menu's own close: focus that was in the menu returns to the Trigger, whose aria-expanded turns false.
  • A mouse, or a pinned presentation="popover", keeps the layer's own entrance.
  • The PR also adds a verification row: touch motion and pan-outside unit cases, menuSurfaceMotion.test.ts, and a touch-motion browser spec covering open, close, interrupted open and close, Reduce Motion, a mouse, a tap/hold/pan outside, and focus at a pan dismissal.

Relation to layer-runtime INV15 (lift module)

FR21's grow doesn't use INV15's opt-in lift-from-trigger module. In #8195 it's a DropdownMenu-owned motion (menuSurfaceMotion.ts): the popover scales about a computed origin from a 22 × 22 square on the trigger to its size, with a fade, on springs.menuOpen and springs.menuClose through the shared animator. It isn't the rectangle morph either. It is on by default for DropdownMenu under the touch modes; a pinned presentation="popover" or a mouse keeps the layer entrance.

That puts it in tension with INV14/INV15, whose source boundary check fails lift or morph code outside the runtime and the lift module. So the owner's decision on FR21 includes which of these applies:

Source

The record text comes from #8195, which implements this behavior; #8195 now carries the code only. The layer exit-copy text it would bring belongs to #8186 and is not repeated here.

Rubric (docs/contributing/spec-writing.md)

  • R1 present tense, no history in the record: pass.
  • R2 one behavior per requirement: FR21 is the touch presentation of the pointer menu (motion and pan-outside close share its touch mode).
  • R3 verification row: pass.
  • R4 rejected alternatives: none.
  • R5 no PR references or measurements in the requirement: pass.
  • R6 open questions: the owner's decision on FR21.

@vercel

vercel Bot commented Oct 26, 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 Oct 27, 2026 7:38am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 27, 2026, 8:26 AM UTC

@github-actions github-actions Bot added the spec-auto-merge Auto-merge was enabled by the spec owner gate label Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@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 proposal needs an engineering owner's decision before it can be approved. FR21 adds requirements to the draft DropdownMenu record that no current spec states yet (a pinned presentation="popover" keeps the layer's own entrance, and a pan dismissal returns focus to the Trigger button), and it leaves open whether the grow belongs in the layer-runtime INV15 lift module or INV15 is amended for a component-owned menu grow. Before that decision, please fix two things in the record:

  • FR21 says it is verified in jsdom and Chromium, but the tests it cites (menuSurfaceMotion.test.ts, __tests__/DropdownMenuTouchMotion.interaction.browser.spec.ts and touch-motion cases in DropdownMenu.test.tsx) are not on this branch, and FR5 still calls the same behavior pending implementation.
  • FR21 drops AST-094 FR31's "Under a finger" condition, so it never says a mouse keeps the layer's entrance, which AST-094 requires and its verification row tests.

After that, an engineering owner records the decision on the updated head by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner.

[Automated review]

| FR16 | `DropdownMenuCheckboxItem` MUST expose one `menuitemcheckbox` row whose `aria-checked` equals its controlled value; enabled activation reports `!value`, stays open by default, and composes consumer click and pointer-move handlers with owned activation and hover focus. Disabled activation calls no consumer activation handler. | Released subcomponent API; `architecture:public-component-api/INV5–INV8`; `DropdownMenuSelectable.test.tsx` | Verified current behavior; consumer handlers are preserved |
| FR17 | Disabled menu rows SHOULD remain keyboard-discoverable while activation stays blocked. Current shared `useListFocus` deliberately skips every `aria-disabled` row, including checkbox items. | WAI-ARIA Menu pattern; current shared navigation source/tests | Objective mismatch; shared mechanism remains undecided in OQ1 |
| FR20 | With `header` or `footer` on a sub-menu (`DropdownMenuSubMenu`), its surface is a modal dialog named by its row (AR7), holding the header, the sub-menu's `role="menu"` (rows only), then the footer. It sits in a host `DropdownMenu` renders beside its menu, never inside a menu; under a root with no such host (`ContextMenu`) the sub-menu shows its rows alone. On a fine pointer the dialog is the flyout; on a compact touch display, the drilled-in view, which replaces the root's menu and regions until popped. A region keeps its own keys and presses. The rows are one Tab stop: Tab and Shift+Tab walk the header's controls, the rows, then the footer's, and wrap; from a deeper flyout, that flyout closes and the walk goes on from the rows. An open lands as for any sub-menu (FR11, FR12), not on a region. Escape in the dialog, outside an IME composition and unless a control there handled it, returns focus to the row and leaves the root open. A pointer leaving the flyout keeps it open until focus leaves, and it closes with the flyout holding its row. Without either prop nothing changes. | Proposed DEC-13; FR15; AR5 | Proposed; verified in jsdom and Chromium, pending owner review |
| FR21 | Under the touch modes (`presentation` not pinned to `'popover'`), the pointer menu grows out of the Trigger button and collapses back into it (`spec:AST-094` FR31), and closes on a pan that starts outside it (FR32); a pinned `'popover'` keeps the layer's own entrance. A pan dismissal is the menu's own close: focus that was in the menu returns to the Trigger button, whose `aria-expanded` turns false. | Proposed; `spec:AST-094` FR31, FR32; `family:overlay-dismissal` AV6 | Proposed; verified in jsdom and Chromium, pending owner review |

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.

FR21 drops AST-094 FR31's "Under a finger" condition. "The touch modes" is glossed by presentation alone, so a mouse opening an un-pinned menu while the touch presentation applies would grow it, against AST-094's "A mouse keeps today's behavior". Suggested wording: "Under a finger, with presentation not pinned to 'popover', …; a mouse and a pinned 'popover' keep the layer's own entrance." The state "verified in jsdom and Chromium" also needs to read "pending implementation" until the tests land, as FR5 does.

| FR10 | `DropdownMenuSubMenu.test.tsx` safe-triangle suite; `useMenuHover.test.tsx` `isPointInSafeTriangle` and click-guard suites | diagonal path toward the flyout, a pause inside it, path away, click-opened and hover-opened guard windows | A flyout that closes while the pointer is inside the triangle or paused in it, one that never closes after leaving it, or a changed guard-window rule, fails. | `audit:DropdownMenu/behavior` |
| FR15 | `DropdownMenu.test.tsx` header and footer suite; `__tests__/MenuHeaderFooter.a11y.chromium.spec.ts` in real Chromium | dialog role, modality, name and trigger wiring; regions outside the menu element; typing in a header field; Tab walk header → menu → footer with wrap at both ends; Tab and Shift+Tab from an open sub-menu; hidden and hidden-wrapper controls; Escape from the header; a finger tap on a footer button; bottom sheet order; no regions | A region rendered inside the menu element, a popover with regions that is not a named modal dialog, a trigger still saying `aria-haspopup="menu"` with regions, a header key taken by typeahead, a Tab that leaves the dialog or closes it, focus stranded outside the dialog, or a footer tap swallowed by the press model fails. |
| FR16 | `DropdownMenuSelectable.test.tsx`, source inspection, scoped `pr-a11y` over the `a11y/Checkbox pattern` stories, and owned Storybook states | checked, unchecked, disabled, caller click/pointer handlers, marker size and ownership | A dropped consumer handler, wrong checked state, nested semantic checkbox, disabled activation, or menu that closes by default fails. | `audit:DropdownMenuCheckboxItem/behavior` |
| FR21 | `DropdownMenu.test.tsx` touch motion and pan-outside cases; `menuSurfaceMotion.test.ts`; `__tests__/DropdownMenuTouchMotion.interaction.browser.spec.ts` | open, close, an interrupted open and close, Reduce Motion, a mouse; a tap, a hold and a pan outside; focus in the menu at a pan dismissal | A pinned `'popover'` that animates, a pan outside that leaves the menu open, or focus left in a hidden menu fails |

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.

None of these references exists on this branch: DropdownMenu.test.tsx has no touch-motion or pan-outside case, and menuSurfaceMotion.test.ts and __tests__/DropdownMenuTouchMotion.interaction.browser.spec.ts are not in the tree. Land this row with the tests, or mark FR21 pending. The failure expectation should also cover "a mouse that grows the menu", as AST-094's own FR31–FR33 row fails "a changed mouse path".

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 26, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 26, 2026
…r their own spec change (meta#8515)

From review: record text lands only through an approved spec pull request, and meta#8515 proposes DropdownMenu FR21 (the grow and collapse under a finger, the pan-outside dismissal) on its own. The behavior and its tests stay here; the record's FR21 and its verification row go.
@cixzhang

Copy link
Copy Markdown
Contributor Author

Posted by Cindy's agent on her behalf.

Thanks for the menu work. Cindy's decisions on menus on phones:

  1. Position: a phone menu stays beside its trigger, as today, using the layer runtime's normal placement and gutter. The UIKit-style placement that covers the trigger (spec:AST-094 OQ9) is not adopted.
  2. Motion: DropdownMenu grows out of its trigger under a finger, with the new motion. Yes.

So the covering placement comes out of the covering-menu PR and the rest of it stays, and the grow-from-trigger PRs proceed. The record amendment follows in its own spec PR.

@cixzhang cixzhang changed the title spec(DropdownMenu): proposed — the menu grows out of its trigger under a finger and closes on a pan outside (FR21) spec(DropdownMenu, AST-094): the menu grows out of its trigger under a finger (FR21); a phone menu stays beside its trigger (DEC-19) Oct 27, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 33343e5

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

The owner decisions in FR21 and DEC-19 are approved, but the record text needs a few fixes before this can land. FR21 is marked "verified in jsdom and Chromium" while none of the tests its verification row cites exists on this branch and FR5 still calls the same grow pending implementation, so please mark FR21 pending (or land it with its tests), add AST-094's "Under a finger" condition and mouse rule to FR21 and its failure expectation, bound DEC-19's "so the trigger stays visible" (a menu taller than the room on either side can cover its trigger or run off-screen), and name FR21 beside FR29 in the compatibility section. A new commit resets the approval, so an engineering owner then records it again by commenting /approve-spec <full head SHA> on the new head; the author may do so as an engineering owner.

[Automated review]

| FR16 | `DropdownMenuCheckboxItem` MUST expose one `menuitemcheckbox` row whose `aria-checked` equals its controlled value; enabled activation reports `!value`, stays open by default, and composes consumer click and pointer-move handlers with owned activation and hover focus. Disabled activation calls no consumer activation handler. | Released subcomponent API; `architecture:public-component-api/INV5–INV8`; `DropdownMenuSelectable.test.tsx` | Verified current behavior; consumer handlers are preserved |
| FR17 | Disabled menu rows SHOULD remain keyboard-discoverable while activation stays blocked. Current shared `useListFocus` deliberately skips every `aria-disabled` row, including checkbox items. | WAI-ARIA Menu pattern; current shared navigation source/tests | Objective mismatch; shared mechanism remains undecided in OQ1 |
| FR20 | With `header` or `footer` on a sub-menu (`DropdownMenuSubMenu`), its surface is a modal dialog named by its row (AR7), holding the header, the sub-menu's `role="menu"` (rows only), then the footer. It sits in a host `DropdownMenu` renders beside its menu, never inside a menu; under a root with no such host (`ContextMenu`) the sub-menu shows its rows alone. On a fine pointer the dialog is the flyout; on a compact touch display, the drilled-in view, which replaces the root's menu and regions until popped. A region keeps its own keys and presses. The rows are one Tab stop: Tab and Shift+Tab walk the header's controls, the rows, then the footer's, and wrap; from a deeper flyout, that flyout closes and the walk goes on from the rows. An open lands as for any sub-menu (FR11, FR12), not on a region. Escape in the dialog, outside an IME composition and unless a control there handled it, returns focus to the row and leaves the root open. A pointer leaving the flyout keeps it open until focus leaves, and it closes with the flyout holding its row. Without either prop nothing changes. | Proposed DEC-13; FR15; AR5 | Proposed; verified in jsdom and Chromium, pending owner review |
| FR21 | Under the touch modes (`presentation` not pinned to `'popover'`), the pointer menu grows out of the Trigger button and collapses back into it (`spec:AST-094` FR31), and closes on a pan that starts outside it (FR32); a pinned `'popover'` keeps the layer's own entrance. A pan dismissal is the menu's own close: focus that was in the menu returns to the Trigger button, whose `aria-expanded` turns false. | Owner decision, 2026-10-26; `spec:AST-094` FR31, FR32; `family:overlay-dismissal` AV6 | Decided; verified in jsdom and Chromium |

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.

FR21's state reads "Decided; verified in jsdom and Chromium", but none of the verification on line 342 exists on this branch: DropdownMenu.test.tsx has no touch-motion or pan-outside case, and menuSurfaceMotion.test.ts and __tests__/DropdownMenuTouchMotion.interaction.browser.spec.ts are absent. FR5 above still calls the same grow "(pending implementation)". Suggest "Decided; pending implementation" until the tests land.

The gate also drops AST-094 FR31's "Under a finger" and its section's "A mouse keeps today's behavior". Suggest: "Under a finger, with presentation not pinned to 'popover', …; a mouse and a pinned 'popover' keep the layer's own entrance", plus "a mouse that grows the menu" in the failure expectation on line 342.

Comment on lines +710 to +712
On a compact touch screen an anchored menu keeps the layer runtime's normal
placement beside its trigger, inside the viewport gutter, so the trigger stays
visible while the menu is open.

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.

The layer runtime does not promise this. spec:AST-059 FR4 shifts content taller than either side into the viewport, and only a layer that keeps its anchor clear (Tooltip) never settles over its anchor. A 300px-tall menu on a phone held in landscape fits neither above nor below a mid-screen trigger: Chromium shifts it over the trigger and WebKit leaves it partly off-screen. Suggest dropping the clause, or bounding it: "so the trigger stays visible whenever the menu fits beside it".

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 791cf0d

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 95fbd9d

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

An engineering owner approved this exact head, and the FR21 and DEC-19 text now agrees with the current records it builds on: AST-094 FR31 and FR32, the presentation="popover" way back in the public-component-api architecture, and the layer runtime's fallback for a menu taller than the room beside its trigger. The four record fixes requested on the previous head are all in, so nothing further is needed here. One note for the implementing change: FR21 names no module for the grow, so that change still has to use the layer-runtime INV15 lift module or carry an INV15 amendment.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 37551a3

@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 spec change looks good to land: an engineering owner approved this exact revision, and FR21 and DEC-19 agree with the current records they build on (AST-094 FR31 and FR32, the presentation="popover" way back in the public-component-api architecture, and the layer runtime's placement and fallback). The merge of main changed nothing either record rests on. Two optional follow-ups: FR21's verification row could also fail a finger open that never grows, as AST-094's own FR31-FR33 row does, and the implementing change still has to place the grow in the layer-runtime INV15 lift module or carry an INV15 amendment.

[Automated review]

| FR10 | `DropdownMenuSubMenu.test.tsx` safe-triangle suite; `useMenuHover.test.tsx` `isPointInSafeTriangle` and click-guard suites | diagonal path toward the flyout, a pause inside it, path away, click-opened and hover-opened guard windows | A flyout that closes while the pointer is inside the triangle or paused in it, one that never closes after leaving it, or a changed guard-window rule, fails. | `audit:DropdownMenu/behavior` |
| FR15 | `DropdownMenu.test.tsx` header and footer suite; `__tests__/MenuHeaderFooter.a11y.chromium.spec.ts` in real Chromium | dialog role, modality, name and trigger wiring; regions outside the menu element; typing in a header field; Tab walk header → menu → footer with wrap at both ends; Tab and Shift+Tab from an open sub-menu; hidden and hidden-wrapper controls; Escape from the header; a finger tap on a footer button; bottom sheet order; no regions | A region rendered inside the menu element, a popover with regions that is not a named modal dialog, a trigger still saying `aria-haspopup="menu"` with regions, a header key taken by typeahead, a Tab that leaves the dialog or closes it, focus stranded outside the dialog, or a footer tap swallowed by the press model fails. |
| FR16 | `DropdownMenuSelectable.test.tsx`, source inspection, scoped `pr-a11y` over the `a11y/Checkbox pattern` stories, and owned Storybook states | checked, unchecked, disabled, caller click/pointer handlers, marker size and ownership | A dropped consumer handler, wrong checked state, nested semantic checkbox, disabled activation, or menu that closes by default fails. | `audit:DropdownMenuCheckboxItem/behavior` |
| FR21 | `DropdownMenu.test.tsx` touch motion and pan-outside cases; `menuSurfaceMotion.test.ts`; `__tests__/DropdownMenuTouchMotion.interaction.browser.spec.ts` | open, close, an interrupted open and close, Reduce Motion, a mouse; a tap, a hold and a pan outside; focus in the menu at a pan dismissal | A pinned `'popover'` or a mouse open that grows from the trigger, a pan outside that leaves the menu open, or focus left in a hidden menu fails |

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.

Optional: this failure expectation fails a grow where it must not happen, but not a missing one. Adding "a finger open in the touch modes that does not grow out of the Trigger, or a close that does not collapse back into it" would match AST-094's FR31-FR33 row ("a surface that does not grow from and shrink into its trigger ... fails") and this record's other rows, which name their primary failure (FR8: "A menu that does not open on a mouse press").

@cixzhang
cixzhang merged commit 9b478e5 into main Oct 27, 2026
54 checks passed
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
…ndency

main's meta#8515 records this pull request's grow as DropdownMenu FR21 and changes the FR8 line around it; the record takes the owner's rows. This pull request's own change to the record stays: FR5 no longer marks FR26 to FR35 as pending, and its status names what is verified (FR26 to FR34, FR35 pending).
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
meta#8220's dependencies in one commit, so its compare link shows only its own change: meta#8089 and meta#7839. The record keeps main's meta#8515 rows and meta#8080's FR5, and takes meta#7839's row changes (Sub-menu regions, FR15, FR20, FR23 and their verification rows).
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
…) as a dependency

The record keeps main's meta#8515 rows and this pull request's FR5 status (FR35 also verified in real WebKit).
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
meta#8104's dependencies in one commit: meta#8220 (now carrying main's meta#8515) with F2's line and meta#8373.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
Main's meta#8515 added DropdownMenu FR21 (the menu grows out of its trigger under a finger) beside FR20; the requirements table keeps this branch's FR20 wording and FR23 row around it.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
Main's meta#8515 took DropdownMenu FR21 (the menu grows out of its trigger under a finger). This branch's header-field hand-off becomes proposed FR22, which no open pull request in the record uses; DEC-14 keeps its number. The Compatibility section keeps main's grow sentence and this branch's breaking note.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
…nu sub-menu regions

Main's meta#8515 added DropdownMenu FR21 beside FR20; meta#7839's merge keeps its FR20 wording and FR23 row around it. This branch's own commits apply unchanged.

# Conflicts:
#	packages/core/src/DropdownMenu/DropdownMenu.spec.md
@github-actions
github-actions Bot deleted the spec/dropdownmenu-touch-motion branch October 28, 2026 06:17
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 3, 2026
…) as a dependency

The record keeps main's meta#8515 rows and this pull request's FR5 status (FR35 also verified in real WebKit).

This branch was successfully deployed

1 active deployment
Preview — 37551a38 Deployed Oct 27, 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. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant