Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(canvas): opt-in plain-wheel zoom ("Scroll wheel zooms")

enesd1ca2b82cdce
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index 43dfe9c85..aa7a37911 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -932,11 +932,21 @@ export function Canvas() {
// scrollback). We intercept (preventDefault + stopPropagation) before xterm sees it, then
// zoom to the cursor. React Flow's own zoomOnPinch / zoomActivationKeyCode are disabled so
// this is the single source of zoom (no double-zoom on the open canvas).
+ //
+ // With settings.wheelZoom on, a PLAIN wheel zooms too (mouse-first workflow; scroll-to-pan
+ // is disabled on <ReactFlow> in that mode) — except inside a `nowheel` node body (focused
+ // xterm scrollback, Monaco, markdown/chat panes), which keeps its own scrolling. The hover
+ // guard overlay is NOT nowheel, so an unfocused terminal still zooms under the cursor.
+ const wheelZoom = settings.wheelZoom
useEffect(() => {
const wrap = flowWrapRef.current
if (!wrap) return
const onWheel = (e: WheelEvent) => {
- if (!e.ctrlKey && !e.metaKey) return // pinch (ctrl+wheel) or Cmd/Ctrl+scroll = zoom
+ if (!e.ctrlKey && !e.metaKey) {
+ // pinch (ctrl+wheel) / Cmd/Ctrl+scroll always zoom; plain wheel only when opted in
+ if (!wheelZoom) return
+ if ((e.target as HTMLElement | null)?.closest('.nowheel')) return
+ }
e.preventDefault()
e.stopPropagation()
const { x, y, zoom } = getViewport()
@@ -952,7 +962,7 @@ export function Canvas() {
}
wrap.addEventListener('wheel', onWheel, { capture: true, passive: false })
return () => wrap.removeEventListener('wheel', onWheel, { capture: true })
- }, [getViewport, setViewport])
+ }, [getViewport, setViewport, wheelZoom])
/** Flow-space point at the center of the visible canvas (for dock-added nodes). */
const viewCenter = useCallback(() => {
@@ -3056,7 +3066,7 @@ export function Canvas() {
selectionOnDrag
selectionMode={SelectionMode.Partial}
panOnDrag={[1]}
- panOnScroll
+ panOnScroll={!wheelZoom}
zoomOnScroll={false}
zoomOnPinch={false}
zoomActivationKeyCode={null}
diff --git a/src/renderer/components/settings/sections/BehaviorSection.tsx b/src/renderer/components/settings/sections/BehaviorSection.tsx
index 891769dbe..ad6a8d6e6 100644
--- a/src/renderer/components/settings/sections/BehaviorSection.tsx
+++ b/src/renderer/components/settings/sections/BehaviorSection.tsx
@@ -9,7 +9,8 @@ const ROWS = {
gridSize: { title: 'Grid size', keywords: ['grid', 'size', 'snap'] },
snap: { title: 'Snap to grid', keywords: ['snap', 'grid', 'align'] },
panHover: { title: 'Pan-hover delay (ms)', keywords: ['pan', 'hover', 'delay', 'focus', 'guard'] },
- doubleClick: { title: 'Double-click to focus', keywords: ['double', 'click', 'focus'] }
+ doubleClick: { title: 'Double-click to focus', keywords: ['double', 'click', 'focus'] },
+ wheelZoom: { title: 'Scroll wheel zooms', keywords: ['zoom', 'wheel', 'scroll', 'mouse', 'pan'] }
}
const ENTRIES = Object.values(ROWS)
@@ -69,6 +70,19 @@ export function BehaviorSection({ isActive }: { isActive: boolean }): React.JSX.
}
/>
</SearchableRow>
+ <SearchableRow {...ROWS.wheelZoom}>
+ <FieldRow
+ label="Scroll wheel zooms"
+ description="Zoom with a plain mouse wheel (no ⌘). Turns off scroll-to-pan — pan by dragging."
+ control={
+ <Switch
+ checked={settings.wheelZoom}
+ onChange={(v) => update({ wheelZoom: v })}
+ ariaLabel="Scroll wheel zooms"
+ />
+ }
+ />
+ </SearchableRow>
</SettingsSection>
)
}
diff --git a/src/shared/types.ts b/src/shared/types.ts
index afaed882f..d657a0d6e 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -283,6 +283,9 @@ export interface Settings {
/** ms to dwell over a terminal before it takes pointer focus (pan-across guard). */
panHoverDelay: number
doubleClickFocus: boolean
+ /** Plain mouse wheel zooms the canvas (no Cmd/Ctrl needed). Trades away scroll-to-pan,
+ * so it's opt-in — best for mouse users; trackpads keep two-finger pan when off. */
+ wheelZoom: boolean
accent: string
tmuxEnabled: boolean
tmuxScrollback: number
@@ -321,6 +324,7 @@ export const DEFAULT_SETTINGS: Settings = {
snapToGrid: false,
panHoverDelay: 600,
doubleClickFocus: true,
+ wheelZoom: false,
accent: '#0a84ff',
tmuxEnabled: true,
tmuxScrollback: 50000,