Skip to content

[context menu] Correct generated API metadata - #5523

Open
aarongarciah wants to merge 4 commits into
mui:masterfrom
aarongarciah:agent/fix-context-menu-api-metadata
Open

[context menu] Correct generated API metadata#5523
aarongarciah wants to merge 4 commits into
mui:masterfrom
aarongarciah:agent/fix-context-menu-api-metadata

Conversation

@aarongarciah

@aarongarciah aarongarciah commented Aug 17, 2026

Copy link
Copy Markdown
Member

Changes

  • add a Context Menu-specific Positioner documentation and type facade while retaining the shared Menu runtime implementation
  • document Context Menu's pointer anchor, fixed positioning, alignment, offsets, arrow padding, and context-specific side defaults
  • expose ContextMenu.Positioner.State in render callback signatures
  • document conditional Menu side and align defaults at the shared Menu API surface
  • reuse Positioner data-attribute and CSS-variable metadata through generator-discovered aliases
  • preserve legacy no-op props in TypeScript while hiding them from Context Menu API tables
  • correct anchor-related data attribute/CSS variable descriptions and the SubmenuTrigger.openOnHover default
  • regenerate the Context Menu and Menu API tables

Why

The Context Menu API generator reused the Menu Positioner symbol, so it documented Menu defaults such as trigger anchoring, absolute positioning, and center alignment instead of Context Menu's pointer anchor, fixed positioning, and start alignment.

The facade overrides metadata only where Context Menu behavior or terminology differs. Shared runtime behavior, state, collision behavior, data attributes, and CSS variables continue to come from their canonical declarations.

This is a documentation and type-surface correction; it does not change runtime positioning behavior.

@aarongarciah aarongarciah added docs Improvements or additions to the documentation. component: context menu Changes related to the context menu component. labels Aug 17, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026

Copy link
Copy Markdown

commit: 016562b

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 17, 2026

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+6B(0.00%) 🔺+3B(0.00%)

Details of bundle changes

Performance

Total duration: 1,130.70 ms 🔺+201.38 ms(+21.7%) | Renders: 92 (+0) | Paint: 1,877.72 ms 🔺+332.80 ms(+21.5%)

Test Duration Renders
Tabs mount (200 instances) 225.86 ms 🔺+40.15 ms(+21.6%) 3 (+0)
Select mount (200 instances) 144.96 ms 🔺+35.55 ms(+32.5%) 3 (+0)
Menu open (500 items) 90.33 ms 🔺+23.31 ms(+34.8%) 11 (+0)
Menu mount (300 instances) 109.15 ms 🔺+22.46 ms(+25.9%) 1 (+0)
Slider mount (300 instances) 120.77 ms 🔺+21.41 ms(+21.5%) 2 (+0)

…and 6 more (+4 within noise) — details

Metric alarms

Test Metric Change
Tabs mount (200 instances) bench:paint 🔺 +59.40 ms
Select mount (200 instances) bench:paint 🔺 +51.49 ms
Menu open (500 items) bench:paint 🔺 +44.26 ms
Menu open (500 items) bench:paint#menu-open 🔺 +44.26 ms
Menu mount (300 instances) bench:paint 🔺 +31.40 ms

…and 7 more metric alarms — details


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 016562b
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a843469bb35150008bfc2d8
😎 Deploy Preview https://deploy-preview-5523--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@aarongarciah
aarongarciah force-pushed the agent/fix-context-menu-api-metadata branch from 63850bc to b78a7cd Compare August 17, 2026 11:24
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Aug 17, 2026
@aarongarciah
aarongarciah force-pushed the agent/fix-context-menu-api-metadata branch from b78a7cd to 9655d1b Compare August 17, 2026 16:42
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Aug 17, 2026
@aarongarciah
aarongarciah force-pushed the agent/fix-context-menu-api-metadata branch from 8702a1f to 016562b Compare August 18, 2026 10:31
@aarongarciah
aarongarciah marked this pull request as ready for review August 18, 2026 10:35
popupOpen = CommonTriggerDataAttributes.popupOpen,
/**
* Present when the trigger is pressed.
* Present when the corresponding context menu is open.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Currently both popupOpen and pressed are true when the popup is open i.e. pressed is the same as popupOpen in the current implementation.

Instead of changing the wording, we might want to fix the behavior so pressed means pressed.

cc @jjenzz

Comment on lines +79 to +83
/**
* @ignore
* @deprecated This prop has no effect on Context Menu.
*/
closeParentOnEsc?: Menu.Root.Props['closeParentOnEsc'] | undefined;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This seems a legit approach but let me know if we should introduce the deprecation in another PR.

Comment on lines +42 to +46
/**
* @ignore
* @deprecated This prop has no effect on Context Menu.
*/
positionMethod?: MenuPositionerProps['positionMethod'] | undefined;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: context menu Changes related to the context menu component. docs Improvements or additions to the documentation. PR: out-of-date The pull request has merge conflicts and can't be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant