feat(core): add WSI right-drag zoom - #2870
Conversation
|
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 (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe render path now configures right-button drag zoom for WSI maps. It validates the required viewer and map APIs, clamps drag coordinates to the image extent, restores original events, and adds focused Jest coverage. ChangesWSI drag zoom
Merge Risk: ⚪ Minimal · up to This change adds right-drag zoom for WSI viewports with extent clamping and regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant DicomMicroscopyRenderPath
participant WSIViewer
participant WSIMap
participant DragZoomInteraction
DicomMicroscopyRenderPath->>WSIViewer: Activate right-button drag zoom
DicomMicroscopyRenderPath->>WSIMap: Get interactions
DicomMicroscopyRenderPath->>DragZoomInteraction: Wrap down, drag, and up handlers
DragZoomInteraction->>WSIMap: Convert clamped coordinates to pixels
DragZoomInteraction-->>DicomMicroscopyRenderPath: Restore original event values
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
bb534c1 to
2cfd528
Compare
Context
Whole-slide microscopy viewports do not currently expose the existing DICOM Microscopy Viewer drag-zoom interaction. Applications that need region zoom therefore have to patch the built Cornerstone package.
This change enables region zoom in the source WSI render path while keeping the selection inside the slide extent.
Changes & Results
Before: right-dragging did not zoom a selected WSI region.
After: right-dragging shows the existing OpenLayers selection box and fits the selected in-slide region.
No dependency or user-facing configuration changes are included.
Testing
Automated checks:
pnpm exec jest --selectProjects core packages/core/test/dicomMicroscopyRenderPath.jest.js --runInBand- 34 suites passed, 552 tests passed, 2 skipped.pnpm run build- passed for the workspace.pnpm run test:ci- passed in Chrome Headless.Manual verification steps:
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals. No public documentation change is needed because this
configures existing viewer behavior and adds no user-facing API.
Tested Environment
Summary by CodeRabbit
New Features
Bug Fixes
Tests