From 8d8c62ba344434271eba35521a40d49d9bce56b9 Mon Sep 17 00:00:00 2001 From: Shoaib Ansari Date: Sat, 2 May 2026 10:01:44 +0530 Subject: [PATCH] fix: allow sidebar to be shrunk when wider than viewport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the window is restored to a small size after expanding the sidebar while maximized, the sidebar width can exceed the viewport width. The shouldAcceptWidth guard wrapper.clientWidth - nextWidth >= 640 becomes negative and blocks ALL resize attempts — even shrinking — creating a permanent deadlock. Fix: always accept the resize when nextWidth <= currentWidth (user is making the sidebar smaller). The >= 640 constraint only applies when expanding. Closes #2339 --- apps/web/src/components/AppSidebarLayout.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsx index d98f30a1e5..a9030b0036 100644 --- a/apps/web/src/components/AppSidebarLayout.tsx +++ b/apps/web/src/components/AppSidebarLayout.tsx @@ -61,7 +61,8 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) { className="border-r border-border bg-card text-foreground" resizable={{ minWidth: THREAD_SIDEBAR_MIN_WIDTH, - shouldAcceptWidth: ({ nextWidth, wrapper }) => + shouldAcceptWidth: ({ currentWidth, nextWidth, wrapper }) => + nextWidth <= currentWidth || wrapper.clientWidth - nextWidth >= THREAD_MAIN_CONTENT_MIN_WIDTH, storageKey: THREAD_SIDEBAR_WIDTH_STORAGE_KEY, }}