Skip to content

Add adaptive menu presentations - #5654

Merged
rubyycheung merged 42 commits into
fix/dropdown-menu-responsive-interactionfrom
feat/adaptive-menu-presentation
Aug 30, 2026
Merged

rubyycheung merged 42 commits into
fix/dropdown-menu-responsive-interactionfrom
feat/adaptive-menu-presentation

Conversation

@rubyycheung

@rubyycheung rubyycheung commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add popover, bottom-sheet, and adaptive presentation policies to DropdownMenu
  • forward the policy through MoreMenu and support it in ContextMenu
  • keep the adaptive resolver in neutral overlay infrastructure rather than under one component
  • share one MenuBottomSheet frame across DropdownMenu and ContextMenu; MoreMenu inherits it through DropdownMenu
  • keep component-specific behavior local: button opening and submenu navigation in DropdownMenu, right-click and long-press targeting in ContextMenu
  • preserve focus after dismissal while suppressing pointer-origin focus rings
  • add component stories, docsite examples, API guidance, tests, and a changeset

adaptive selects the BottomSheet at 768px and below when the primary pointer is coarse. The default remains popover for compatibility. There is no item-count heuristic.

This PR is stacked on #5395 so the adaptive behavior can be reviewed separately from the responsive popover fit changes.

Architecture

BottomSheet remains the single primitive for dialog lifecycle, focus return, gestures, safe areas, scrolling, animation, and height. MenuBottomSheet owns only the shared menu-family frame and spacing. DropdownMenu and ContextMenu retain their distinct interaction controllers.

Test plan

  • pnpm exec vitest run packages/core/src/DropdownMenu/DropdownMenu.test.tsx
  • pnpm exec vitest run packages/core/src/ContextMenu/ContextMenu.test.tsx
  • pnpm exec vitest run packages/core/src/MoreMenu/MoreMenu.test.tsx
  • pnpm -F @astryxdesign/core typecheck
  • pnpm check:repo

@vercel

vercel Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 30, 2026 6:49pm

Request Review

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

@xinzi-bot xinzi-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Visual review — presentation matrix

Captured from PR head a2d8f81e using the exact docsite preview and a locally built Storybook:

Each set covers:

  • popover at 1280×900 with a fine pointer
  • bottom-sheet at 390×844 with a coarse pointer
  • adaptive at both sizes/pointer modes

The adaptive branch resolves to the anchored popover on desktop and the BottomSheet on compact touch for all three components in both surfaces. No visual blockers found.

@rubyycheung
rubyycheung force-pushed the fix/dropdown-menu-responsive-interaction branch 2 times, most recently from ddb8ad7 to af0f2c9 Compare August 29, 2026 04:05

@xinzi-bot xinzi-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for pushing this. ContextMenu bottom-sheet/adaptive still renders nested items through the normal flyout submenu path, unlike DropdownMenu's sheet drill-in. On compact touch, a nested action opens a cursor-style flyout inside the sheet instead of a reachable sheet view, so the new presentation doesn't work for the API it advertises. Please route ContextMenu data submenus through the sheet drill-in path too.

[Automated review]

…eraction' into feat/adaptive-menu-presentation

# Conflicts:
#	packages/core/src/DropdownMenu/DropdownMenu.test.tsx
@rubyycheung

Copy link
Copy Markdown
Contributor Author

Fixed in 4364c00. Data-driven ContextMenu bottom-sheet/adaptive presentations now use the same touch action-list and drill-in navigation as DropdownMenu, including a back affordance, focus transfer to the submenu heading, and reset on close. Added a regression test covering nested selection without opening a flyout. ContextMenu + DropdownMenu focused suites pass (144 tests), ESLint and core typecheck pass.

@xinzi-bot xinzi-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prior ContextMenu sheet submenu blocker is resolved, and I found no blocking regressions in the exact base→head range. @imdreamrunner, this looks ready for your approval.

[Automated review]

* feat: add adaptive selector presentations

* fix: refine selector bottom sheet interactions

* refactor(selector): use shared adaptive policy

* fix(selector): preserve focus without touch rings

* fix selectors bottom sheet focus target
@rubyycheung
rubyycheung merged commit e1fcd4c into fix/dropdown-menu-responsive-interaction Aug 30, 2026
6 checks passed
@github-actions
github-actions Bot deleted the feat/adaptive-menu-presentation branch August 31, 2026 06:28

This branch was successfully deployed

1 active deployment
Preview — 2aec1b4c Deployed Aug 30, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants