From c034255c96f463f07e563ebccda59716ad2d786f Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 19 Nov 2025 22:06:00 +0100 Subject: [PATCH] fix: Restore ability to resize shared sidebar (#10669) --- app/components/Sidebar/Shared.tsx | 2 +- app/components/Sidebar/Sidebar.tsx | 34 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/components/Sidebar/Shared.tsx b/app/components/Sidebar/Shared.tsx index c2e50111f4..154a64cca6 100644 --- a/app/components/Sidebar/Shared.tsx +++ b/app/components/Sidebar/Shared.tsx @@ -52,7 +52,7 @@ function SharedSidebar({ share }: Props) { } return ( - + {teamAvailable && ( (function _Sidebar( - { children, hidden = false, canResize = true, className }: Props, + { children, hidden = false, canCollapse = true, className }: Props, ref: React.RefObject ) { const [isCollapsing, setCollapsing] = React.useState(false); @@ -45,7 +45,7 @@ const Sidebar = React.forwardRef(function _Sidebar( const user = useCurrentUser({ rejectOnEmpty: false }); const isMobile = useMobile(); const width = ui.sidebarWidth; - const collapsed = ui.sidebarIsClosed && canResize; + const collapsed = ui.sidebarIsClosed && canCollapse; const maxWidth = theme.sidebarMaxWidth; const minWidth = theme.sidebarMinWidth + 16; // padding @@ -66,11 +66,15 @@ const Sidebar = React.forwardRef(function _Sidebar( const newWidth = Math.min(event.pageX - offset, maxWidth); const isSmallerThanCollapsePoint = newWidth < minWidth / 2; - ui.set({ - sidebarWidth: isSmallerThanCollapsePoint - ? theme.sidebarCollapsedWidth - : newWidth, - }); + if (canCollapse) { + ui.set({ + sidebarWidth: isSmallerThanCollapsePoint + ? theme.sidebarCollapsedWidth + : newWidth, + }); + } else { + ui.set({ sidebarWidth: Math.max(newWidth, minWidth) }); + } }, [ui, theme, offset, minWidth, maxWidth] ); @@ -85,7 +89,7 @@ const Sidebar = React.forwardRef(function _Sidebar( if (isSmallerThanMinimum) { const isSmallerThanCollapsePoint = width < minWidth / 2; - if (isSmallerThanCollapsePoint) { + if (isSmallerThanCollapsePoint && canCollapse) { setAnimating(false); setCollapsing(true); ui.collapseSidebar(); @@ -256,12 +260,10 @@ const Sidebar = React.forwardRef(function _Sidebar( )} - {canResize && ( - - )} + {ui.mobileSidebarVisible && }