Skip to content

feat(core): improve WSI overview map interactions - #2871

Closed
benjaminforras wants to merge 1 commit into
cornerstonejs:mainfrom
benjaminforras:agent/wsi-overview-map-interactions
Closed

feat(core): improve WSI overview map interactions#2871
benjaminforras wants to merge 1 commit into
cornerstonejs:mainfrom
benjaminforras:agent/wsi-overview-map-interactions

Conversation

@benjaminforras

Copy link
Copy Markdown

Context

Whole-slide microscopy viewports already render an overview map, but its controls can pass pointer and wheel events to viewport tools. The magnification box also cannot pan the main slide. Replacing WSI data in the legacy viewport loses the collapsed state and can leave document drag listeners attached.

This keeps the overview-map change separate from #2870, which covers right-drag region zoom.

Changes & Results

  • Configure overview-map interactions for both legacy and GenericViewport WSI paths.
  • Stop overview control pointer, double-click, and wheel events from reaching viewport tools.
  • Pan the main WSI map while the overview magnification box is dragged.
  • Remove document drag listeners when the drag ends or the viewport data is replaced or disabled.
  • Preserve the overview map's collapsed state when the legacy WSIViewport replaces its data.

Before, overview interactions could activate viewport tools, dragging the magnification box did not pan the slide, and WSI replacement could leave stale listeners.

After, overview interactions remain within the control, drag-to-pan works, and the interaction state follows the WSI lifecycle.

Testing

Automated checks:

  • corepack pnpm exec jest --selectProjects core packages/core/test/wsiOverviewMapInteractions.jest.js --runInBand: 34 suites passed, 552 tests passed, 2 skipped.
  • pnpm run build: passed for the workspace.
  • pnpm run lint: passed with no warnings or errors.
  • pnpm run test:ci: passed in Chrome Headless.
  • Husky pre-commit lint and format checks passed.

Manual verification steps:

  1. Load a whole-slide image in a legacy or GenericViewport WSI viewport.
  2. Use the overview control and confirm its pointer, double-click, and wheel events do not activate viewport tools.
  3. Drag the overview magnification box and confirm the main slide pans to the selected position.
  4. In the legacy viewport, collapse the overview map, replace the WSI data, and confirm it remains collapsed.

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals. No documentation change is needed because this changes existing overview-map behavior without adding a user-facing option.

Tested Environment

  • "OS: Windows 11 Enterprise"
  • "Node version: 24.15.0"
  • "Browser: Chrome Headless 101.0.4950.0"

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 97f8baf0-60bd-41b8-b163-85baf402fef5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@benjaminforras
benjaminforras deleted the agent/wsi-overview-map-interactions branch August 18, 2026 22:35
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.

1 participant