From 038f57383a91f3fa163037a7bb78aef8b61e77ec Mon Sep 17 00:00:00 2001 From: ciregenz Date: Tue, 21 Jul 2026 18:53:43 -0700 Subject: [PATCH] [eric] canvas: full size view swallows stray wheel (no more zoom glitch while scrolling the chat) --- .../Dashboard/hooks/interaction/useCanvasControls.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/app/pages/Dashboard/hooks/interaction/useCanvasControls.ts b/frontend/src/app/pages/Dashboard/hooks/interaction/useCanvasControls.ts index 7218544c..47861b8c 100644 --- a/frontend/src/app/pages/Dashboard/hooks/interaction/useCanvasControls.ts +++ b/frontend/src/app/pages/Dashboard/hooks/interaction/useCanvasControls.ts @@ -1,4 +1,5 @@ import { useState, useCallback, useRef, useEffect, useMemo, RefObject } from 'react'; +import { store } from '@/shared/state/store'; import { setCanvasInteractionActive } from '@/shared/canvasInteractionState'; import { getLastInteractedBrowser } from '@/shared/browserFocus'; import { getScrollFocusedCard } from '@/shared/cardScrollFocus'; @@ -297,6 +298,13 @@ export function useCanvasControls(zoomSensitivity: number = 50, contentBounds?: const scrollableCache: WeakMap = new WeakMap(); const onWheel = (e: WheelEvent) => { + // Full size view owns the whole surface: any wheel that escapes the chat's scroll container + // (side gutters, header) must NOT zoom/pan the hidden canvas underneath, that read as a + // glitchy zoom while scrolling the chat. Fullscreen has no canvas nav, period. + const tiledCards = store.getState().dashboardLayout.tiledCards; + for (const z of Object.values(tiledCards)) { + if (z === 'fullscreen') return; + } // ctrl/cmd wheel is a modifier gesture: a real held key (cmd/ctrl + scroll → vertical pan) or a trackpad pinch, which also sets ctrlKey (→ zoom at cursor). Either way it bypasses scrollable children and acts on the canvas. const isModifierWheel = e.ctrlKey || e.metaKey;