From f5b246a43e4a046c70a4e4e8841fec63f83a94c0 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 7 Jun 2026 21:08:07 -0500 Subject: [PATCH] fix(desktop): don't reveal sidebar during window resize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resizing the window parks the cursor on the screen edge and fires slow pointermoves over the hot-zone, reading as deliberate intent. Guard the reveal on (a) e.buttons !== 0 — any button-held drag, incl. edge-resize — and (b) a 250ms cooldown after any window resize event. --- .../src/components/pane-shell/pane-shell.tsx | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/components/pane-shell/pane-shell.tsx b/apps/desktop/src/components/pane-shell/pane-shell.tsx index 4b46797c6fb..3db94eddb0a 100644 --- a/apps/desktop/src/components/pane-shell/pane-shell.tsx +++ b/apps/desktop/src/components/pane-shell/pane-shell.tsx @@ -220,16 +220,36 @@ export function Pane({ const registered = useRef(false) const paneRef = useRef(null) const lastSample = useRef<{ t: number; x: number; y: number } | null>(null) + const resizingUntil = useRef(0) const [hoverRevealed, setHoverRevealed] = useState(false) + // A window resize parks the cursor on the screen edge and fires slow + // pointermoves over the hot-zone — which reads as deliberate intent. Suppress + // the reveal during, and briefly after, any window resize. + useEffect(() => { + if (typeof window === 'undefined') { + return + } + + const onResize = () => { + resizingUntil.current = performance.now() + 250 + setHoverRevealed(false) + } + + window.addEventListener('resize', onResize) + + return () => window.removeEventListener('resize', onResize) + }, []) + // Arm the reveal only on a slow, deliberate pass through the edge zone — - // ignore fast fly-bys (toward the titlebar/statusbar, or leaving the window). + // ignore fast fly-bys (toward the titlebar/statusbar, or leaving the window), + // button-held drags, and the slow drift of a window resize. const onEdgeMove = useCallback((e: ReactPointerEvent) => { const prev = lastSample.current const now = e.timeStamp lastSample.current = { t: now, x: e.clientX, y: e.clientY } - if (!prev) { + if (!prev || e.buttons !== 0 || performance.now() < resizingUntil.current) { return }