component(ContextMenu): Add DialogContextMenu with Floating UI submenu support#5625
Closed
dan-rukas wants to merge 10 commits into
Closed
component(ContextMenu): Add DialogContextMenu with Floating UI submenu support#5625dan-rukas wants to merge 10 commits into
dan-rukas wants to merge 10 commits into
Conversation
✅ Deploy Preview for ohif-dev canceled.
|
sedghi
reviewed
Dec 10, 2025
|
|
||
| export default { | ||
| 'ui.contextMenu': ContextMenu, | ||
| 'ui.contextMenu': DialogContextMenu, |
Member
There was a problem hiding this comment.
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.
sedghi
reviewed
Dec 10, 2025
| defaultPointsPosition | ||
| ); | ||
| }, | ||
| // NOTE: onShowSubMenu removed - DialogContextMenu handles submenus inline |
Member
There was a problem hiding this comment.
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
Member
Author
|
Migrating legacy component before creating a new implementation: #6008 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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