fix(seg): prevent viewport orientation change when loading SEG in manual grid layout - #6021
Merged
jbocce merged 7 commits intoMay 19, 2026
Merged
Conversation
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
|
@claude review |
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, comment @claude review on this pull request to trigger a review.
jbocce
requested changes
May 19, 2026
jbocce
left a comment
Collaborator
There was a problem hiding this comment.
See the one suggestion from AI and let me know how it goes. Thanks for this.
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
Fixes #6012
When a user switches from
3D four uplayout to a manual grid layout (e.g. 3×2) and then drags a SEG into an empty viewport, all viewports reset to axial orientation and the segmentation loads in the wrong viewport.Changes & Results
hydrationUtils.ts: skipmergeVolumeSharingViewportswhenisHangingProtocolLayout=false.SEGHydrationFrom3DFourUp.spec.ts: add playwright test covering SEG hydration after switching from3D four upto a manual 3x2 grid layout.MainToolbarPageObject.ts: addgrid(cols, rows)helper for selecting custom grid layouts by column and row countload-seg-3DfourUp-to-3By2.mov
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Greptile Summary
Prevents viewport orientation resets when a SEG is dragged into a viewport under a manually-selected grid layout. The root cause was
mergeVolumeSharingViewportspropagating updates to all volume-sharing viewports regardless of layout type; a single guard now skips that merge whenisHangingProtocolLayoutisfalse.hydrationUtils.ts: adds|| !isHangingProtocolLayoutto the early-return condition somergeVolumeSharingViewportsis only invoked for hanging-protocol-driven layouts, not manual grids.SEGHydrationFrom3DFourUp.spec.ts: new describe block verifies that hydrating a SEG into a specific viewport in a 3×2 grid leaves other viewports unchanged, then confirms no segmentation appears after switching back to 3D four-up.MainToolbarPageObject.ts: addsgrid(cols, rows)helper to select custom grid layouts by column/row count, consistent with the existing layout-selector pattern.Confidence Score: 5/5
Safe to merge; the core change is a one-line guard that only affects the manual-grid code path.
The fix is minimal and targeted: it skips
mergeVolumeSharingViewportsexclusively whenisHangingProtocolLayoutis false, leaving the hanging-protocol path unchanged. The accompanying test exercises the exact scenario described in the bug report.No files require special attention; test quality notes were already raised in prior review threads.
Important Files Changed
mergeVolumeSharingViewportswhenisHangingProtocolLayout=false; fix is focused and correct{ renderedTimeout: 180000 }forbackTo3DFourUpscreenshot (already discussed in review threads)grid(cols, rows)helper method consistent with the existing layout-selector pattern; test-ID convention (Layout-${cols-1}-${rows-1}) matches usage in other spec filessegHydrationAfterLayoutSwitchTo3By2entry; filenames are unique within the spec's screenshot directoryReviews (5): Last reviewed commit: "add small change to the test" | Re-trigger Greptile