Skip to content

DropdownMenu: tests pin a phone menu beside its trigger and no touch motion for a mouse open - #8089

Closed
vjeux wants to merge 7 commits into
meta:mainfrom
vjeux:uikit/c19-menu-placement
Closed

vjeux wants to merge 7 commits into
meta:mainfrom
vjeux:uikit/c19-menu-placement

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Real-browser evidence from an earlier head (Chrome 156, 390 px, touch emulation, coarse pointer, the built Default story):

Trigger in the upper half Trigger in the lower half
The menu opens directly below its trigger, start-aligned, and doesn't cover it (trigger y 256, menu y 292). The same from the lower half (trigger y 656, menu y 692).

Re-applied onto current main as one commit on #8080. The mouse fix this pull request first carried moved into #8080, whose review asked for it there. What stays is the placement the owner decided here, with its tests. It leaves draft with #8080 and #8458.

No behavior change. On every screen, a phone's included, the popover menu opens beside its trigger at the layer's placement; nothing centers it over the trigger.

Why

A phone menu placed over its trigger hides the control that opened it. This pull request first proposed that placement; the engineering owner decided here that the menu stays beside its trigger, so the placement was removed.

What led to it

Comparing our menus with UIKit's on the iOS 26.2 simulator, then the owner's review of the proposal.

Options and tradeoffs

  • Center the menu over its trigger on a phone: closer to some UIKit menus, but it covers the trigger.
  • Keep the layer's placement on every screen (chosen): one rule, and the trigger stays visible.

Expected behavior and authority

The engineering owner's decision on this pull request: a phone menu keeps the layer's placement beside its trigger (the record amendment follows).

Evidence

  • On a compact touch screen, the menu opens at the layer's placement, not centered on its trigger or pinned to the viewport's sides, in jsdom and in real Chromium.
  • A caller's own placement is kept.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

On the DropdownMenu "Default" story, in a phone-sized window with touch emulation, open it from the top and from the bottom of the screen: it opens below its trigger and never covers it.

Automated: the two compact-touch cases in DropdownMenu.test.tsx and DropdownMenuTouchPlacement (Chromium, WebKit). A [docs] changeset records the usage text.

Local gates at 7292457: the DropdownMenu, Layer, Popover, motion and hooks units pass (2,537 of 2,537) and the core type check. The full gates are running.

Stack: #8627 → #8078 and #8186 → #8080 → this PR. Review only this PR's change: vjeux/astryx@127f876...7292457

@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 3, 2026 1:34pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 3, 2026, 1:59 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026
@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 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 needs an engineering owner's decision before approval: no current spec places DropdownMenu over its trigger on phones, and this head adds the draft spec:AST-094 plus a proposed touchOpen decision (DEC-8) to the useMenuPress module. An engineering owner can approve that direction, including whether the menu's 8 px side margin replaces the layer runtime's viewport gutter, by commenting /approve-spec <full head SHA> on this pull request; the author can do so as an engineering owner. Whatever the decision, these changes are still needed:

  • Base this branch on #8080, or land the stack first, so the diff is this PR's own commit; it currently carries 26,562 authored lines.
  • Keep the covering menu inside the viewport: in landscape, a 300 px menu opened from a mid-screen trigger runs past the bottom edge, and its last rows cannot be reached.
  • Either document that placement and alignment are ignored on phones or honor them, and attach the iOS Safari capture the UIMenu claim rests on.

[Automated review]

Comment on lines +1961 to +1963
const upward = box.top + box.height / 2 > height * uikitMenu.openUpwardBelow;
style.setProperty('top', upward ? 'auto' : 'anchor(top)');
style.setProperty('bottom', upward ? 'anchor(bottom)' : 'auto');

ghost Oct 24, 2026

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 pins one edge of the menu to the trigger and leaves the other edge unbounded. In custom mode the layer also emits no fallbacks, gutter or viewport caps, so on a short compact viewport (a phone in landscape) a menu at the 300 px cap runs past the viewport and its last rows cannot be reached. With this CSS on a stand-in at 844 x 390, the menu spans y 161-461. Cap the block size to the room between the pinned edge and the far gutter, or shift the box inward the way UIMenu does.

