From d87fc15f05fd7dc29c6495bb4797974fca0f074c Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:59:53 -0700 Subject: [PATCH] fix(sidebar): preserve filtered folder workspace rows --- .../src/components/sidebar/WorktreeList.tsx | 1 + .../sidebar/project-group-header-dom.test.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/renderer/src/components/sidebar/WorktreeList.tsx b/src/renderer/src/components/sidebar/WorktreeList.tsx index a632336b9ae..984fbf32d23 100644 --- a/src/renderer/src/components/sidebar/WorktreeList.tsx +++ b/src/renderer/src/components/sidebar/WorktreeList.tsx @@ -6943,6 +6943,7 @@ const WorktreeList = React.memo(function WorktreeList({ workspaceHostScope: 'all' }) && worktrees.length === 0 && + visibleFolderWorkspacesForRows.length === 0 && placeholderRepoIds.size === 0 && importedWorktreesByRepo.size === 0 // Why: host filters own Project Group rows; only workspace filters may replace those rows with Clear Filters. diff --git a/src/renderer/src/components/sidebar/project-group-header-dom.test.ts b/src/renderer/src/components/sidebar/project-group-header-dom.test.ts index 16ee1d03943..74b6e72a57d 100644 --- a/src/renderer/src/components/sidebar/project-group-header-dom.test.ts +++ b/src/renderer/src/components/sidebar/project-group-header-dom.test.ts @@ -783,6 +783,20 @@ describe('WorktreeList project-group host filtering', () => { expect(container.textContent).not.toContain('No workspaces found') }) + it('keeps a selected-host folder-only owner group visible under workspace filters', async () => { + setHostFilteredWorktreeListState([hostFilteredFolderWorkspace()]) + worktreeListStore.state = { + ...worktreeListStore.state, + hideDefaultBranchWorkspace: true + } + + const container = await renderHostFilteredWorktreeList() + + expect(container.textContent).toContain('Runtime project group') + expect(container.textContent).toContain('Runtime folder workspace') + expect(container.textContent).not.toContain('No workspaces found') + }) + it('still lets a workspace filter replace empty project-group headers', async () => { setHostFilteredWorktreeListState([]) worktreeListStore.state = {