Skip to content

Add an opt-in scroll-to-zoom setting for SVG viewers - #16

Open
rafaelha wants to merge 1 commit into
mainfrom
codex/svg-zoom-mode
Open

rafaelha wants to merge 1 commit into
mainfrom
codex/svg-zoom-mode

Conversation

@rafaelha

@rafaelha rafaelha commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add the VS Code setting stim.svgZoomMode, available in user, workspace, and folder settings.
  • Keep ctrlScroll as the default: Ctrl/Cmd+wheel zooms; plain scrolling pans or steps through single-layer slices.
  • Offer scroll as an opt-in mode: plain scrolling zooms, and the existing left-button drag gesture pans. Slice layers remain accessible through the toolbar and keyboard.
  • Apply configuration changes immediately to existing viewers without re-rendering the diagram or resetting zoom/pan.
  • Include circuit and DEM SVG viewers; leave interactive 3D viewers unchanged.
  • Document both modes and add seven viewer/settings regression tests to CI, without new dependencies.

Configuration

"stim.svgZoomMode": "scroll"

Set it back to ctrlScroll for the existing behavior.

Verification

  • npx tsc --noEmit -p tsconfig.json
  • npm run build
  • npm run test:viewer (7 tests)
  • npm run test:engine (28 tests)
  • npm run test:grammar
  • npm run test:wasm
  • Local VSIX packaging with vsce
  • Real-browser Playwright smoke checks at 1000x760 and 390x650: native scroll/pan, Ctrl+wheel zoom, live mode changes preserving the viewport, unmodified wheel zoom, and mouse-drag panning. Inspected screenshots of the actual WASM-rendered circuit.
  • git diff --check

No version bump, release, or marketplace publication. No VSIX files are committed.

@rafaelha
rafaelha force-pushed the codex/svg-zoom-mode branch from a1ca035 to b1741bb Compare October 7, 2026 18:54

This branch has not been deployed

No deployments
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