Skip to content

Conversation

@PaulHax
Copy link
Collaborator

@PaulHax PaulHax commented Nov 6, 2025

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

@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit bd872ab
🔍 Latest deploy log https://app.netlify.com/projects/volview-dev/deploys/690e03eafc3e800008c21c2a
😎 Deploy Preview https://deploy-preview-812--volview-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@PaulHax PaulHax force-pushed the layout-configs branch 4 times, most recently from 78ef6b8 to f1633ba Compare November 6, 2025 20:16
@PaulHax PaulHax marked this pull request as ready for review November 6, 2025 20:28
@PaulHax PaulHax linked an issue Nov 6, 2025 that may be closed by this pull request
@PaulHax PaulHax requested a review from zachmullen November 6, 2025 21:34
@zachmullen
Copy link
Contributor

@andinet FYI, layout selection now supports both old and new modes:

Screenshot 2025-11-07 at 7 43 47 AM

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.
@PaulHax PaulHax force-pushed the layout-configs branch 3 times, most recently from 9e1718c to 3c483a1 Compare November 7, 2025 14:34
- 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
@PaulHax PaulHax added this pull request to the merge queue Nov 7, 2025
Merged via the queue into main with commit a98b1c5 Nov 7, 2025
7 checks passed
@andinet
Copy link
Collaborator

andinet commented Nov 8, 2025

Great. thank you!

@zachmullen zachmullen deleted the layout-configs branch November 11, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better layout picking GUI

3 participants