Repository navigation
[menu] Implement content transitions with Viewport - #4060
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
86c63af to
01d1f17
Compare
Greptile OverviewGreptile SummaryAdds Key changes:
Minor issue:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 57140e8 |
There was a problem hiding this comment.
Pull request overview
This pull request implements the Menu.Viewport component to enable animated content transitions when using detached triggers with the Menu component. This mirrors the existing Viewport implementations in Popover, PreviewCard, and Tooltip components, providing a consistent API across the library.
Changes:
- Added
Menu.Viewportcomponent for content transition animations with detached triggers - Enhanced
usePopupViewporthook withReactDOM.flushSyncfor more reliable animation timing - Added
trigger-changeinstant type to Menu store for transition behavior control - Integrated
adaptiveOriginmiddleware conditionally based on viewport presence
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/react/src/utils/usePopupViewport.tsx |
Improved animation timing with ReactDOM.flushSync and defensive null handling for CSS variables |
packages/react/src/menu/viewport/MenuViewport.tsx |
New viewport component implementation following established patterns |
packages/react/src/menu/viewport/MenuViewportDataAttributes.ts |
Data attribute enum definitions for viewport states |
packages/react/src/menu/viewport/MenuViewportCssVars.ts |
CSS variable enum definitions for popup dimensions |
packages/react/src/menu/viewport/MenuViewport.test.tsx |
Comprehensive test suite covering transitions and direction calculations |
packages/react/src/menu/store/MenuStore.ts |
Added hasViewport state and trigger-change instant type |
packages/react/src/menu/root/MenuRoot.detached-triggers.test.tsx |
Added regression test for inline scale styles |
packages/react/src/menu/positioner/MenuPositioner.tsx |
Integrated adaptiveOrigin middleware and trigger change detection |
packages/react/src/menu/popup/MenuPopup.tsx |
Added popup element tracking callback and updated instant type |
packages/react/src/menu/index.ts |
Added Viewport type exports |
packages/react/src/menu/index.parts.ts |
Added Viewport component export |
docs/src/app/(private)/experiments/menu/triggers.tsx |
Added Viewport to experimental demo |
docs/src/app/(docs)/react/components/page.mdx |
Updated component structure documentation |
docs/src/app/(docs)/react/components/menu/page.mdx |
Added comprehensive documentation for animating menus |
docs/src/app/(docs)/react/components/menu/demos/detached-triggers-full/* |
New demo implementations in Tailwind and CSS modules |
docs/reference/generated/menu-viewport.json |
Generated API reference documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57140e8998
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2ad9cec to
27e5772
Compare
|
Automatic reviews are disabled for this repository. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codex ReviewOverviewThis PR adds Findings (None)No blocking issues found in this patch. Confidence: 4/5High confidence based on a full pass over the current branch diff, a focused sweep of the new viewport/control-flow paths, targeted JSDOM and Chromium verification of the changed Menu tests, and a small Chromium DOM benchmark for the new transition work. Residual risk is limited to highly app-specific styling or accessibility edge cases around cloned transition content. Notes
On this synthetic switch path, the current implementation adds about
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
This might be slightly problematic if the contents are styled based on their IDs, so there is a tradeoff. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This reverts commit 11c6662.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Added the Viewport part to the Menu, allowing for animated content transitions when using detached triggers.
https://deploy-preview-4060--base-ui.netlify.app/react/components/menu#animating-the-menu
https://deploy-preview-4060--base-ui.netlify.app/experiments/menu/triggers