From 4631b5ccaa077fc282bc93e53bfee7bb5c2b37c7 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 31 Oct 2025 02:17:03 +0100 Subject: [PATCH] chore: Remove ability to collapse sidebar on shared links (#10531) * fix: Remove ability to collapse sidebar on shared links * fix: Existing collapsed sidebars should be forced open --- app/components/Sidebar/Shared.tsx | 6 ++---- app/components/Sidebar/Sidebar.tsx | 18 +++++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/components/Sidebar/Shared.tsx b/app/components/Sidebar/Shared.tsx index 202b9a6fd9..59ad8c09cb 100644 --- a/app/components/Sidebar/Shared.tsx +++ b/app/components/Sidebar/Shared.tsx @@ -47,7 +47,7 @@ function SharedSidebar({ share }: Props) { } return ( - + {teamAvailable && ( history.push(user ? homePath() : sharedModelPath(shareId)) } - > - - + /> )} diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index e0c68da124..11b6f70489 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -25,13 +25,15 @@ import { useTranslation } from "react-i18next"; const ANIMATION_MS = 250; type Props = { - children: React.ReactNode; hidden?: boolean; + /** Whether the sidebar can be resized and collapsed, defaults to true. */ + canResize?: boolean; className?: string; + children: React.ReactNode; }; const Sidebar = React.forwardRef(function _Sidebar( - { children, hidden = false, className }: Props, + { children, hidden = false, canResize = true, className }: Props, ref: React.RefObject ) { const [isCollapsing, setCollapsing] = React.useState(false); @@ -43,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; + const collapsed = ui.sidebarIsClosed && canResize; const maxWidth = theme.sidebarMaxWidth; const minWidth = theme.sidebarMinWidth + 16; // padding @@ -254,10 +256,12 @@ const Sidebar = React.forwardRef(function _Sidebar( )} - + {canResize && ( + + )} {ui.mobileSidebarVisible && }