From a25834f726c30ca03deef60d57dddcc2ef8606ea Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Tue, 19 May 2026 13:11:59 -0700 Subject: [PATCH] Revert layout gate from "gate offline host workspaces (#4672)" Reverts the layout wiring and useRemoteHostStatus offline branch from 7ec5ee1c26e2f8a166ccb5d0fcd8d536fa909935. Keeps WorkspaceHostOfflineState component on disk (unused) for later use. --- .../useRemoteHostStatus/useRemoteHostStatus.ts | 16 +--------------- .../_dashboard/v2-workspace/layout.tsx | 9 --------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/hooks/useRemoteHostStatus/useRemoteHostStatus.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/hooks/useRemoteHostStatus/useRemoteHostStatus.ts index 23d505e29bd..f3fa0348a4a 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/hooks/useRemoteHostStatus/useRemoteHostStatus.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/hooks/useRemoteHostStatus/useRemoteHostStatus.ts @@ -13,11 +13,6 @@ import semver from "semver"; export type RemoteHostStatus = | { status: "skip" } | { status: "loading" } - | { - status: "offline"; - hostId: string; - hostName: string; - } | { status: "incompatible"; hostName: string; @@ -52,7 +47,6 @@ export function useRemoteHostStatus( ) .select(({ hosts }) => ({ name: hosts.name, - isOnline: hosts.isOnline, })), [collections, organizationId, filterMachineId], ); @@ -66,8 +60,7 @@ export function useRemoteHostStatus( const infoQuery = useQuery({ queryKey: ["remoteHostInfo", organizationId, hostId], queryFn: () => getHostServiceClientByUrl(hostUrl).host.info.query(), - enabled: - workspace != null && !isLocal && isReady && hostRow?.isOnline !== false, + enabled: workspace != null && !isLocal, staleTime: HOST_INFO_STALE_MS, retry: false, }); @@ -75,13 +68,6 @@ export function useRemoteHostStatus( if (!workspace) return { status: "loading" }; if (isLocal) return { status: "skip" }; if (!isReady) return { status: "loading" }; - if (hostRow?.isOnline === false) { - return { - status: "offline", - hostId, - hostName: hostRow.name, - }; - } if (infoQuery.isSuccess) { const hostVersion = infoQuery.data.version; diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx index 3650c42cb7f..05a8de21c94 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx @@ -8,7 +8,6 @@ import { useWorkspaceCreatesStore } from "renderer/stores/workspace-creates"; import { WorkspaceCreateErrorState } from "./components/WorkspaceCreateErrorState"; import { WorkspaceCreatingState } from "./components/WorkspaceCreatingState"; import { WorkspaceHostIncompatibleState } from "./components/WorkspaceHostIncompatibleState"; -import { WorkspaceHostOfflineState } from "./components/WorkspaceHostOfflineState"; import { WorkspaceNotFoundState } from "./components/WorkspaceNotFoundState"; import { useRemoteHostStatus } from "./hooks/useRemoteHostStatus"; import { WorkspaceProvider } from "./providers/WorkspaceProvider"; @@ -93,14 +92,6 @@ function V2WorkspaceLayout() { /> ); } - if (hostStatus.status === "offline") { - return ( - - ); - } if (hostStatus.status === "loading") { return
; }