fix(segmentation): apply modeConfiguration overrides#6051
Open
igoroctaviano wants to merge 1 commit into
Open
Conversation
The segmentation mode's modeFactory accepted a modeConfiguration argument but never applied it to the returned mode instance, so modesConfiguration overrides from the app config (e.g. hide, displayName) were silently ignored for this mode. Spread modeConfiguration into the returned object to match the other modes. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe ChangesMode Configuration Propagation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Summary
The
segmentationmode'smodeFactoryaccepts amodeConfigurationargument but never applies it to the returned mode instance. As a result, anymodesConfiguration['@ohif/mode-segmentation']overrides from the app config (such ashide,displayName,routeName, etc.) are silently ignored for this mode.Other modes (e.g.
usAnnotation,tmtv,microscopy,preclinical-4d) already spread...modeConfigurationinto their returned object. This change brings the segmentation mode in line with them.Before this fix, e.g. the following config had no effect on the segmentation mode:
Changes
...modeConfigurationinto the object returned by the segmentationmodeFactory.Test plan
modesConfiguration: { '@ohif/mode-segmentation': { hide: true } }to the app config and confirm the Segmentation mode no longer appears in the mode selector.displayNamefor@ohif/mode-segmentationis reflected in the mode selector.Made with Cursor
Summary by CodeRabbit
Greptile Summary
This one-line fix ensures that
modeConfigurationoverrides passed viaappConfig.modesConfiguration['@ohif/mode-segmentation']are actually applied to the segmentation mode instance. Previously themodeFactoryaccepted the argument but never used it, silently discarding any app-level overrides such ashide,displayName, orrouteName....modeConfigurationat the end of the object returned bymodeFactory, giving app-config overrides precedence over defaults — identical to the pattern already used in every other OHIF mode.Confidence Score: 5/5
Safe to merge — single-line additive change that aligns the segmentation mode with all other modes in the codebase.
The change is a one-line spread of a well-typed, null-safe argument that has already been defaulted to
{}before being passed in. It touches no logic, no service wiring, and no lifecycle functions. The same pattern is proven across every other mode in the repo.No files require special attention.
Important Files Changed
...modeConfigurationspread at the end of themodeFactoryreturn object, consistent with how all other modes (usAnnotation, tmtv, microscopy, preclinical-4d) already handle this argument.Reviews (1): Last reviewed commit: "fix(segmentation): apply modeConfigurati..." | Re-trigger Greptile