From 51c4ec693b2f8ef75a70dc988fb1fcea60e4b42f Mon Sep 17 00:00:00 2001 From: kostazol Date: Tue, 12 May 2026 18:49:15 +0700 Subject: [PATCH] Fix (#1218) Co-authored-by: Konstantin Zolin --- .../ui/src/components/layout/MainLayout.tsx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/ui/src/components/layout/MainLayout.tsx b/packages/ui/src/components/layout/MainLayout.tsx index 5fdb96b9..893794a8 100644 --- a/packages/ui/src/components/layout/MainLayout.tsx +++ b/packages/ui/src/components/layout/MainLayout.tsx @@ -276,23 +276,23 @@ export const MainLayout: React.FC = () => { const width = window.innerWidth; const height = window.innerHeight; - const shouldCloseRightSidebar = width < RIGHT_SIDEBAR_AUTO_CLOSE_WIDTH; - const canAutoOpenRightSidebar = width >= RIGHT_SIDEBAR_AUTO_OPEN_WIDTH; - - if (shouldCloseRightSidebar) { - if (state.isRightSidebarOpen) { - setRightSidebarOpen(false); - rightSidebarAutoClosedRef.current = true; - } - } else if (canAutoOpenRightSidebar && rightSidebarAutoClosedRef.current) { - setRightSidebarOpen(true); - rightSidebarAutoClosedRef.current = false; - } - // Touch devices frequently resize when the on-screen keyboard opens. - // Treat bottom-terminal auto-collapse/restore as desktop-only so - // keyboard viewport changes do not churn terminal layout state. + // Treat panel auto-collapse/restore as desktop-only so keyboard + // viewport changes do not churn drawer or terminal layout state. if (!isMobile && !isTablet) { + const shouldCloseRightSidebar = width < RIGHT_SIDEBAR_AUTO_CLOSE_WIDTH; + const canAutoOpenRightSidebar = width >= RIGHT_SIDEBAR_AUTO_OPEN_WIDTH; + + if (shouldCloseRightSidebar) { + if (state.isRightSidebarOpen) { + setRightSidebarOpen(false); + rightSidebarAutoClosedRef.current = true; + } + } else if (canAutoOpenRightSidebar && rightSidebarAutoClosedRef.current) { + setRightSidebarOpen(true); + rightSidebarAutoClosedRef.current = false; + } + const shouldCloseBottomTerminal = height < BOTTOM_TERMINAL_AUTO_CLOSE_HEIGHT; const canAutoOpenBottomTerminal =