Repository navigation
feat(DropdownMenu): a finger's open grows the menu out of its trigger - #8080
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This needs an engineering owner's decision before it can be approved: the touch motion follows the draft AST-094, whose FR4 narrows the current theme-tokens architecture (INV3) to pointer presentations, and the useMenuPress FR8, FR9, DEC-4 and new DEC-8 are still proposals. An 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 ruling, these changes are still needed:
- Rebase onto the landed predecessors, or split, so this pull request carries its own change rather than 26,186 changed lines.
- Keep the pan-outside dismissal's pointer set across renders in
DropdownMenu.tsx, becausecloseMenuchanges identity on every render and the set starts empty again. - Bring
useMenuPress.spec.md(the 500 ms row, FR9 and DEC-4) in line with the 150 ms hold and the 10 px handoff, and name the oldlongPressDelayMsdefault and the option that restores it in the changeset.
[Automated review]
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| MoreMenu | 🔴 133.4 kB (+18.5 kB) · 19.8 kB CSS (0) | — | — · — · — |
| DropdownMenu | 🔴 133.1 kB (+18.5 kB) · 19.8 kB CSS (0) | — | ✓ · ✓ · ✓ |
| lab/MediaVolume | 🔴 229.2 kB (+4.2 kB) · 1.5 kB CSS (0) | — | — · — · — |
132 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/MediaPlaybackRate | 🔴 229.2 kB (+4.2 kB) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaCaptionsButton | 🔴 229.2 kB (+4.2 kB) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaFullscreenButton | 🔴 229.2 kB (+4.2 kB) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaPlayButton | 🔴 229.2 kB (+4.2 kB) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaSeekButton | 🔴 229.2 kB (+4.2 kB) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTimeSlider | 🔴 229.2 kB (+4.2 kB) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTime | 🔴 229.2 kB (+4.2 kB) · 1.5 kB CSS (0) | — | — · — · — |
| lab/VideoPlayer | 🔴 236.6 kB (+4.0 kB) · 2.1 kB CSS (0) | — | — · — · — |
| lab/AudioPlayer | 🔴 239.0 kB (+4.0 kB) · 1.8 kB CSS (0) | — | — · — · — |
| lab/Comments | 390.5 kB (+401 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 383.5 kB (+401 B) · 2.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 316.8 kB (+232 B) · 454 B CSS (0) | — | — · — · — |
| lab/CommentComposer | 186.9 kB (+219 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 130.3 kB (+156 B) · 1.1 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 129.1 kB (+153 B) · 773 B CSS (0) | — | — · — · — |
| Popover · Storybook | 105.6 kB (+139 B) · 15.5 kB CSS (0) | 1,825 (+52) | ✓ · ✓ · ✓ |
| DropdownMenuSubMenu | 80.8 kB (+138 B) · 11.0 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TopNavMenu | 87.7 kB (+130 B) · 12.4 kB CSS (0) | — | — · — · — |
| TopNavHeading | 88.3 kB (+114 B) · 12.4 kB CSS (0) | — | — · — · — |
| TableCell | 107.8 kB (+111 B) · 20.2 kB CSS (0) | — | — · — · — |
| PowerSearch | 319.8 kB (+109 B) · 27.3 kB CSS (0) | — | — · — · — |
| SideNavHeading | 88.6 kB (+106 B) · 12.5 kB CSS (0) | — | — · — · — |
| Pagination | 154.6 kB (+104 B) · 20.1 kB CSS (0) | — | — · — · — |
| TabMenu | 84.8 kB (+104 B) · 12.3 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 107.7 kB (+103 B) · 20.0 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 102.9 kB (+102 B) · 14.0 kB CSS (0) | — | — · — · — |
| ContextMenu | 106.6 kB (+101 B) · 19.6 kB CSS (0) | — | — · — · — |
| Selector | 121.4 kB (+98 B) · 19.7 kB CSS (0) | — | — · — · — |
| NavHeadingMenu | 19.0 kB (+97 B) · 3.5 kB CSS (0) | — | — · — · — |
| Table | 126.0 kB (+95 B) · 21.2 kB CSS (0) | — | — · — · — |
| charts/ChartTooltip | 226.3 kB (+72 B) · 451 B CSS (0) | — | — · — · — |
| charts/Chart | 249.8 kB (+70 B) · 516 B CSS (0) | — | — · — · — |
| Markdown | 210.7 kB (+67 B) · 23.5 kB CSS (0) | — | — · — · — |
| charts/ChartLegend | 42.2 kB (0) · 224 B CSS (0) | — | — · — · — |
| AlertDialog | 134.4 kB (0) · 16.3 kB CSS (0) | — | — · — · — |
| AppShell | 102.6 kB (0) · 14.9 kB CSS (0) | — | — · — · — |
| Avatar | 47.0 kB (0) · 6.0 kB CSS (0) | — | — · — · — |
| AvatarGroup | 49.8 kB (0) · 6.1 kB CSS (0) | — | — · — · — |
| AvatarGroupOverflow | 53.0 kB (0) · 6.0 kB CSS (0) | — | — · — · — |
| Banner | 70.0 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 84.3 kB (0) · 12.1 kB CSS (0) | — | — · — · — |
| Button | 67.9 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| Calendar | 79.1 kB (0) · 11.8 kB CSS (0) | — | — · — · — |
| Carousel | 78.1 kB (0) · 12.1 kB CSS (0) | — | — · — · — |
| ChatComposer | 90.9 kB (0) · 13.5 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 88.0 kB (0) · 12.5 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 88.0 kB (0) · 12.5 kB CSS (0) | — | — · — · — |
| ChatDictationButton | 68.5 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| ChatLayout | 91.6 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| ChatLayoutScrollButton | 68.5 kB (0) · 11.4 kB CSS (0) | — | — · — · — |
| ChatMessageList | 28.7 kB (0) · 7.4 kB CSS (0) | — | — · — · — |
| ChatSendButton | 68.3 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 33.1 kB (0) · 8.8 kB CSS (0) | — | — · — · — |
| CheckboxInput | 71.7 kB (0) · 10.7 kB CSS (0) | — | — · — · — |
| CheckboxList | 75.8 kB (0) · 8.2 kB CSS (0) | — | — · — · — |
| CheckboxListItem | 82.7 kB (0) · 12.6 kB CSS (0) | — | — · — · — |
| CodeBlock | 84.0 kB (0) · 12.9 kB CSS (0) | — | — · — · — |
| CommandPalette | 83.9 kB (0) · 13.5 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 34.3 kB (0) · 7.9 kB CSS (0) | — | — · — · — |
| ComplexSelector | 84.1 kB (0) · 13.3 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 39.1 kB (0) · 7.3 kB CSS (0) | — | — · — · — |
| DateInput | 209.4 kB (0) · 19.0 kB CSS (0) | — | — · — · — |
| DateRangeInput | 106.6 kB (0) · 14.2 kB CSS (0) | — | — · — · — |
| DateTimeInput | 233.3 kB (0) · 20.7 kB CSS (0) | — | — · — · — |
| DialogHeader | 71.2 kB (0) · 12.9 kB CSS (0) | — | — · — · — |
| DrawerHeader | 71.3 kB (0) · 14.3 kB CSS (0) | — | — · — · — |
| DropdownMenuCheckboxItem | 29.5 kB (0) · 7.6 kB CSS (0) | — | ✓ · ✓ · ✓ |
| DropdownMenuDivider | 5.4 kB (0) · 548 B CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuGroup | 6.6 kB (0) · 3.4 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuItem | 28.7 kB (0) · 7.1 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuRadioGroup | 6.7 kB (0) · 3.4 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuRadioItem | 29.6 kB (0) · 7.6 kB CSS (0) | — | ✓ · ✓ · — |
| Field | 61.7 kB (0) · 7.7 kB CSS (0) | — | — · — · — |
| FieldLabel | 57.3 kB (0) · 6.1 kB CSS (0) | — | — · — · — |
| FileInput | 77.8 kB (0) · 12.9 kB CSS (0) | — | — · — · — |
| Heading | 12.5 kB (0) · 5.8 kB CSS (0) | — | — · — · — |
| HoverCard | 31.1 kB (0) · 4.8 kB CSS (0) | — | — · — · — |
| IconButton | 67.9 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| InfoTip | 52.0 kB (0) · 5.7 kB CSS (0) | — | — · — · — |
| InputGroup | 63.8 kB (0) · 8.9 kB CSS (0) | — | — · — · — |
| LayerProvider | 4.4 kB (0) · 20 B CSS (0) | — | ✓ · ✓ · — |
| Lightbox | 151.6 kB (0) · 12.3 kB CSS (0) | — | — · — · — |
| Link | 58.2 kB (0) · 7.4 kB CSS (0) | — | — · — · — |
| ListItem | 81.8 kB (0) · 12.6 kB CSS (0) | — | — · — · — |
| MobileNav | 80.3 kB (0) · 11.8 kB CSS (0) | — | — · — · — |
| MobileNavToggle | 68.2 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| MultiSelector | 109.6 kB (0) · 18.9 kB CSS (0) | — | — · — · — |
| NavHeadingMenuItem | 17.1 kB (0) · 6.7 kB CSS (0) | — | — · — · — |
| NumberInput | 106.6 kB (0) · 13.1 kB CSS (0) | — | — · — · — |
| ProgressBar | 12.5 kB (0) · 6.7 kB CSS (0) | — | — · — · — |
| RadioList | 63.2 kB (0) · 7.7 kB CSS (0) | — | — · — · — |
| RadioListItem | 78.7 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| SegmentedControl | 103.7 kB (0) · 7.2 kB CSS (0) | — | — · — · — |
| SideNav | 125.7 kB (0) · 12.6 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 68.8 kB (0) · 11.2 kB CSS (0) | — | — · — · — |
| SideNavItem | 82.8 kB (0) · 12.3 kB CSS (0) | — | — · — · — |
| Slider | 117.2 kB (0) · 9.3 kB CSS (0) | — | — · — · — |
| Spinner | 25.3 kB (0) · 6.6 kB CSS (0) | — | — · — · — |
| StatusDot | 34.8 kB (0) · 5.7 kB CSS (0) | — | — · — · — |
| Stepper | 69.6 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| Switch | 111.8 kB (0) · 10.5 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 78.4 kB (0) · 14.6 kB CSS (0) | — | — · — · — |
| TabList | 48.5 kB (0) · 6.8 kB CSS (0) | — | — · — · — |
| Text | 11.6 kB (0) · 5.8 kB CSS (0) | — | — · — · — |
| TextArea | 95.3 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| TextInput | 101.7 kB (0) · 12.9 kB CSS (0) | — | — · — · — |
| Thumbnail | 72.3 kB (0) · 12.7 kB CSS (0) | — | — · — · — |
| TimeInput | 181.5 kB (0) · 17.9 kB CSS (0) | — | — · — · — |
| Timer | 14.1 kB (0) · 6.4 kB CSS (0) | — | — · — · — |
| Timestamp | 28.0 kB (0) · 11.4 kB CSS (0) | — | — · — · — |
| Toast | 107.7 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| ToggleButton | 95.2 kB (0) · 11.3 kB CSS (0) | — | — · — · — |
| Tokenizer | 113.1 kB (0) · 21.9 kB CSS (0) | — | — · — · — |
| Toolbar | 48.4 kB (0) · 8.6 kB CSS (0) | — | — · — · — |
| Tooltip | 33.1 kB (0) · 4.8 kB CSS (0) | — | — · — · — |
| TopNav | 82.1 kB (0) · 12.1 kB CSS (0) | — | — · — · — |
| TopNavMegaMenu | 82.1 kB (0) · 13.1 kB CSS (0) | — | — · — · — |
| Typeahead | 95.1 kB (0) · 14.4 kB CSS (0) | — | — · — · — |
| lab/CommentPin | 61.8 kB (0) · 1.2 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 92.5 kB (0) · 372 B CSS (0) | — | — · — · — |
| lab/DiffViewer | 95.9 kB (0) · 2.1 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 121.3 kB (0) · 751 B CSS (0) | — | — · — · — |
| lab/LineClamp | 14.1 kB (0) · 168 B CSS (0) | — | — · — · — |
| lab/ListInput | 97.5 kB (0) · 922 B CSS (0) | — | — · — · — |
| lab/Schedule | 119.1 kB (0) · 3.9 kB CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 72.1 kB (0) · 162 B CSS (0) | — | — · — · — |
| lab/TabBarMoreList | 105.1 kB (0) · 1.8 kB CSS (0) | — | — · — · — |
| lab/TourStep | 97.1 kB (0) · 691 B CSS (0) | — | — · — · — |
| lab/TransferList | 139.9 kB (0) · 1.2 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 151.9 kB (0) · 1.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 311.2 kB (0) · 2.7 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 287.9 kB (0) · 2.4 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 7.99 MB packed (+3.8 kB); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
f4634c0 to
9f00657
Compare
There was a problem hiding this comment.
This needs an engineering owner's decision before it can be approved: the touch motion follows the draft AST-094, whose FR4 narrows the current theme-tokens architecture (INV3) to pointer presentations, and the useMenuPress FR8, FR9, DEC-4 and DEC-8 are still proposals. An 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 ruling, these changes are still needed:
- Rebase onto the landed predecessors, or split, so this pull request carries its own change rather than 28,469 changed lines.
- Show the menu's closing copy in the top layer instead of beside the popover with
position: fixedandz-index: 2147483647, which AST-027 DEC-3 rules out for menus. - Keep the pan-outside dismissal's pointer set across renders in
DropdownMenu.tsx. - Bring
useMenuPress.spec.md(the 500 ms row, FR9 and DEC-4) in line with the 150 ms hold and the 10 px handoff. - Name the old
longPressDelayMsdefault and its restoring option in the changeset, and recommend onlytouch-action: pinch-zoomfor a press-open trigger.
[Automated review]
|
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. |
|
Agreed: one implementation.
|
9f00657 to
e88dc4c
Compare
|
/approve-spec 093df78 |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #12216.
A finger's open raised two viewport shields: the hold until the grow's first frame keyed on the menu's surface, and the entrance hold on its popover. Each showed its shield in the top layer, which forces a style update in the open's task. The touch presentation's holds now key on the top-layer popover around the surface (holdLayerOf), so they share one shield. The gap until the first frame stays held over the viewport.
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #12216.
|
/approve-spec 4651f21 |
|
/approve-spec a03b535 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this revision yet, and it runs once the pull request leaves draft.
Under a finger or a pen, DropdownMenu and MoreMenu now grow out of their trigger and shrink back into it on Popover's own surface motion, as spec:AST-094 FR31 requires. An engineering owner approved the record text this pull request adds at this revision, the reference-page sizes are reported, and the code needs no change.
- Non-blocking: the Stack line still does not hold, because #9777's description carries only the five-entry line and this description still names #12179 and #12216, which do not contain this revision; one identical Stack line in every listed description, naming only pull requests the top contains, lets them be reviewed as a stack again.
Claims and files checked
Review mode: same-head; reason: none
- Release note: under a finger or a pen, DropdownMenu and MoreMenu grow out of the trigger on open and shrink back on close, on Popover's path and timing: verified (
DropdownMenu.tsx:1206-1219hands the touch decision to Popover's surface motion;MoreMenu.tsx:164renders DropdownMenu; unit and browser grow cases). - Release note: a tap's open grows as a hold's does: verified (unit case for a tap that opens at its lift in a scroll view).
- Release note: under Reduce Motion on a phone or tablet the menu fades in at its size and out where it stands: verified (two browser cases; the animator decides).
- Release note: a mouse, the keyboard and
presentation="popover"keep the layer's entrance: verified (DropdownMenu.tsx:2040picks the pointer model forpopover; unit and browser mouse cases). - Description: the released finger entrance was a fade, a short slide and a scale up from 0.95: verified (
Layer/layerAnimations.stylex.ts). - Description: the grow starts from the trigger's box without its press scale, for Popover too: verified (
usePopoverSurfaceMotion.ts:182reads it throughsettledBox; a unit case per path). - Description: the grow ships with the menu, so the first open grows: verified (static import; unit case for the first open;
lazy-sheet-bundle.test.mjspins the eager animator). - Description: under a coarse primary pointer taps stay held from the open until the menu shows, and a touchscreen laptop holds none: verified (
usePopoverSurfaceMotion.ts:91-93,popoverSurfaceMotion.ts:333; unit cases). - Description: a finger's open shows one input shield, not two: verified (every hold keys on the top-layer popover; unit case for one viewport shield).
- Description: an open the layer holds until its trigger is a valid anchor still grows, also after a key press or another press: verified (unit cases in
DropdownMenuTouchGrowPending.test.tsx). - Description: a second finger, a closed controlled menu, a refused reopen and a disabled trigger leave a later open from code with the entrance: verified (unit cases).
- Description: the record edits it lists (two FR31 sentences; FR21's grow gap closing, its Reduce Motion fade and its remaining pan-dismissal gap; the Popover options; the layer runtime's unscaled source; the press model's internal report and PR4): verified in the diff.
- Description: no export, prop, type or default changes: verified (the API generator lists no row).
- Description: the internal options and press report are new, Popover passes neither option, and the earlier rect-morph and lazy-load modules are gone: verified (
Popover.tsx:554,:607; those files are absent). - Description: reference-page sizes (docs and form unchanged, menu about +18.8 KB, table under 0.1 KB): verified at this revision (+0, +0, +18,804 B and +95 B gzip).
- Description: the app-level and Popover-only page sizes and the menu page's byte breakdown: stated, not re-measured.
- Description: module sizes for the shared-engine rule: stated against an earlier
main; at this revision the files are 2,046, 1,217, 416, 206 and 302 lines, and the judgement is unchanged. - Description: lines added and removed over earlier ranges: stated; at this revision the pull request's own diff is +1,967/−85.
- Description: Popover's frames within 0.01 scale and 0.02 progress, and on a phone the menu opens below its trigger: covered by browser cases with those bounds; not rerun here.
- Description: real-iPhone and Android emulator side-by-sides at the previous revision against the revision the owner passed: stated in text and accepted; they carry here because this revision only merges
main, which touches the pull request's own files only in two records and none of the shared motion and layer modules. - Description: red-first, local gate, browser, accessibility and preflight results at earlier revisions: stated, not rerun; the six unit files pass at this revision (388 tests).
- Description: the writing-rubric results (FR21's verification row names the grow tests; its pan-dismissal gap stays): verified.
- Description: both Stack lines: neither holds at this revision, so this pull request is reviewed on its own.
- Files:
.changeset/menu-touch-grow.md,apps/sandbox/scripts/next-export-routes.json,apps/sandbox/src/app/(raw)/pages/menu-grow-cases/page.tsx,apps/sandbox/src/app/sandboxPages.ts: clear. - Files:
docs/architecture/layer-runtime.md,docs/specs/AST-094-touch-presentations/spec.md,docs/specs/components/DropdownMenu/DropdownMenu.spec.md,docs/specs/components/DropdownMenu/modules/useMenuPress.spec.md,docs/specs/components/Popover/Popover.spec.md: clear. - Files:
packages/core/src/DropdownMenu/DropdownMenu.tsx,packages/core/src/Popover/usePopoverSurfaceMotion.ts,packages/core/src/Popover/popoverSurfaceMotion.ts,packages/core/src/hooks/useMenuPress.ts,packages/core/src/Layer/settledBox.ts: clear. - Files:
DropdownMenu.test.tsx,DropdownMenuTouchGrow.test.tsx,DropdownMenuTouchGrowPending.test.tsx,DropdownMenuEntranceHold.interaction.browser.spec.ts,DropdownMenuTouchFocusRing.a11y.chromium.spec.ts,DropdownMenuTouchGrow.interaction.browser.spec.ts,MenuPress.a11y.chromium.spec.ts,popoverSurfaceMotion.test.ts,usePopoverSurfaceMotion.test.tsx,useMenuPress.test.tsx,scripts/lazy-sheet-bundle.test.mjs: clear. - Files: 25 of 25 files read, each consistent with the others.
The pr-interaction leg that ran it took 13.2 s for its 11 tests, timed as recordLog times a file. Without a time, fewer than nine in ten of the interaction specs on main plus this change have one.
|
/approve-spec 81d6e84 |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #11859.
|
/approve-spec b01d48c |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #11859.
|
/approve-spec 47b1104 |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #11859.
|
/approve-spec a5cfd2a |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #11859.
|
/approve-spec a5cfd2a |
cixzhang
left a comment
There was a problem hiding this comment.
Engineering-owner approval at this exact head (a5cfd2a), posted by Cindy's agent (agent-made, not a human review) under her standing instruction. Stack member of #11859: CodeBunny approves the stack at the top (review 6012351035, after this head), CI is green at this head, and Specs records are current.
Base: main. Stack: #9777 → #8080 → #11859.
User need
Under a finger a DropdownMenu played the layer's own entrance: a fade, a
--spacing-2slide and a scale up from 0.95. A Popover, like an iOS menu, grows out of its control.Problem and solution fit
A finger's or a pen's open now grows the menu out of its trigger, and its close shrinks it back (
spec:AST-094FR31). It plays Popover's own surface motion, on its path and timing tokens, from the trigger's unscaled box.A tap's open, at the lift in a scroll view too, counts as a finger's.
The grow ships with DropdownMenu, so even the first open grows. Under a coarse primary pointer, taps stay held from the open until the menu shows.
Current specification
spec:AST-094FR31 adds that tap-opened layers grow on Popover's surface motion, and that an open without an accepted press keeps the layer's entrance; and FR45.component:DropdownMenuFR21: its grow gap closes, Reduce Motion fades (design:reduced-motionDR2), and its pan-dismissal gap stays.component:Popovernames the options DropdownMenu passes.architecture:layer-runtimeINV22: the grow measures its source unscaled, for Popover too.module:DropdownMenu/useMenuPressnamesuseMenuPressInternal; PR4 says why no engine fits.Public delta and caller burden
presentation="popover"keep the layer's entrance.Design and alternatives
Evidence
spec:AST-094Current-state impact;component:DropdownMenuFR22).Writing rubric results
R1 narration, R2 research, R4 rejected alternatives, R5 change references, R6 open questions: none. R3 evidence: FR21's verification row names the grow tests. R7 project status: FR21 keeps its pan-dismissal gap.
Scope
Components: DropdownMenu, MoreMenu, Popover (surface motion options, coarse-only hold, unscaled source box),
useMenuPress(internal click report).Testing
At 4651f21: 2db3ef8 with nine merges, a test fix and a shield fix. 315db84 merges main 120629d (#11938), which changes
DropdownMenu.tsx,Layer/useLayer.tsxandLayer/gestureCounter.ts. 01f57af merges #9777's head 584d8a3, below it in the stack. That merge changes two direct imports:utils/inputStream.ts, fromuseMenuPress.ts, andutils/touchQueries.ts, fromDropdownMenuTouchGrow.test.tsx. It also changes the sandbox route list, edited here, which Git merges with no conflict. 9318341 fixes a test, below. 76439a4 merges #9777's head c3e3df7, which merges main ffd1c8e. That merge changesButton/Button.tsxandTooltip/Tooltip.tsx(#12169), whichDropdownMenu.tsx, the sandbox page andDropdownMenu.test.tsximport. It changes no file edited here. Then 42d1bf8 merges #9777's head f1b8bf3, which merges main be7f821. That merge changes only main's Selector, CLI, docs and CI files, which nothing here imports. Then 6ff65df merges main 9e83b70, which has #9777's squash and #12619. That merge changes no file edited here. Of the files that this change imports, it changesDropdownMenu/lazyMenuBottomSheet.ts(#12619), and only the comments ofutils/focusOutline.stylex.ts. Then 02b9ae6 merges main cda6ca7, which brings #12644. That merge changes no file edited here. Of the files that this change imports, it changes onlyhooks/useTypeahead.ts, fromDropdownMenu.tsx. Then 53e66d6 merges main 230045a. Git merges six files edited here with no conflict:DropdownMenu.tsx,DropdownMenu.test.tsxand four records. This change's own lines in them are unchanged. Then 093df78 merges main c1c5cdf. Git merges three files edited here with no conflict:DropdownMenu.test.tsxand two records. This change's own lines in them are unchanged. Then 5c385e8 merges main 4493a3c. Git merges four files edited here with no conflict:DropdownMenu.tsx,DropdownMenu.test.tsxand two records. This change's own lines in them are unchanged. Then 4651f21 makes a finger's open show one input shield, not two (below).At 093df78 (test): the ui project (26,789, at 16 workers), the core type check,
pnpm check:knowledgeandpnpm check:repopass. ESLint and Prettier pass on the changed files, with main's lint config. At 53e66d6, DropdownMenu's, the hooks', Layer's and Popover's interaction specs pass in Chromium (192 pass, 11 skip). They pass in WebKit's CI container too (149 pass, 54 skip). DropdownMenu's, ContextMenu's, Selector's, the hooks' and Layer's accessibility specs pass in Chromium (394).Before those merges, at 2db3ef8, on main a79b454. Its 6f51984 moves the menus onto Popover's own surface motion. Then main is merged in without the rect morph stack. Then d15f2d7 measures the trigger without its press scale. Then main is merged again, and dfbaecc commits
presentSurfaceRefthroughuseCommittedRefInto. Then 1a4c38a reads the click's press from the press model, and 681ed71 and a2c2f3c record it. Then 6c8aeaa merges main a65ea05. Then 0cd83b8 marks a finger's open only where the menu opens, and dd68a2a ties that mark to its gesture. Then b9c1bdb clears it for an open from code. Then 26af8e6 merges main a4595ef, and 827967d lets Reduce Motion play Popover's fade. Then e15b9fd merges main 3449161 (#10905), which already importsuseCommittedRefInto. Git merges it with no conflict but keeps both imports, so the merge commit drops this pull request's copy. Then c765ff2 says Reduce Motion fades only on a coarse pointer, and 6a89434 merges main 36f68b0. Then 9fa057e merges main 4800d99. That merge changes five direct imports of the code here: #7677'sPopover/usePopover.tsx,Layer/inputHold.ts(#11447, #8373), #8373'smotion/themeTiming.ts, #10949'sPopover/popoverSurfaceFrame.tsand #11578'sDropdownMenu/menuItemRoles.ts. Two tests' direct imports change too:DropdownMenuSubMenu.tsx(#7677), fromDropdownMenu.test.tsx, andLayer/__tests__/layerEntranceSide.fixture.ts(#10949), frompopoverSurfaceMotion.test.ts. The sandbox page imports@astryxdesign/core/Button, which #11062 and #7677 change. Main also changes seven files edited here, among them #8373'spopoverSurfaceMotion.tsand #8690's sandbox lists; Git merges all seven with no conflict. Then efe9125 merges main 8d3e010. That merge changes one direct import, #11682'sPopover/usePopover.tsx, and no file edited here. Then 3529093 merges #11796, with main 270f680. It changeslayer-runtime.md, which this pull request edits, and Git merges it with no conflict. It changes no direct import. Then c0dc00f adds the menu's case for #11796's fix. Then f9885ce adds the press model's record line, PR4. Then 1acd00c merges #11796's test update, f25d71c. Then 37cf451 merges main 16fe6a8, through 2937d9a. That merge changesLayer/inputHold.ts(#11684), whichuseMenuPress.ts, both Popover surface-motion files and four of the tests here import directly. It changes no file edited here. Then f894ca8 merges main da710f6, through 7373633. That merge changes two direct imports: #11599'sLayer/gestureCounter.tsand #11616'sDropdownMenu/lazyMenuBottomSheet.ts. Main also changes two files edited here, the AST-094 spec and the sandbox route list. Git merges both with no conflict. Then 946e2b5 merges main 8c8dd05, #11796's squash. Its #11796 lines are already here, and it changes no direct import. Then 804b708 merges main a79b454, which holds #11905's squash 5a24fc0. That merge changes three direct imports ofDropdownMenu.tsx:Layer/useLayer.tsx(#11864, #11892, #11905), #11905'sPopover/usePopover.tsxandutils/accessibleName.ts(1d2d629). Main also changes four files edited here:DropdownMenu.tsx,DropdownMenu.test.tsx,layer-runtime.mdand the sandbox route list. OnlyDropdownMenu.tsxconflicts, inopenAndFocus. The merge keeps #11905's'open' | 'pending' | 'refused'result and this pull request's touch marks. Last, 2db3ef8 keeps a finger's open growing when the layer makes that open wait. On the sandbox page "Menu grow cases" (/sandbox/pages/menu-grow-cases/), on a phone:Android emulator (test), Android 16 with Chrome 133, at 76439a4, side by side with the earlier head 781b36e, whose runs passed. The merge to 42d1bf8 changed nothing here, so these runs carried to it.
design:reduced-motionDR2). 781b36e's 2 scale frames were a defect. At the other speeds, frame counts vary in both directions.iPhone 14 (test), iOS 26.2 Safari with Reduce Motion off, at 42d1bf8 side by side with 781b36e. The Reduce Motion setting was read from Settings before the first take. Each take read the build's
version.jsonfirst. The builds alternated, with 2 takes per case. The phone's screen stream ran at 39 to 41 frames a second, and at 35 to 36 on the Projects page.Neither set carries to 6ff65df. Its main merge changes
DropdownMenu/lazyMenuBottomSheet.ts, whichDropdownMenu.tsximports (spec:AST-094DEC-31). Both sets ran again at 6ff65df.Android emulator (test), Android 17 with Chrome 145, at 6ff65df side by side with 42d1bf8. Both are static builds of those commits, and each cell read both builds'
version.jsonbefore its takes. The emulator could not reach the web font host, so both builds drew fallback fonts.version.json. It ran again.iPhone 14 (test), iOS 26.2 Safari, at 6ff65df side by side with 42d1bf8. Reduce Motion was off, read from Settings before and after the takes. The phone read each build's
version.jsonbefore the takes. Three rounds of Projects, Actions, More options and Controlled Menu alternated the builds: 24 takes, all kept.iPhone 14 (test), iOS 26.2 Safari, at 6ff65df side by side with the earlier head 781b36e, whose runs passed. Reduce Motion was off, read from Settings before the takes. The phone read each build's
version.jsonbefore the takes. Three rounds of the same four cases alternated the builds: 24 takes, all kept.On this result, the owners carry 781b36e's device pass to 6ff65df. The device record is on file with the owners.
None of the device runs above carries to 093df78. The merge to 02b9ae6 changes
hooks/useTypeahead.ts, whichDropdownMenu.tsximports. The merge to 53e66d6 changesDropdownMenu.tsxitself and the sharedgestures/GestureHost.ts. The merge to 093df78 changes the sharedLayer/useLayer.tsx(spec:AST-094DEC-31). So the iPhone ran again at 093df78, below. Then the merge to 5c385e8 changesDropdownMenu.tsx,Popover/usePopover.tsx,utils/focusReturn.tsandutils/nodeType.ts: main's one focus return. Then 4651f21 changes the input holds' shield, below. On iOS, a repository owner checked the menus at 4651f21 on an iPhone. A real iPhone 14 with iOS 26.2 and Safari ran 9 takes at 4651f21, and all pass (test). An outside tap, a pick and a re-press each close the menu, 3 of 3. The trigger's box does not move, and no focus ring shows under the finger. A real iPhone and the Android emulator also ran at 4651f21 against 781b36e, below.iPhone 14 (test), iOS 26.2 Safari, at 093df78 side by side with 781b36e. The phone read each build's
version.json, and Reduce Motion read as off. Each case ran 3 takes per build, with the builds interleaved: 24 takes, all kept.9318341 changes only
DropdownMenuTouchGrowPending.test.tsx, to fix a flaky case. Its header said another press cancels a waiting open, which was wrong: nothing in this pull request or in main does that. The case passed only when its last check ran before the layer's deferred show. Now it flushes that release's next task and pins the actual behavior: the open shows after the other press's release, and still grows. Under load from four parallel copies, it fails 0 of 24 runs (test). The old check fails 10 of 10 at 01f57af once that task runs.A finger's open can wait: the layer holds it until its trigger is a valid anchor. 2db3ef8 marks such an open, so it still grows when it shows. The new
DropdownMenuTouchGrowPending.test.tsxcovers it in jsdom, with the layer's layout stubbed. Its case "grows a finger's open that waits, also when a key is pressed before it opens" fails at 804b708, without the fix. There that open plays the layer's own entrance. A new browser case taps a trigger in a closed dialog that the page displays, and the menu grows. It passes at 804b708 and at 2db3ef8, in Chromium and in WebKit's CI container. The layer decides there inside the press, so the case guards that path's real timing, not the fix.Taps stay held from the open to the grow's first frame, where the grow's own hold takes over. The unit case "keeps taps off the page from a finger's open until the grow's first frame" checks it. So does
DropdownMenuEntranceHold.interaction.browser.spec.ts, which passes at 2db3ef8 in both engines.4651f21 keys those holds on the top-layer popover around the menu's surface, as the entrance hold already is. The three holds then share one shield. So a finger's open shows one shield in the top layer, not two, and the gap until the first frame stays held over the viewport.
Under Reduce Motion, Popover's surface motion plays its 200 ms cross-fade. An open's first frame shows the menu at opacity 0, at its full size and place. A tap outside fades the menu out where it stands, within 200 ms. The touch-grow spec's two Reduce Motion cases check both, and pass at 2db3ef8 in both engines. At 26af8e6, as on main, that close removed the menu in one frame.
The menu's close plays on the layer runtime's exit copy, which #11796 fixes. A new case, "a finger's close copy draws the menu's rows where the open menu drew them", checks it. With this case on efe9125, before #11796, the copy's first row sits 4 px right of the open menu's, in 2 of 2 runs. At 2db3ef8 it passes in Chromium and in WebKit's CI container.
Local gates, at 2db3ef8: the ui project (25,920), the core type check, strict ESLint,
pnpm check:knowledge,pnpm check:repoandpnpm review:prepass. The Node project passes 25,399 cases and fails 6, all underpackages/cli. The same 6 fail on main a79b454 on this machine, and they pass when run alone (72 cases). This pull request changes no file underpackages/cli. The DropdownMenu, hooks, motion, Layer, nav, Popover, BottomSheet, Carousel and SnapPaging interaction specs pass in Chromium: 462 pass, 17 skip. In WebKit's CI container at one worker: 374 pass, 105 skip. Motion's set includesanimatedLayout,animatedLayoutAdopters,animatedLayoutBusy,animatedLayoutRevealPaint,themeTempoandthemeTiming. Their accessibility specs, with ContextMenu's, Selector's and NavMenu's, pass in Chromium (414), and the browser ones in WebKit's container (22). Two press-model cases inDropdownMenu.test.tsxstub the presentation's input hold, which jsdom never ends. The browser touch-press specs cover the real hold in both engines.scripts/lazy-sheet-bundle.test.mjsnow pins DropdownMenu's import loading the animator at once, for the grow;rideKeyboardstill waits for the sheet. At 92dd62a, the lazy base, that updated case fails.DropdownMenuTouchFocusRing.a11y.chromium.spec.tsread its held finger's row while the menu grew. At six workers its lift missed the row twice in 20. It now reads the row once the grow rests: 60 of 60 at six workers, at 2db3ef8.Red first, at dfbaecc: on main 923b53a, "the menu's grow follows Popover's path and timing, frame by frame" fails. There the menu plays the layer's own entrance, not the grow. A new
popoverSurfaceMotion.test.tscase, "holds nothing under a fine primary pointer", fails on the old motion, which held every touch. Two new unit cases, for Popover and the menu, press-scale the trigger 0.98 about its centre. At ea3b6ce the grow read its source at 117.6 × 43.12 px; at dfbaecc, at 120 × 44. The frames stay the same, since the grow reads only the source's centre and the side it faces. A second finger's tap, a press the press model ignores, now keeps the layer's entrance; at dfbaecc it grew. Two new cases open a controlled menu from code after a finger's tap that did not open it. One tap closes the menu, and one presses an aria-disabled trigger. At 6c8aeaa both opens grew; now both play the layer's own entrance. One more case lets the light dismiss close the menu at the lift, before the tap's click. The layer refuses that click's reopen. At 0cd83b8 a later open from code grew; now it plays the entrance. A last case opens the menu from code right after that refused reopen, before any other press. At dd68a2a it grew; now it plays the entrance. Under Reduce Motion, a new browser case closes the menu with a tap outside and reads the exit copy's frames. At 26af8e6 nothing fades, in both engines. Now the copy fades out at the menu's place within 200 ms, and two unit cases pin it.Earlier red first: a new case pins that a finger's first open on a page grows at once. At a831c2c, the lazy head, it fails: the grow waits for its code. At 61b57b9, with a tap's lift open counted as a mouse's, only the scrolling-content tap fails. Under Reduce Motion, the new unit and browser cases and two entrance-hold cases fail, and so does the theme case. Before the hold until the grow's first frame, both tap-hold cases fail.
Review only this pull request's change: vjeux/astryx@4493a3c...4651f21
Real iPhone 14 (test), iOS 26.2 with Mobile Safari 26.2, at 4651f21 against 781b36e. Each take relaunched Safari, read the build's
version.jsonand was checked against a screenshot.Android emulator (test), Android 17 with Chrome 145, at 4651f21 against 781b36e. Each take read the build's
version.json.At 4× CPU on an Android emulator, first-visible paired medians are +19 ms (More options) and +21 ms (actions timing) against the earlier implementation (test). Repository owners judged these differences not major. In desktop Chromium at 4× CPU, this change's open task runs 18.8 and 14.9 ms longer than main's (test). It forces no extra layout. A follow-up trims the press model and grow setup.
The device runs above do not carry to b01d48c. Its merge of main facdcb9 brings #11156's changes to
Layer/useLayer.tsx,Popover/usePopover.tsx,Layer/gestureCounter.tsandutils/focusReturn.ts.DropdownMenu.tsxand its press model import them (spec:AST-094DEC-31). The same cases ran again at b01d48c, side by side with 4651f21 in one session. The device record is https://github.com/vjeux/astryx/blob/318b3083346af8d5ec299487532e0afbc2aadb4c/index.md.Real iPhone 14 (test), iOS 26.2 with Mobile Safari 26.2, at b01d48c against 4651f21. Each take relaunched Safari, read the build's
version.jsonand was checked against a screenshot.Real Pixel 8 phones (test), Android build CP3A.260905.009 with Chrome 156 or 157, at b01d48c against 4651f21. They follow
spec:AST-094DEC-27 as amended: the pinned test kit, raw logs and the evidence verifier. A second Pixel 8 ran Actions and the held Projects under reduced motion. Both passed on both builds.The device runs above do not carry to a5cfd2a. Its merge of main 3b1719a brings #13436's and #13526's changes to
Layer/inputHold.ts, and #9763's tomotion/animator.ts.Popover's surface motion imports both, and the menu's press model imports
Layer/inputHold.ts(spec:AST-094DEC-31). The merge also brings #12888's change toutils/scrollView.ts, which reaches a menu only inside a bottom sheet.The same cases ran again at a5cfd2a, side by side with b01d48c. The device record is https://github.com/vjeux/astryx/blob/47dfbc45ae782be1607bae3ea3c21b428bdfaa74/index.md. The repository owners found no major difference.
Real iPhone 14 (test), iOS 26.2 Safari, at a5cfd2a against b01d48c. Each take read the build's
version.json.Real Pixel 8 phones (test), Chrome 156 or 157, at a5cfd2a against b01d48c. Each take read the build's
version.json.The automated review's comment-style note on
DropdownMenu.tsxline 1054 goes to a follow-up pull request. A change to that file here would end the carry of this head's device evidence (spec:AST-094DEC-31).At the live head (test), a5cfd2a merges main 3b1719a. The strict
pnpm preflight --browserpasses there, and it reports "ready to flip". It ran withASTRYX_STRICT_LINT=1. Its Chromium interaction step passes 1,935 tests and skips 54. That step's selection reads: "Chromium selection: the full suite (the change touches shared infrastructure or is undecided)."Public and internal API delta
Size: +1,912/−85 lines (a79b454..2db3ef8), tests included. 4651f21 adds +54/−6.
App-level size: +496 B gzip, eager, on the 12-component page above; without the menus, +224 B. A Popover-only page gains 135 B, for the options below. A DropdownMenu and MoreMenu page gains 18,665 B: the grow loads with the page. A Lightbox page is unchanged.
architecture:component-import-boundariesINV10's pages, at 4651f21 against main 4493a3c (test): docs and form unchanged, menu +18,814 B, table +88 B. The other pages are measured at 2db3ef8 against main a79b454. The method is.github/scripts/lib/component-size.js's: the size report's esbuild options, eager chunks only. The grow is default behavior under a finger, so INV10's optional-feature budget does not apply (DEC-5). A shared module's growth is reported here, as INV10 asks.Size follow-up: at this head, the menu reference page's first-load gzip grows 18,814 B (test). It is to shrink by deferring what can defer.
On a page with DropdownMenu and MoreMenu and no Popover, the grow adds 18,665 B gzip. It buys the grow on a finger's first open, since the grow loads with the page (
spec:AST-080DEC-5). By minified bytes, about 77% of what it adds is the animator and the motion modules it uses. The layer runtime's exit copy is 12%, Popover's surface motion 8%, and the rest, the menu's own new code included, 2%. Every page that shows a Popover already loads all of these, so there the grow adds about 0.5 KB, as on the 12-component page. The part that could slim is the animator, which every animated component shares; this pull request does not change it.Modules this pull request grows, none new.
architecture:react-component-runtimeINV19 asks a behavior module over 300 lines or 3 KB gzip to name its shared engine. Lines are source lines, against main a79b454.DropdownMenu/DropdownMenu.tsxuseMenuPress.hooks/useMenuPress.tsPopover/popoverSurfaceMotion.tsPopover/usePopoverSurfaceMotion.ts.github/scripts/lib/component-size.jsmeasures an import.Layer/settledBox.tsPublic: none. No export, prop, type or default changes.
Internal, new in an existing Popover module, named in
component:Popover:usePopoverSurfaceMotion.ts:PopoverSurfaceMotionOptions, withholdUntilFirstFrame, andpresent'sisTouch. Popover passes neither.usePopoverSurfaceMotion({holdUntilFirstFrame: true}).Internal, new in
hooks/useMenuPress.ts:useMenuPressInternalreturnsuseMenuPress's calls andtriggerClickPointerType(), the pointer type of the press a trigger click comes from. DropdownMenu reads it; publicuseMenuPressis unchanged.Internal, removed:
createRectMorphSurfaceMotion,useMenuSurfaceMotion.ts,menuSurfaceMotion.ts,menuExit.stylex.tsandreducedMotionPreference.ts, which earlier heads added.Stack: #9777 → #8080 → #11859