fix(ui): clean up remaining legacy ui usage - #6140
Merged
Merged
Conversation
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
dan-rukas
temporarily deployed
to
fork-pr-approval
July 13, 2026 15:43 — with
GitHub Actions
Inactive
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughUpdates ChangesToolbar updates
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sedghi
approved these changes
Jul 13, 2026
dchansen06
pushed a commit
to iCRcompany/OHIFViewer
that referenced
this pull request
Jul 27, 2026
* Update button on DataSourceSelector * Removed dead code ToolbarButtonNestedMenu, button spacing
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
These are the last two small legacy
@ohif/uicomponent usages in the Viewer, cleaned up as part of the ongoing ui-next migration (Also seeContextMenuViewportPR here: #6008)DataSourceSelectorstill importedButton+ButtonEnumsfrom@ohif/ui.ToolbarButtonNestedMenu(aToolbarButton-based "More" nested-menu wrapper) wasflagged by the migration audit as "used once, port to ui-next" — but investigation shows
it has been dead code since 2020: commit
cae54b0779(Fix/update branch cherry pick #2039, 2020-09-14) removed itsonly usage from
ViewerLayout/index.jsxwhen the toolbar moved to theToolbarServicebutton-section architecture. Nothing has imported it since; it was only carried forward
by mechanical refactors (
@ohif/uiimport swap in feat: cornerstone3D stack and volume viewports #2787,.jsx→.tsxin feat(ui): move to React 18 and base for using shadcn/ui #4174).It also imports
ToolbarButtonfrom@ohif/ui, an export the package no longer provides(it still exports
Button/ButtonEnums, just notToolbarButton). Because nothing importsthe file, this has no runtime effect today — the module is never evaluated. It only means
ToolbarButtonwould resolve toundefined, so the component couldn't render if somethingdid use it. This just reinforces that removing the file is safe.
Changes & Results
DataSourceSelector.tsx— migrate the datasource button from the legacy@ohif/uiButtonto the@ohif/ui-nextButton:import { Button, ButtonEnums } from '@ohif/ui'→import { Button } from '@ohif/ui-next'ButtonAPI (ButtonEnumsis no longer needed).onClick,className, and children are unchanged.extensions/default/src/ViewerLayout/ToolbarButtonNestedMenu.tsx— dead code(see Context). Its role (a nested "More" toolbar menu) is now served by the
ToolbarServicebutton sections + ui-nextToolButton/ToolButtonListDropDown,wired via
getToolbarModule.tsx→Toolbar/ToolButtonListWrapper.tsx.Effects
@ohif/uiimporters from thedefaultextension.Before vs After
/datasources):Testing
/datasourcesselector is an opt-in example route (notenabled by default). To exercise it locally: add
'@ohif/extension-default.customizationModule.datasources'to your app config'scustomizationServicearray, runpnpm run dev, openhttp://localhost:3000/datasources,and confirm each datasource renders a button that navigates to
/?datasources=<name>onclick. (This config change is local-only — do not commit it.)
including any nested/"More" menus, behaves exactly as before. No source references the
removed file (verified via path-import search, exported-name search, barrel check, and
full-history pickaxe).
Checklist
PR
format and guidelines.
Code
Public Documentation Updates
removals.
Tested Environment
Summary by CodeRabbit
Style
Refactor