From 33d55121cd15a6787a85a0880741a0caf257af0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 7 Aug 2026 03:42:52 +0000 Subject: [PATCH] stop escape from un-maximizing a panel --- .../src/components/Workspace/WorkspaceView.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/workspaces/officerdev/src/components/Workspace/WorkspaceView.tsx b/src/workspaces/officerdev/src/components/Workspace/WorkspaceView.tsx index adf60298..ef56c3c6 100644 --- a/src/workspaces/officerdev/src/components/Workspace/WorkspaceView.tsx +++ b/src/workspaces/officerdev/src/components/Workspace/WorkspaceView.tsx @@ -118,18 +118,21 @@ export const WorkspaceView = ({ workspace, locked, cwd = '~', root, initialFileP [], ); + // Escape cancels a *pending* swap or drag — modes you are halfway through, where it is the only way + // out. Maximize is not one of those: it is a state you chose and that now outlives a refresh, so a key + // press meant for whatever you are typing in should not throw it away. Restore is the panel's own + // button. useEffect(() => { - if (!swapSourceId && !dragSourceId && !maximizedPanelId) return; + if (!swapSourceId && !dragSourceId) return; const onKeyDown = (ev: KeyboardEvent) => { if (ev.key === 'Escape') { setSwapSourceId(null); setDragSourceId(null); - setMaximizedAnimated(null); } }; window.addEventListener('keydown', onKeyDown); return () => window.removeEventListener('keydown', onKeyDown); - }, [swapSourceId, dragSourceId, maximizedPanelId, setMaximizedAnimated]); + }, [swapSourceId, dragSourceId]); const ephemeralPanelRef = useRef>(null); const isEphemeralOpen = !!ephemeral;