mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 08:03:37 +00:00
Keep workspace filter visible during hydration
This commit is contained in:
@@ -36,6 +36,7 @@ function setState(overrides: Record<string, unknown> = {}): 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')
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user