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 = {