diff --git a/src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.test.tsx b/src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.test.tsx index 3701737c85e..19cca533055 100644 --- a/src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.test.tsx +++ b/src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.test.tsx @@ -36,6 +36,7 @@ function setState(overrides: Record = {}): void { hideWorkspacesFromOtherDevices: false, setHideWorkspacesFromOtherDevices: vi.fn(), runtimeEnvironments: [], + runtimeEnvironmentCatalogHydrated: true, alwaysShowDefaultBranchWorkspace: true, setAlwaysShowDefaultBranchWorkspace: vi.fn(), ...overrides @@ -96,8 +97,15 @@ describe('SidebarWorkspaceFilterSection', () => { expect(rowLabels()).toContain('Hide other-client workspaces') }) + it('keeps the other-client filter visible while the remote catalog loads', () => { + setState({ runtimeEnvironmentCatalogHydrated: false }) + render() + + expect(rowLabels()).toContain('Hide other-client workspaces') + }) + it('hides the other-client filter for local-only clients', () => { - setState() + setState({ runtimeEnvironmentCatalogHydrated: true }) render() expect(rowLabels()).not.toContain('Hide other-client workspaces') diff --git a/src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsx b/src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsx index ba06a2d1dae..03726858013 100644 --- a/src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsx +++ b/src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsx @@ -27,11 +27,15 @@ const SidebarWorkspaceFilterSection = React.memo(function SidebarWorkspaceFilter const hideWorkspacesFromOtherDevices = useAppStore((s) => s.hideWorkspacesFromOtherDevices) const setHideWorkspacesFromOtherDevices = useAppStore((s) => s.setHideWorkspacesFromOtherDevices) const runtimeEnvironments = useAppStore((s) => s.runtimeEnvironments) + const runtimeEnvironmentCatalogHydrated = useAppStore((s) => s.runtimeEnvironmentCatalogHydrated) const alwaysShowDefaultBranchWorkspace = useAppStore((s) => s.alwaysShowDefaultBranchWorkspace) const setAlwaysShowDefaultBranchWorkspace = useAppStore( (s) => s.setAlwaysShowDefaultBranchWorkspace ) - const showOtherClientFilter = runtimeEnvironments.length > 0 || hideWorkspacesFromOtherDevices + const showOtherClientFilter = + !runtimeEnvironmentCatalogHydrated || + runtimeEnvironments.length > 0 || + hideWorkspacesFromOtherDevices return ( <>