ghost Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed at a6dbadb: as the menu opens, its block size is capped to the room between its pinned edge and the far viewport edge less the margin (and the menu's own cap still holds), so it stays on screen and scrolls, as UIMenu does. New Chromium case at 844×390: the long menu stays inside 8 px of both edges and scrolls.

Comment on lines +1900 to +1903
coversTrigger
? {
positioning: 'custom',
style: COVER_TRIGGER_STYLE,

ghost Oct 24, 2026

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.

On compact touch this branch drops placement and alignment, so a caller's explicit placement="above" stops applying on phones, while the props' JSDoc still says only the bottom sheet ignores them. Either document the override or keep an explicitly given placement. The fixed 8 px left/right in COVER_TRIGGER_STYLE is also a second viewport gutter, which architecture:layer-runtime INV11 reserves to the runtime, and it skips env(safe-area-inset-*) and LayerProvider.inset.

ghost Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed at a6dbadb: the placement and alignment JSDoc and doc.mjs entries say a compact touch screen places the menu over its trigger, as UIMenu does. The side inset is now max(8px, env(safe-area-inset-*)) plus the LayerProvider inset for that edge, the runtime gutter’s own terms. Whether UIKit’s 8 pt or the runtime’s 16 px base applies here is listed for the owner decision.

@github-actions

ghost commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

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


Generated by PR Enrichment workflow | View current CI run

ghost 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 needs an engineering owner's decision before approval: no current spec places DropdownMenu over its trigger on phones, and this head adds the draft spec:AST-094 plus a proposed touchOpen decision (DEC-8) to the useMenuPress module. An engineering owner can approve that direction, including whether the menu's 8 px side margin replaces the layer runtime's viewport gutter, by commenting /approve-spec <full head SHA> on this pull request; the author can do so as an engineering owner. Whatever the decision, these changes are still needed:

  • Base this branch on #8080, or land the stack first, so the diff is this PR's own commit; it currently carries 28,858 authored lines.
  • Keep the covering menu inside the viewport: in landscape, a 300 px menu opened from a mid-screen trigger runs past the bottom edge (or the top, from just below the middle), and its end rows cannot be reached.
  • Take the side inset from the runtime's gutter, safe area and LayerProvider inset included, unless the single-gutter rule is amended in the same decision.
  • Document that placement and alignment are ignored on phones or honor them, and attach the iOS Safari capture the UIMenu claim rests on.

[Automated review]

@cixzhang

ghost commented Oct 24, 2026

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

ghost commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

  • On-screen keyboard: the placement's viewport height moves onto useMobileKeyboard, the shared keyboard module, instead of its own visual-viewport read.

@vjeux
vjeux force-pushed the uikit/c19-menu-placement branch from a4bb514 to a6dbadb 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

ghost 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 needs an engineering owner's decision before approval: no current spec places DropdownMenu over its trigger on phones, its 8 px side inset is a second gutter definition that architecture:layer-runtime INV11 and spec:AST-059 FR1 reserve to the layer runtime, and this head adds the draft spec:AST-094 plus proposed useMenuPress DEC-8 and FR9 changes. An engineering owner can approve that direction, or name the record that should govern where a phone menu sits, by commenting /approve-spec <full head SHA> on this pull request; the author can do so as an engineering owner. Whatever the decision, these changes are still needed:

  • Base this branch on #8080, or land the stack first, so the diff is this PR's own commit; it currently carries 33,746 authored lines.
  • In right-to-left apps, add each LayerProvider inline inset to the edge it names: COVER_TRIGGER_STYLE adds inlineStart to the left, so the menu runs under a bar declared on the right.
  • Drop the theme platform condition or add it to spec:AST-012 FR2 first, and make astryx docs motion and draft AST-094 FR4 match the motion roles that actually ship.

[Automated review]

Comment on lines +38 to +39
left: coverEdge('left', 'inline-start'),
right: coverEdge('right', 'inline-end'),

ghost Oct 25, 2026

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.

In a right-to-left app --astryx-layer-inset-inline-start is the bar on the right, but it is added to left here, so the covering menu runs to 8 px from the right edge, under that bar (spec:AST-059 FR6 declares the inset per logical edge). The runtime's positional gutter takes the larger of both inline insets for both sides (layerViewportInset.stylex.ts:52); using that term, or mapping the inline insets to left/right by the menu's direction, keeps the bar clear. An RTL case with a declared inset would pin it.

* is everything else. Pair `ios` with `pointer: 'coarse'` for a touch
* profile, such as touch motion tuned per platform.
*/
platform?: 'ios' | 'other';

ghost Oct 25, 2026

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.

spec:AST-012 FR2 lists the adaptation conditions as width, height, pointer, contrast and motion and says future fields need an explicit addition to that closed vocabulary. platform needs that amendment first, or should leave this stack.

Comment thread packages/cli/assets/docs/motion.doc.mjs Outdated
content: [
{
type: 'prose',
text: 'On a touch screen, sheets, alerts, menus, navigation and scrolling play the springs, durations and curves measured from iOS. Each value is a motion role named by its table path, such as `springs.sheetPresent` or `timing.curves.easeInOut`. A theme retunes a role through `motion.springs`, `motion.durations` or `motion.curves`, at its root or in an adaptation rule; a role it leaves alone keeps its measured default.',

ghost Oct 25, 2026

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.

At this head only DropdownMenu's menuSurfaceMotion.ts plays motion roles, and draft AST-094 keeps scrolling native, so a theme that sets springs.sheetPresent or springs.navigationPush (the example below) changes nothing. Describe the roles that ship, or land this section with the components that read them.

'options.getScroller':
'element to edge-autoscroll while tracking; default = menu root if it overflows.',
'options.longPressDelayMs': 'finger hold before open, ms.',
'options.longPressDelayMs':
'finger hold before open, ms (iOS: 150, UIKit; elsewhere 500). iOS inside a scroller: +150 (content-touch delay), a caller value too.',

ghost Oct 25, 2026

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 code holds 150 ms on every touch device and adds the scroller delay everywhere (MENU_PRESS_LONG_PRESS_MS = menu.holdOpenMs), as the full doc above says; "elsewhere 500" and "iOS inside a scroller" tell an agent reading --dense otherwise.

measures (0.55 for a scroll view and a sheet), and a release MUST pick its
rest point by projecting its velocity the way its UIKit counterpart does:
with a deceleration rate, or with a measured projection time.
- **FR4 — Physics are not themable in touch presentations.** A touch

ghost Oct 25, 2026

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 head also ships theme motion roles that retune every touch spring, duration and curve (motion/roles.ts, the touch-motion-theme-roles changeset), which FR4 and DEC-1 forbid. One of the two needs to change before an owner can approve both.

follows.
- **FR7 — Exits animate as UIKit's do.** A touch presentation MUST play the
exit its UIKit counterpart plays. **Proposed; pending owner review:** this
departs from the draft `spec:AST-090` FR1 (exits off by default) and FR10

ghost Oct 25, 2026

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.

No AST-090 record exists at this head or on main, so this amendment (and the one in Current-state impact) points at nothing; cite the record by a path that exists, or drop it until that record lands.

ghost 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 needs an engineering owner's decision before approval: no current spec says where a menu sits on a phone (spec:AST-094 leaves it open as OQ9), including the 8 px side margin used in place of the layer runtime's gutter. An engineering owner can approve that direction, or name the record that should govern it, by commenting /approve-spec <full head SHA> on this pull request; the author can do so as an engineering owner. Whatever the decision, these changes are still needed:

  • Land the dependency stack first, or base this branch on #8080, so the diff is this pull request's own work: it carries 26,180 authored lines for a 914-line change, including #8186's new architecture:layer-runtime INV13.
  • Keep the menu open while it grows: a tap that lands during the grow still closes it (spec:AST-094 FR35), so land the input hold before or with the grow.

The right-to-left insets, the mouse-open motion, the size justification and the usage-doc fix from the last round check out at this head.

[Automated review]

opacity: from.opacity,
});
}
const handle = animator.animate(

ghost Oct 26, 2026

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.

Nothing in enter holds outside input while this spring runs, so the popover's light dismiss stays live and a tap that lands mid-grow closes the menu. spec:AST-094 FR35 says such a tap "MUST NOT close it"; landing the layer runtime's input hold (#8342, adopted for DropdownMenu in #8458) before or with this grow would meet it.

correct, and the runtime polls nothing: an anchor that a scrolled
container hides is followed again when an intersection observer reports it
back in view.
- **INV13 — One exit copy per closing layer.** A layer's close plays on at most

ghost Oct 26, 2026

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 INV13 and its Exit copy section are #8186's record change: new requirements in a current record, with no approval at this head. They should reach main through #8186 rather than ride in this pull request's diff.

@cixzhang

ghost commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

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

ghost commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

This PR now follows Cindy's decision: the menu takes the layer's normal placement beside its trigger on every screen, and the covering placement and its constants are gone. The rest stays. Could you update the description to match? It still describes the covering placement. If it stays idle, we'll add a short note at the top with the 390 px captures after about 30 minutes, leaving your text below it.

@vjeux vjeux changed the title DropdownMenu: on a phone the menu sits over its trigger, as UIMenu does DropdownMenu: a mouse open runs none of the touch motion; on a phone the menu stays beside its trigger Oct 27, 2026
@vjeux

ghost commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Done: the title and description now match 7fd7b0c (the FR24 mouse fix; on a phone the menu stays beside its trigger).

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

Approval waits on an engineering owner's decision about the new architecture:layer-runtime INV13 (one exit copy per closing layer), which any engineering owner records by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. Whatever that decision, the menu's grow still needs the FR35 input hold (by sitting on #8342 and #8458), a mouse or keyboard open on a coarse-primary device should keep today's behaviour instead of playing the grow and the collapse, and the branch needs a rebase to resolve the docs/architecture/layer-runtime.md conflict with main. The diff also carries about 22,000 lines from the open stack beneath it, so landing or rebasing that stack would leave this pull request reviewable as its own change.

[Automated review]

// layer's own entrance).
const surface = contentRef.current;
isTouchPresentationRef.current = touchModes === true;
const isUikitMotion = touchModes === true;

ghost Oct 27, 2026

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 decides the grow from the primary pointer alone, so a mouse click or a keyboard open on a coarse-primary device (a tablet with a trackpad or keyboard) grows the menu and plays the exit copy on close. spec:AST-094's menus preamble keeps today's behaviour for a mouse; decide the motion from the input that opened the menu.

exiting = null;
};

const enter = (measure: () => MenuSurfaceGeometry) => {

ghost Oct 27, 2026

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.

enter starts the grow without holding input, so a tap or drag that lands during the grow reaches the menu or the page (spec:AST-094 FR35). This needs the layer runtime's input hold (#8342, #8458) underneath it.

it('a finger’s open creates it', async () => {
stubPointer(true);
const trigger = renderMenu();
await userEvent.setup().click(trigger);

ghost Oct 27, 2026

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.

userEvent.click dispatches a mouse pointer, so this asserts that a mouse open under a coarse pointer creates the touch motion. Open with a touch pointer here, and add a mouse case under a coarse pointer that expects no motion.

'@astryxdesign/core': patch
---

[fix] DropdownMenu and MoreMenu opened with a mouse no longer start the touch presentation's motion code; on a phone the menu keeps opening beside its trigger, as on a larger screen.

ghost Oct 27, 2026

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.

Under a coarse primary pointer a mouse open still starts the grow and the collapse, so this holds only where the primary pointer is fine.

measured = null;
openHandle = null;
endExit();
animator.set({scaleX: 1, scaleY: 1, opacity: 1});

ghost Oct 27, 2026

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 set promotes the menu (inline will-change and a 500 ms demote timer) even when it runs for a mouse open after the pointer turned fine (spec:AST-094 FR24); {promote: false} writes the values without it.

exists, and Dialog, Drawer, BottomSheet, Lightbox, MobileNav, ToastViewport,
and Selector each build their own top-layer mounting, exit, or backdrop, and
Popover builds its own presentation hold for its sheet presentation.
INV14 and INV15 are not met yet, and `spec:AST-003` does not cover them. The

ghost Oct 27, 2026

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 paragraph conflicts with main, which appended BottomSheet's sheet-stack sentences to it; a rebase needs to keep both.

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

Approval waits on an engineering owner's decision on the new architecture:layer-runtime INV13 (one exit copy per closing layer) that this head carries from #8186, which an engineering owner records by commenting /approve-spec 6091b8da754ede3b126ed584c56865bcf4049a9d on this pull request (the author may do so if they are an engineering owner), and these independent fixes are needed as well:

  • A tap that lands while the menu is still growing closes it, which spec:AST-094 FR35 forbids, because the input hold (#8342, #8458) is not under this head.
  • On a touch-primary tablet a mouse click or a keyboard open plays the finger's grow and exit copy, against AST-094's "A mouse keeps today's behavior.", and after a finger's open a fine-pointer open still promotes the menu and keeps its close listener (FR24), while two changesets describe the opposite and DropdownMenuTouchMotionScope.test.tsx opens its finger case with a mouse.
  • The diff carries 22,144 authored lines from seven open stacked pull requests around this pull request's own 339 lines, so land the stack first or rebase onto it.

[Automated review]

exiting = null;
};

const enter = (measure: () => MenuSurfaceGeometry) => {

ghost Oct 27, 2026

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.

spec:AST-094 FR35: a tap or drag that lands while the menu is still growing MUST NOT close it or reach anything beneath it. enter starts the grow and holds no input; in Chromium on a touch screen a tap outside during the grow closed the menu. The owner asked that this pull request sit on the layer runtime's input hold (#8342, #8458).

// layer's own entrance).
const surface = contentRef.current;
isTouchPresentationRef.current = touchModes === true;
const isUikitMotion = touchModes === true;

ghost Oct 27, 2026

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.

touchModes follows the device's primary pointer, so on a touch-primary tablet a mouse click or a keyboard open plays the grow here and the exit-copy shrink on close, against spec:AST-094's "A mouse keeps today's behavior." Deciding from the input that opened the menu (the trigger press's pointerType, or the interaction-modality tracker) would keep a mouse on the layer's entrance.

measured = null;
openHandle = null;
endExit();
animator.set({scaleX: 1, scaleY: 1, opacity: 1});

ghost Oct 27, 2026

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.

animator.set promotes by default, so this reset writes will-change and starts the 500 ms demote timer on a mouse open after a finger's, which spec:AST-094 FR24 rules out under a fine pointer; {promote: false} avoids it. The beforetoggle listener also stays attached until unmount.

it('a finger’s open creates it', async () => {
stubPointer(true);
const trigger = renderMenu();
await userEvent.setup().click(trigger);

ghost Oct 27, 2026

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.

userEvent.click drives a mouse pointer, so this test asserts that a mouse open on a coarse-primary device creates the touch motion; opening with a touch pointer would test the finger's path.

'@astryxdesign/core': patch
---

[fix] DropdownMenu and MoreMenu opened with a mouse no longer start the touch presentation's motion code; on a phone the menu keeps opening beside its trigger, as on a larger screen.

ghost Oct 27, 2026

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 holds only where the primary pointer is fine: on a touch-primary tablet a mouse open still starts the grow and the exit copy (see DropdownMenu.tsx line 1158).

correct, and the runtime polls nothing: an anchor that a scrolled
container hides is followed again when an intersection observer reports it
back in view.
- **INV13 — One exit copy per closing layer.** A layer's close plays on at most

ghost Oct 27, 2026

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.

INV13 is a new normative requirement that current main does not state (INV14 names the shared exit copy without these rules); an engineering owner approves or rejects it with /approve-spec on this head.

@cixzhang

ghost commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 6091b8d

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

Approval waits on an engineering owner's decision on the new architecture:layer-runtime INV13 (one exit copy per closing layer, carried from #8186): the only /approve-spec predates the latest push, so 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. These fixes are needed as well:

  • A tap that lands while the menu is still growing closes it, which spec:AST-094 FR35 forbids, because the input hold (#8342, #8458) is not under this branch.
  • On a touch-primary screen a mouse click or a keyboard open still plays the finger's grow and exit copy, against AST-094's "A mouse keeps today's behavior.", while DropdownMenuTouchMotionScope.test.tsx opens its finger case with a mouse and two changesets say a mouse runs none of it.
  • After a finger's open, a later fine-pointer open still promotes the menu and keeps its close listener (FR24); the reset can write its values without promoting.
  • The diff carries 22,146 authored lines from seven open stacked pull requests around this pull request's own 339, so land the stack first or rebase onto it.

[Automated review]

exiting = null;
};

const enter = (measure: () => MenuSurfaceGeometry) => {

ghost Oct 27, 2026

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.

spec:AST-094 FR35: a tap or a drag that lands while the menu is still growing MUST NOT close it or reach anything beneath it. enter starts the grow and holds no input; in Chromium on a touch screen a tap outside during the grow closed the menu. The input hold (#8342, #8458) needs to be under this change.

// layer's own entrance).
const surface = contentRef.current;
isTouchPresentationRef.current = touchModes === true;
const isUikitMotion = touchModes === true;

ghost Oct 27, 2026

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.

touchModes follows the device's primary pointer, so on a touch-primary screen a mouse click or a keyboard open plays the grow here and the exit-copy shrink on close, against spec:AST-094's "A mouse keeps today's behavior." The trigger's press already knows the pointerType (menuTriggerPress.ts line 182); deciding the motion from it would keep a mouse on the layer's entrance.

measured = null;
openHandle = null;
endExit();
animator.set({scaleX: 1, scaleY: 1, opacity: 1});

ghost Oct 27, 2026

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.

animator.set promotes by default, so this reset writes will-change: scale, opacity and starts the 500 ms demotion timer on a mouse open after a finger's (seen in Chromium once the pointer turned fine), which spec:AST-094 FR24 rules out; {promote: false} writes the values without it. The beforetoggle listener added with the motion also stays attached.

it('a finger’s open creates it', async () => {
stubPointer(true);
const trigger = renderMenu();
await userEvent.setup().click(trigger);

ghost Oct 27, 2026

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.

userEvent.click drives a mouse pointer, so this case asserts that a mouse open on a coarse-primary device creates the touch motion. Opening with a touch pointer would test the finger's path, and a mouse case under the coarse stub would catch the mouse scope.

'@astryxdesign/core': patch
---

[fix] DropdownMenu and MoreMenu opened with a mouse no longer start the touch presentation's motion code; on a phone the menu keeps opening beside its trigger, as on a larger screen.

ghost Oct 27, 2026

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 holds only where the primary pointer is fine: on a touch-primary screen a mouse open still starts the grow and the exit copy (see DropdownMenu.tsx line 1158).

correct, and the runtime polls nothing: an anchor that a scrolled
container hides is followed again when an intersection observer reports it
back in view.
- **INV13 — One exit copy per closing layer.** A layer's close plays on at most

ghost Oct 27, 2026

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.

INV13 is a new normative rule that current main does not state (INV14 names the shared exit copy without these rules); an engineering owner approves or rejects it with /approve-spec and the full head SHA.

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

Approval is on hold until an engineering owner decides the new layer-runtime INV13 (one exit copy per closing layer), with its Exit copy section and verification row, at this head; the earlier /approve-spec named a previous commit. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Whatever that decision, these need changes:

  • A tap while the menu is still growing closes it, which spec:AST-094 FR35 forbids.
  • On a touch-primary device a mouse open plays the finger's grow and exit copy, against the menus rule "A mouse keeps today's behavior", while two changesets and the "a finger's open creates it" test say otherwise.
  • After a finger's open, a later fine-pointer open still promotes the menu and keeps the touch close listener (FR24).
  • The diff carries 22,318 authored lines from seven open stacked pull requests; landing those first would leave this pull request's own six-file change.

[Automated review]

// layer's own entrance).
const surface = contentRef.current;
isTouchPresentationRef.current = touchModes === true;
const isUikitMotion = touchModes === true;

ghost Oct 27, 2026

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.

touchModes reflects the device's primary pointer, not the input that opened the menu, so on a touch-primary device a mouse open grows the menu and its close plays the exit copy. spec:AST-094 scopes FR31 to a finger ("A mouse keeps today's behavior"); deciding this from the opening input's pointerType, which menuTriggerPress.ts already reads, would keep the layer's entrance for a mouse.

} else if (surfaceMotionRef.current?.element === surface) {
// A mouse runs nothing touch-related (spec:AST-094 FR24): it creates
// no motion, and stops one a finger's open left.
surfaceMotionRef.current.motion.reset();

ghost Oct 27, 2026

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.

After a finger's open, this branch runs on every later fine-pointer open: reset() promotes the surface for 500 ms, and the beforetoggle listener added in getSurfaceMotion stays attached until unmount. spec:AST-094 FR24 rules out touch-only listeners and timers under a fine pointer; disposing the motion and its listener when touchModes turns false would avoid both.

exiting = null;
};

const enter = (measure: () => MenuSurfaceGeometry) => {

ghost Oct 27, 2026

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.

Nothing holds pointer input while the grow runs, so a tap during the grow closes the menu or reaches the page beneath. spec:AST-094 FR35 requires an anchored menu growing out of its trigger to take no tap or drag until it has entered.

measured = null;
openHandle = null;
endExit();
animator.set({scaleX: 1, scaleY: 1, opacity: 1});

ghost Oct 27, 2026

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.

animator.set promotes by default; passing {promote: false} here would keep a reset from writing will-change and starting its demotion timer.

it('a finger’s open creates it', async () => {
stubPointer(true);
const trigger = renderMenu();
await userEvent.setup().click(trigger);

ghost Oct 27, 2026

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.

userEvent.setup().click drives a mouse pointer, so this case asserts that a mouse open on a coarse-primary device creates the touch motion. A touch pointer here, plus a mouse case on a coarse device, would test what the name says.

'@astryxdesign/core': patch
---

[fix] DropdownMenu and MoreMenu opened with a mouse no longer start the touch presentation's motion code; on a phone the menu keeps opening beside its trigger, as on a larger screen.

ghost Oct 27, 2026

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.

On a device whose primary pointer is coarse, a mouse open still runs the touch motion (the grow and the exit copy), so this note is not yet true there.

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

Approval is on hold until an engineering owner decides two record changes at this head: the new layer-runtime INV13 (one exit copy per closing layer, with its Exit copy section and verification rows) and AST-057's new sentence putting a swipe row's slide and spring on theme motion roles. Any engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Whatever the decision, these need fixing:

  • A tap that lands while the menu is still growing closes it (AST-094 FR35), so the input hold from #8342 and #8458 needs to sit under this change.
  • main's scripts/touch-support-bundle.test.mjs fails at this head until #8671 lands or its per-component check comes here.
  • On a touch-primary device a mouse or keyboard open still plays the finger's grow and exit copy (DropdownMenu.tsx line 1156), while both DropdownMenu changesets say a mouse keeps the layer's entrance.
  • AST-057's new sentence describes a motion role the row does not play: Item/useSwipeAction.ts still settles on a 200 ms constant.
  • At 34,002 authored lines, the open stack should land first so this diff is its own change.

[Automated review]

exiting = null;
};

const enter = (measure: () => MenuSurfaceGeometry) => {

ghost Oct 29, 2026

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.

enter starts the grow and nothing holds pointer input while it runs, so the popover's light dismiss stays live and a tap that lands mid-grow closes the menu. spec:AST-094 FR35 says such a tap "MUST NOT close it"; the layer runtime's input hold (#8342, adopted for DropdownMenu in #8458) needs to be under this change.

// layer's own entrance).
const surface = contentRef.current;
isTouchPresentationRef.current = touchModes === true;
const isUikitMotion = touchModes === true;

ghost Oct 29, 2026

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.

touchModes follows the device's primary pointer, so on a touch-primary device a mouse click or a keyboard open grows the menu here and plays the exit-copy shrink on close, while both DropdownMenu changesets say a mouse keeps the layer's entrance. Deciding from the opening input (menuTriggerPress.ts reads event.pointerType at line 209) would make the notes true.

'@astryxdesign/core': patch
---

[fix] DropdownMenu and MoreMenu opened with a mouse no longer start the touch presentation's motion code; on a phone the menu keeps opening beside its trigger, as on a larger screen.

ghost Oct 29, 2026

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 holds only where the primary pointer is fine: on a touch-primary device a mouse open still starts the grow and the exit copy (DropdownMenu.tsx line 1156).

it('a finger’s open creates it', async () => {
stubPointer(true);
const trigger = renderMenu();
await userEvent.setup().click(trigger);

ghost Oct 29, 2026

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.

userEvent.setup().click drives a mouse pointer, so this case pins a mouse open on a coarse-primary device creating the touch motion. A touch pointer here, plus a mouse case under the coarse stub, would test what the name says.

correct, and the runtime polls nothing: an anchor that a scrolled
container hides is followed again when an intersection observer reports it
back in view.
- **INV13 — One exit copy per closing layer.** A layer's close plays on at most

ghost Oct 29, 2026

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.

INV13 is a new normative rule that main does not state (INV14 names the shared exit copy without these rules). The earlier /approve-spec named a previous commit, so an engineering owner approves or rejects it with /approve-spec and this head's full SHA.

Comment thread docs/specs/AST-057-row-actions/spec.md Outdated
- **Gesture tuning.** Axis-lock distance, commit ratio, fling velocity,
resistance past the panel: behavior constants in source, not public API and
not design tokens (the same ruling the touch press model received for its
clocks). The row's slide and spring motion plays on theme motion roles

ghost Oct 29, 2026

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 row does not play a motion role: Item/useSwipeAction.ts still settles on SWIPE_SETTLE_MS = 200 (line 86, played at line 368), and this pull request does not touch it. This sentence (and the one under the API table) would describe the row once it moves onto a role; it also needs an engineering owner's approval as new text in a current record.


import {useCallback, useMemo, type RefObject} from 'react';
import {currentGesture} from '../Layer/gestureCounter';
import {createNativeScrollProbe} from '../gestures/nativeScroll';

ghost Oct 29, 2026

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 import puts gestures/nativeScroll.ts behind DropdownMenu and the public useMenuPress, so main's scripts/touch-support-bundle.test.mjs "is absent from the root entry" (and the hooks entry) fails at this head. #8671 updates that check; it needs to land first or come with this change.

Christopher Chedeau added 2 commits November 2, 2026 21:56
… moves (spec:AST-094 FR29, FR43)

Under a finger or pen, on every device, a DropdownMenu or MoreMenu opened
under a resting finger picked the row beneath it once the press had lasted
300 ms. The press machine's open phase now takes UIMenu's handoff: until
the finger is 10 px, in a straight line, from the first position the open
menu sees, nothing lights and a lift acts on nothing; then it slides and
picks as usual. A mouse keeps the settle rule, and presentation="popover"
pins the pointer model.

- menuPressGesture: the handoff state and transitions, on internal types;
  the released menuPressStep keeps its public shapes.
- useMenuPress: the internal useDropdownMenuPress entry takes a touch
  model; the public hook is unchanged.
- menuPressValues: UIKit's handoff distance, copied from the constants
  table so a menu bundles the number, not the table.
- DropdownMenu and MoreMenu run the touch model unless presentation is
  "popover"; docs and a changeset say so.
- A real-browser spec (DropdownMenuTouchHandoff); core declares the
  interaction harness it imports.
… carry positions

The released menuPressStep hands its events to the internal transition,
which starts the finger's handoff when a move carries x and y. The public
gesture drops the handoff origin, so a caller whose events carried
positions got no pick from the opening finger. menuPressStep now strips
the positions first, and a test whose events carry them pins it. Three
comments are reworded.

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

Approval is on hold until an engineering owner decides the new architecture:layer-runtime INV13 (one exit copy per closing layer, with its Exit copy section, verification row and change rule). This head carries it from #8186, and main does not state it. An engineering owner records the decision by commenting /approve-spec followed by the full head SHA, and the author may do so as an engineering owner.

Required changes, independent of that decision:

  • A finger tap that opens the menu through the trigger's click (a quick tap on a trigger inside scrolling content) gets no grow and no collapse, because handleButtonClick passes no pointer type to openAndFocus, against spec:AST-094 FR31 and component:DropdownMenu FR21, and the dropdownmenu-uimenu-touch changeset's "on every touch device" overstates the change until that is fixed.
  • Nothing holds pointer input while the menu grows, so a tap mid-grow closes the menu or reaches the page against spec:AST-094 FR35, and the grow should land together with the input hold from #8458 or hold input in enter itself.
  • The pan-outside useEffect in DropdownMenu.tsx re-implements the outside-press tracking that watchOutsidePress and useOutsidePress in Layer/outsidePress.ts already own, so extend that watch with a cancel outcome, start it from handleLayerShow, and delete the Effect and its closeMenuRef layout Effect.
  • The diff is 6,436 authored lines, and all but about 215 of them come from four open stacked drafts (#8627, #8078, #8186, #8080), so land those first or retarget this pull request onto #8080.

[Automated review]

Comment on lines +1140 to +1143
const isUikitMotion =
touchModes === true &&
openPointerType != null &&
openPointerType !== 'mouse';

ghost Nov 3, 2026

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.

isUikitMotion needs a pointer type, but handleButtonClick opens with none (openAndFocus(modality, true) at lines 1584 and 1590). A finger tap that opens at the lift's click, such as a quick tap on a trigger in scrolling content, therefore keeps the layer's entrance and plays no collapse (spec:AST-094 FR31, component:DropdownMenu FR21). Passing the click's pointer type to openAndFocus would cover it.

exiting = null;
};

const enter = (measure: () => MenuSurfaceGeometry) => {

ghost Nov 3, 2026

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.

enter starts the open spring and holds no pointer input. Light dismiss stays live, so a tap or drag that lands mid-grow closes the menu or reaches the page; spec:AST-094 FR35 says it MUST NOT. The input hold in #8458 is the shared home for this.

// The browser announces that it took the touch for a pan with a
// pointercancel, which its light dismiss ignores.
const isPopoverOpen = popover.isOpen;
useEffect(() => {

ghost Nov 3, 2026

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 Effect re-implements the outside-press tracking that watchOutsidePress and useOutsidePress (Layer/outsidePress.ts) already own: remember a press that starts outside, then end it at the lift or the cancel. Only the cancel's outcome differs here. Extending that watch with a cancel (pan) outcome and starting it from handleLayerShow would remove this Effect and the closeMenuRef layout Effect above it.

Comment on lines +527 to +532
- **INV13 — One exit copy per closing layer.** A layer's close plays on at most
one exit copy, made by `placeLayerExitCopy`: drawn where the layer was drawn,
inert, hidden from assistive technology, without ids, form names, or form
owner, shown only in the top layer, and removed by its owner when the close
settles. Placing a second copy for the same layer removes the first; another
layer's copy stays.

ghost Nov 3, 2026

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.

INV13 is new normative text that main does not state: INV14 names the shared exit copy without these rules. An engineering owner approves or rejects it with /approve-spec and the full head SHA.

ghost 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 waits on an engineering owner's decision, and it also has fixes that are needed whatever that decision is.

The head adds a new rule to the layer runtime record: INV13, 'One exit copy per closing layer', with its Exit copy section, verification row, change rule and the rewritten gap paragraph. The rule is not on main yet. An engineering owner records approval by commenting /approve-spec followed by the full head SHA, or says whether INV13 should wait for #8186. The author may record it, since they are an engineering owner. Every other behavior matches the current touch-presentation and DropdownMenu records.

Required changes:

  • A tap that lands while the menu is still growing picks the row under it and closes the menu, because nothing holds pointer input during the open spring (menuSurfaceMotion.ts line 265); AST-094 FR35 requires the tap to be held, so add the input hold, or land after it, with a test for a tap on a row and outside during the grow.
  • DropdownMenuTouchMotion.interaction.browser.spec.ts 'the open and the close do no Layout or Paint per frame' (line 605) opens the menu with Enter and then waits for the grow and the exit copy, which a keyboard open never plays at this head, so open it with a finger tap instead.
  • DropdownMenu.tsx keeps its own lastTriggerPointerTypeRef (line 1001, written at lines 1780 and 1818) beside the shared press model, which already sees the same trigger press, so have the press model report the pointer type behind a trigger click and drop the ref.
  • The title says 'a mouse open runs none of the touch motion', but on main a mouse open never ran touch motion, and the diff adds the whole finger behavior, so retitle the change for what it does against main.
  • The diff is 6,561 authored lines, of which this pull request's own commit is 215, so land or retarget the stacked drafts until this diff is that one commit.
  • DropdownMenu.spec.md line 350 still says the held-touch case asserts the 500 ms hold with the FR8 gap pending, which this head removes, so delete that sentence.

One optional suggestion: placeLayerExitCopy's 33-line JSDoc repeats the record and the inline comments, and could keep only its contract.

[Automated review]

opacity: from.opacity,
});
}
const handle = animator.animate(

ghost Nov 3, 2026

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.

Nothing holds pointer input while this open spring runs. With the spring still running, a second finger's tap on a row acts and closes the menu, and the popover's light dismiss stays live for a tap outside. AST-094 FR35 says a tap or drag during the grow MUST NOT close the menu or reach anything. Hold input for the spring, or land after the input hold, with a test for a tap during the grow.

let open = {from: 0, to: 0};
let close = {from: 0, to: 0};
const started = Date.now();
// Opened from the keyboard (the phone's primary pointer is still coarse,

ghost Nov 3, 2026

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.

At this head a keyboard open plays no grow and leaves no exit copy: handleLayerShow needs a pointer type (DropdownMenu.tsx lines 1157-1160). So scaleAnimationOf(story.popover) and scaleAnimationOf(exitCopyOf(page)) below never resolve. Open with a finger tap and start the window after the trigger's press feedback.

const panOutside = useOutsidePress();
// The pointer type of the trigger's last press, for a click that opens the
// menu and carries none.
const lastTriggerPointerTypeRef = useRef('');

ghost Nov 3, 2026

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 keeps a second record of the trigger press beside the shared press model, which already takes the same pointerdown (menuTriggerPress.ts lines 204 and 210) and answers for the click behind a press (isTriggerClickFromPress). Have the press model report the pointer type behind a trigger click, and drop this ref and its writes at lines 1780 and 1818.

| FR5 | `DropdownMenu.test.tsx` press-model cases ("a finger that lands on one row and lifts on another acts on the second, once", "a mouse released outside closes the menu; a finger released outside leaves it open", "marks the menu as carrying the press model and owns touch scrolling"); `MenuPress.a11y.chromium.spec.ts`; the module record's own map | Finger and mouse release; scrolling menu | A row that acts on press-down, a mouse release outside that keeps the menu, or a missing press marker fails. | `audit:DropdownMenu/behavior` |
| FR6 | `DropdownMenu.test.tsx` focus-return cases ("restores focus to the trigger after keyboard dismissal", "returns focus to the trigger after pointer dismissal without a focus ring", "leaves focus on the control a press outside landed on") and the "focus return after a pointer pick" and "a trigger the caller renders" cases | Keyboard and pointer close; Button and custom trigger | A lost focus return, a ring after a pointer close, no ring after a keyboard close, or focus pulled off a control pressed outside fails. | `audit:DropdownMenu/accessibility` |
| FR7 | `DropdownMenu.test.tsx` menuMaxHeight cases | A cap above 300px; viewport bound | A menu clipped to 300px under a raised cap, or one that escapes the viewport, fails. Evidence gap: no test asserts that the touch sheet ignores the cap. | `audit:DropdownMenu/layout` |
| FR8 | `DropdownMenu.test.tsx` press-model trigger cases ("a mouse press on the trigger opens the menu and a drag-release acts on the row under it", "the opening release before the settle time acts on nothing and the menu stays", "pressing the trigger of an open menu closes it and does not reopen it in the same gesture", "under a coarse pointer a finger opens the menu as it presses the trigger (no scroll view), and a slide picks", "a tap on the trigger still opens through its click") | Mouse press-open; held finger; tap | A mouse that opens only on click, an opening release that acts early, or a re-open in the closing gesture fails. The held-touch case asserts the current 500 ms hold, the FR8 gap pending conformance. | `audit:DropdownMenu/behavior` |

ghost Nov 3, 2026

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 row still ends with 'The held-touch case asserts the current 500 ms hold, the FR8 gap pending conformance', but this change removes the FR8 gap, and the case it lists now asserts the press-open. Delete that sentence.

correct, and the runtime polls nothing: an anchor that a scrolled
container hides is followed again when an intersection observer reports it
back in view.
- **INV13 — One exit copy per closing layer.** A layer's close plays on at most

ghost Nov 3, 2026

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.

INV13 is a new normative rule that main does not state: INV14 names the shared exit copy without these rules. An engineering owner records approval with /approve-spec and the full head SHA, or says whether it should wait for #8186.

ghost Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The layer-runtime INV13 and Exit copy text belongs to #8186, which waits on its owner ruling. This pull request leaves draft together with #8186, so it asks for no spec approval of that text.

…resses (AST-094 FR29)

Under a finger or pen, on every device, a DropdownMenu or MoreMenu trigger
in a fixed bar opens the menu as the finger presses, as UIMenu's pull-down
button does. Inside a scroll view it opens once the 150 ms content-touch
delay has passed with no scroll, within a 13 px drift allowance. The
opening finger then picks only after the handoff distance. A mouse is
unchanged, and presentation="popover" keeps the pointer model.

- menuTriggerPress.ts: the trigger half of the press model (the press-down
  open, the held finger, the scroll-view wait), reached only by menus with
  a trigger.
- useMenuPress: the trigger-less callers inside core's own menus (sub-menus,
  ContextMenu, Selector's list and the sheet's action list)
  take the internal useMenuSurfacePress, so they do not bundle the trigger
  half.
- menuPressValues: UIKit's hold-open slop and content-touch delay, copied
  from the tables with drift tests.
- A real-browser spec (DropdownMenuTouchPress) and an accessibility case.
- The touch-support bundle check names the eight imports that now carry
  the trigger half's scroll-view wait.

ghost 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 waits on an engineering owner's decision, and it also has fixes that are needed whatever that decision is.

The head adds a new layer-runtime rule, INV13 'One exit copy per closing layer', with its Exit copy section, verification row and change rule, which main does not state yet. Any engineering owner can approve it by commenting /approve-spec <full head SHA> on this pull request, and the author can do so as an engineering owner; otherwise the rule leaves this diff once #8186 lands with it.

Required changes:

  • A tap that lands while the menu is still growing picks that row and closes the menu, which spec:AST-094 FR35 forbids, so hold pointer input for the open spring (or land after the input hold in #8458) and add tests for a tap on a row and one outside during the grow.
  • DropdownMenu.tsx catches the close with its own beforetoggle listener and an unmount-only Effect beside the listener useLayer already binds on the same popover, so give useLayer and usePopover a close-start callback and remove the component listener and Effect.
  • The diff carries 6,633 authored lines, of which this pull request's own commit is 215, so land or retarget the stack until the diff is that one commit.

[Automated review]

opacity: from.opacity,
});
}
const handle = animator.animate(

ghost Nov 3, 2026

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.

Nothing holds pointer input while this open spring runs: the growing popover is not inert and takes pointer events, so a second finger's tap on a row acts and closes the menu, and the popover's light dismiss stays live for a tap outside. spec:AST-094 FR35 says a tap or drag during the grow MUST NOT close the menu or reach anything. Hold input for the spring, or land after the input hold, with tests for a tap on a row and one outside during the grow.

motion.exit();
}
};
element.addEventListener('beforetoggle', handleBeforeToggle);

ghost Nov 3, 2026

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.

useLayer (through usePopover) already binds beforetoggle on this popover from its callback ref, with attach, detach and replacement handled. A second listener here also needs the re-binding above and the unmount Effect below. A close-start callback on useLayer/usePopover, called from its existing handleBeforeToggle, would let this pass motion.exit and drop both.

correct, and the runtime polls nothing: an anchor that a scrolled
container hides is followed again when an intersection observer reports it
back in view.
- **INV13 — One exit copy per closing layer.** A layer's close plays on at most

ghost Nov 3, 2026

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.

INV13 is new normative text that main does not state: INV14 names the shared exit copy without these rules. An engineering owner records approval with /approve-spec and the full head SHA, or it leaves this diff once #8186 lands with it.

ghost 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 waits on an engineering owner's decision, and it also has fixes that are needed whatever that decision is.

The head adds a new layer-runtime rule, INV13 'One exit copy per closing layer', with its Exit copy section, verification row and change rule, which main does not state yet. Any engineering owner can approve it by commenting /approve-spec <full head SHA> on this pull request, and the author can do so as an engineering owner; otherwise the rule leaves this diff once #8186 lands with it.

Required changes:

  • A tap that lands while the menu is still growing picks that row and closes the menu, which spec:AST-094 FR35 forbids, so hold pointer input for the open spring (or land after the input hold in #8458) and add tests for a tap on a row and one outside during the grow.
  • The diff carries 6,783 authored lines, of which this pull request's own commit is 215, so land or retarget the stack until the diff is that one commit.

The earlier note about a second beforetoggle listener is resolved: the collapse now starts from the layer's own close-start callback.

[Automated review]

opacity: from.opacity,
});
}
const handle = animator.animate(

ghost Nov 3, 2026

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.

Nothing holds pointer input while this open spring runs: the growing popover is neither inert nor pointer-events: none, so a second finger's tap on a row acts and closes the menu, and the light dismiss stays live for a tap outside. spec:AST-094 FR35 says a tap during the grow MUST NOT close the menu or reach anything beneath it. Hold input for the spring (the layer runtime's input hold in #8458), with tests for a tap on a row and one outside.

Christopher Chedeau added 4 commits November 3, 2026 05:07
…s close

placeLayerExitCopy puts a static, inert copy of a closing layer where the
layer was drawn, in the top layer, for a touch presentation's close to play
on: the browser hides a popover the moment it closes. The copy keeps the
layer's box, transform, presented look, overflow and scroll positions; has
no ids, form names or form owner (native controls and form-associated
custom elements alike); is inert and hidden from assistive technology; and
its descendants' keyframe animations do not start again. A refused show
during the closing toggle waits, hidden, until the toggle is over. A layer
has one copy. The layer-runtime record states it.

Rebuilt onto current main from the earlier branch's own change, with the
review findings fixed: a scrolling layer keeps its own overflow and scroll
position, form-associated custom elements get form="", descendants'
keyframes stop, and the row-actions spec edit is dropped.
…and collapses back into it, as UIMenu does

In the touch modes, a finger's open grows the menu out of its trigger on
UIKit's open spring, and its close collapses it back on the close spring,
played on the layer runtime's exit copy. A pan that starts outside the
open menu dismisses it as the pan begins. A mouse and presentation="popover"
keep the layer's own entrance and exit; under reduced motion the menu lands
at its size with a short fade.

- menuSurfaceMotion: the grow and collapse on the compositor (scale and
  opacity about a computed origin), continuing with its velocity when
  interrupted.
- DropdownMenu: the motion runs only for a finger's open in the touch modes;
  any other open creates none and stops one a finger's open left.
- DropdownMenuTouch: the touch layer DropdownMenu imports, which registers
  UIKit's two menu springs before the first animation.
- motion/uikit: the menu table (its collapsed size) and registerMenuSprings.
- The pan-outside dismissal runs on the layer's outside-press watch, started as the
  touch presentation opens and stopped as it closes; a tap that opens at its
  click passes its pointer type, so it grows too.
- The DropdownMenu record's FR21 gap closes.
…ger, as on a larger screen

No behavior change. On every screen, a phone's included, the popover
menu opens beside its trigger at the layer's placement, as the owner
decided; nothing centers it over the trigger. Tests pin it, in jsdom on a
compact touch screen and in real Chromium, and the usage text says it.

- DropdownMenu: the header comment says where the menu opens.
- Tests: the placement on a compact touch screen, and the caller's own
  placement kept. A [docs] changeset for the usage text.

ghost 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 waits on an engineering owner's decision, and it also has fixes that are needed whatever that decision is.

The head adds a new layer-runtime rule, INV13 'One exit copy per closing layer', with its Exit copy section, verification row and change rule, which main does not state yet. Any engineering owner can approve it by commenting /approve-spec <full head SHA> on this pull request, and the author can do so as an engineering owner; otherwise the rule leaves this diff once #8186 lands with it.

Required changes:

  • A tap that lands while the menu is still growing is not held: a tap on a row picks it and a tap outside closes the menu, which spec:AST-094 FR35 forbids, so hold pointer input for the open spring (or land after the input hold in #8458) and add tests for a tap on a row and one outside during the grow.
  • The diff carries 6,841 authored lines, of which this pull request's own commit is 215, so land or retarget the stack until the diff is that one commit.

A phone menu still opens beside its trigger, and the settled menu is unchanged from main.

[Automated review]

opacity: from.opacity,
});
}
const handle = animator.animate(

ghost Nov 3, 2026

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.

Nothing holds pointer input while this open spring runs: the growing popover is neither inert nor pointer-events: none, so a second finger's tap on a row acts and closes the menu, and a tap outside closes it through the light dismiss. spec:AST-094 FR35 says a tap during the grow MUST NOT close the menu or reach anything beneath it. The layer runtime's input hold that #8458 adopts is the shared home; add tests for a tap on a row and one outside during the grow.

@vjeux

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #8080.

This branch was successfully deployed

1 active deployment
Preview — 7292457b Deployed Nov 3, 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. needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants