-
Notifications
You must be signed in to change notification settings - Fork 91
feat(config): add support for multiple named layouts #812
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
Merged
Conversation
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
✅ Deploy Preview for volview-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
78ef6b8 to
f1633ba
Compare
cfe571c to
53e7c4b
Compare
53e7c4b to
6b77368
Compare
Contributor
|
@andinet FYI, layout selection now supports both old and new modes:
|
zachmullen
reviewed
Nov 7, 2025
zachmullen
approved these changes
Nov 7, 2025
2583aaf to
a8b0059
Compare
Replace single layout config field with layouts object that supports multiple named layouts. Users can now define several layouts in their config and switch between them via the UI while preserving view data. - Add layouts object to config schema (key-value pairs) - Add namedLayouts state and methods to view store - Create LayoutSelector component with named layouts list and grid editor - Update ControlsStrip to use LayoutSelector - Update e2e tests to use new layouts format - Add test for multiple named layouts functionality
Centralized layout parsing and simplified layout definitions by 80%.
Created src/utils/layoutParsing.ts with:
- LayoutConfig type for declarative layout definitions
- parseLayoutConfig() function for converting simple formats to internal Layout type
- Support for grid arrays, nested layouts, and gridSize formats
Updated DefaultNamedLayouts in config.ts:
- Changed from verbose slot-based format to concise LayoutConfig format
- Grid format: [['axial', 'coronal'], ['sagittal', 'volume']]
- Nested format: { direction: 'row', items: ['axial', {...}] }
- Reduced from ~110 lines to ~30 lines
Updated views store:
- Added setNamedLayoutsFromConfig() method
- Removed redundant setNamedLayouts() method
- Parse DefaultNamedLayouts on initialization
Updated configJson.ts:
- Removed ~150 lines of duplicate parsing code
- Simplified applyLayout() to delegate to views store
- Kept Zod schemas for validation only
Document the new 'layouts' key feature that allows defining multiple named layouts users can switch between. Update examples to show both single layout and multiple named layouts approaches.
- Initialize currentLayoutName with first layout name so it shows as selected on startup - Remove formatLayoutName function and use layout keys directly as display names - Update default layout names to use proper capitalization (e.g., "3D Only", "Four Up") - Update tests to match new naming convention
When changing the layout configuration, ensure that existing views retain their state (e.g., slice, zoom level) where possible.
9e1718c to
3c483a1
Compare
- Create configTestUtils.ts with shared dataset constants and config utilities - Add ONE_CT_SLICE_DICOM, MINIMAL_DICOM, ANOTHER_DICOM, PROSTATEX_DATASET, MRA_HEAD_NECK_DATASET - Add createConfigManifest() and openConfigAndWait() helper functions with simplified API - Update 5 test files to use shared constants, eliminating URL duplication - Remove redundant expectViewCounts() helper (waitForViewCounts already validates) - Remove unused page object methods: advanceSlice, layoutGrid, twoViews, create3DViewMessage
3c483a1 to
bd872ab
Compare
Collaborator
|
Great. thank you! |
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.

Replace single layout config field with layouts object that supports multiple named layouts. Users can now define several layouts in their config and switch between them via the UI while preserving view data.