From 7470670adfc06ae03181b8e964d65ee35f096a95 Mon Sep 17 00:00:00 2001 From: Val Alexander Date: Fri, 27 Mar 2026 20:35:07 -0500 Subject: [PATCH] Add collapse toggle for project file tree - Make the Files section in the sidebar collapsible - Preserve the existing workspace file tree under the toggle --- apps/web/src/components/Sidebar.tsx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index a396269eb..732e4288c 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -47,7 +47,7 @@ import { } from "../appSettings"; import { isElectron } from "../env"; import { APP_STAGE_LABEL, APP_VERSION } from "../branding"; -import { isLinuxPlatform, isMacPlatform, newCommandId, newProjectId } from "../lib/utils"; +import { cn, isLinuxPlatform, isMacPlatform, newCommandId, newProjectId } from "../lib/utils"; import { useStore } from "../store"; import { shortcutLabelForCommand } from "../keybindings"; import { derivePendingApprovals, derivePendingUserInputs } from "../session-logic"; @@ -402,6 +402,7 @@ export default function Sidebar() { const [expandedThreadListsByProject, setExpandedThreadListsByProject] = useState< ReadonlySet >(() => new Set()); + const [filesExpanded, setFilesExpanded] = useState(true); const renamingCommittedRef = useRef(false); const renamingInputRef = useRef(null); const dragInProgressRef = useRef(false); @@ -1409,11 +1410,23 @@ export default function Sidebar() { {project.expanded && activeProjectThread ? (
-
+
- + + {filesExpanded && ( + + )}
) : null}