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.

Merge branch 'main' into feat/trackpad-gesture-routing

enes1152d6dfa093
diff --cc src/renderer/canvas/Canvas.tsx
index 1de80e90e,0781d5572..84e1df22e
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@@ -35,7 -35,7 +35,8 @@@ import
} from '../nodes/TerminalNode'
import { solveFitPadding } from './fit-view'
import { MacWheelGestureRouter, trackpadRoutingEnabled } from './wheel-gesture'
+import { isBrowserRuntime } from '@renderer/bridge/runtime'
+ import { WheelZoomBurstLimiter, clampWheelZoomSpeed, nextWheelZoom } from './wheel-zoom'
import { selectedLocalFilePaths } from './canvas-file-copy'
import {
canvasImagePasteArmedAfterKey,
@@@ -3118,18 -3119,12 +3120,20 @@@ export function Canvas()
useEffect(() => {
const wrap = flowWrapRef.current
if (!wrap) return
- const wheelRouting = new MacWheelGestureRouter()
+ // Desktop: the main process reports trackpad gestures from the raw input stream, so the
+ // router routes by device FACT instead of delta-shape guessing — a precise-pixel mouse
+ // (MX Master) zooms while the trackpad pans, both settings on. The browser (Server Edition)
+ // has no such stream: reporting stays off and the router keeps its heuristics.
+ const gestureReporting = isMac && !isBrowserRuntime()
+ const wheelRouting = new MacWheelGestureRouter(gestureReporting)
+ const offGesture = gestureReporting
+ ? window.nodeTerminal.onCanvasTrackpadGesture?.((active) => wheelRouting.noteGesture(active))
+ : undefined
+ const wheelLimiter = new WheelZoomBurstLimiter()
const onWheel = (e: WheelEvent) => {
if (canvasLocked) return
- if (!e.ctrlKey && !e.metaKey) {
+ const plainWheel = !e.ctrlKey && !e.metaKey
+ if (plainWheel) {
// The ancestor walk is the expensive part of this handler at ~120 Hz, so it is memoized
// per packet AND never run for a packet no guard asks about (a plain wheel with wheelZoom
// off, which is the default, walks nothing at all).
@@@ -3158,11 -3157,8 +3166,11 @@@
setViewport({ x: px - (px - x) * k, y: py - (py - y) * k, zoom: next })
}
wrap.addEventListener('wheel', onWheel, { capture: true, passive: false })
- return () => wrap.removeEventListener('wheel', onWheel, { capture: true })
+ return () => {
+ wrap.removeEventListener('wheel', onWheel, { capture: true })
+ offGesture?.()
+ }
- }, [getViewport, setViewport, wheelZoom, trackpadRouting, canvasLocked])
+ }, [getViewport, setViewport, wheelZoom, wheelZoomSpeed, trackpadRouting, canvasLocked])
// Double-clicking EMPTY canvas pulls back to the overview zoom — the inverse of the node
// double-click, which frames one node. A fixed zoom, not "the camera the last focus came from":
diff --cc src/shared/types.ts
index 8b7798de0,2dc42d17b..24e8c5f6f
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@@ -1256,12 -1256,14 +1256,17 @@@ export interface Settings
* scroll keeps panning independently (see canvas/wheel-gesture.ts), so mouse and trackpad
* coexist; elsewhere this still trades away scroll-to-pan, so it stays opt-in. */
wheelZoom: boolean
+ /** How far one plain wheel click zooms, as a multiplier on the canvas zoom step (0.2–2,
+ * default 1 = historical feel). Applies only to the `wheelZoom` path — Cmd/Ctrl+wheel and
+ * pinch keep the fixed step, so tuning a chunky mouse down never slows the trackpad.
+ * Validated at point of use (canvas/wheel-zoom.ts `clampWheelZoomSpeed`). */
+ wheelZoomSpeed: number
/** macOS only: a two-finger trackpad scroll pans the canvas, independently of `wheelZoom`
* (see canvas/wheel-gesture.ts). Off restores the pre-router behavior — `wheelZoom` alone
- * decides — which is also the recourse for a precise-pixel MOUSE that reads as a trackpad. */
+ * decides. On the desktop the device is identified from the main process's raw input stream
+ * (main/trackpad-gesture.ts), so mouse zoom and trackpad pan coexist; the off-switch is the
+ * remaining recourse for the Server Edition's browser tab, where detection is heuristic and a
+ * precise-pixel MOUSE still reads as a trackpad. */
trackpadPan: boolean
/** What a left-drag on EMPTY canvas does. 'select' (default) rubber-band selects, like
* Figma's move tool — pan stays on middle-drag / two-finger scroll. 'pan' drags the map