-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
component(ContextMenu): Add DialogContextMenu with Floating UI submenu support #5625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ohif-dev canceled.
|
|
|
||
| export default { | ||
| 'ui.contextMenu': ContextMenu, | ||
| 'ui.contextMenu': DialogContextMenu, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please reach out to Bill about adding a customization to retain the old context menu for the next version? We could call this ui-next.contextMenu to keep it separate, and then remove ui.contextMenu later on.
| defaultPointsPosition | ||
| ); | ||
| }, | ||
| // NOTE: onShowSubMenu removed - DialogContextMenu handles submenus inline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should check which customization is used, either if old one (ui.context-menu) keep this if the new one (default for us) not use this piece of code
sedghi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see my comments
Context
Introduces
DialogContextMenu, a new context menu component inui-nextthat replaces the legacyContextMenufromplatform/ui. This component is designed to work with OHIF'sUIDialogServiceand provides modern submenu support using Floating UI.Changes & Results
ui-nextstyling (consistent with Radix UI components)Differences from legacy ui
The legacy
ContextMenucomponent had limitations:ui-nextcomponentsScreen.Recording.2025-12-10.at.10.08.38.AM.mp4
How it works with OHIF
Floating UI integration
Submenus use Floating UI for intelligent positioning:
offset(4)- Adds 4px gap between parent menu and submenuflip()- Flips submenu to opposite side if no room (right → left)shift()- Shifts submenu along axis to stay in viewportThis ensures submenus are always visible regardless of where the user clicks.
Key changes
DialogContextMenu.tsxContextMenuController.tsxonShowSubMenucallback (no longer needed)contextMenuUICustomization.tsDialogContextMenuas'ui.contextMenu'Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment