fix(sidebar): preserve filtered folder workspace rows

This commit is contained in:
Brennan Benson
2026-08-10 19:59:53 -07:00
parent 3663228541
commit d87fc15f05
2 changed files with 15 additions and 0 deletions
@@ -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.
@@ -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 = {