From 2ea97f9c54f54ea9bca292e2d944291ca592670f Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 16:44:16 -0800 Subject: [PATCH] fix(cloud): host name stays whole and its detail truncates; theme-sync offer waits while the active workspace runs off this computer or is still being created (RA-2/RA-6 real-app) --- .../worktree-list/rows/HostSectionHeader.tsx | 5 +-- .../claude-theme-sync-offer.ts | 31 +++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeader.tsx b/src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeader.tsx index d1589e25662..da7edf31660 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeader.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeader.tsx @@ -148,7 +148,8 @@ export function HostSectionHeader({
@@ -157,7 +158,7 @@ export function HostSectionHeader({ {detail ? ( diff --git a/src/renderer/src/components/terminal-pane/provider-notices/claude-theme-sync/claude-theme-sync-offer.ts b/src/renderer/src/components/terminal-pane/provider-notices/claude-theme-sync/claude-theme-sync-offer.ts index 2129986ec92..a9a74512bfd 100644 --- a/src/renderer/src/components/terminal-pane/provider-notices/claude-theme-sync/claude-theme-sync-offer.ts +++ b/src/renderer/src/components/terminal-pane/provider-notices/claude-theme-sync/claude-theme-sync-offer.ts @@ -7,6 +7,7 @@ import { isPairedWebClientWindow } from '@/lib/desktop-window-chrome' import { TRAILING_ACTIONS_CLASS_NAMES } from '@/components/ui/sonner' import { whenAgentTerminalAppears } from '../agent-presence/agent-terminal-presence' import { getCloudWorkspaceSnapshot } from '@/lib/orca-cloud/orca-cloud-workspace-store' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' const OFFER_TOAST_ID = 'claude-theme-sync-offer' @@ -65,10 +66,24 @@ function showClaudeThemeSyncOffer(): void { }) } -function isOnCloudWorkspace(state: AppState): boolean { - return ( - state.activeWorktreeId !== null && getCloudWorkspaceSnapshot().ids.has(state.activeWorktreeId) - ) +/** + * The sync changes Claude Code on THIS computer. Hold the offer while the active workspace runs + * elsewhere (Orca Cloud, a VM, SSH, an Orca server) or is still being created: a brand-new cloud + * workspace is not in the cloud id list yet when its Claude terminal appears (RA-6). + */ +function isAwayFromThisComputer(state: AppState): boolean { + if (state.activePendingCreationId) { + return true + } + const id = state.activeWorktreeId + if (!id) { + return false + } + if (getCloudWorkspaceSnapshot().ids.has(id) || state.ephemeralVmRuntimesByWorkspaceId?.[id]) { + return true + } + const host = state.activeWorkspaceExecutionHostId + return Boolean(host && host !== LOCAL_EXECUTION_HOST_ID) } /** @@ -76,12 +91,16 @@ function isOnCloudWorkspace(state: AppState): boolean { * use: hold the offer while one is active and make it once a local workspace is (RA-6). */ function offerOnLocalWorkspace(): () => void { - if (!isOnCloudWorkspace(useAppStore.getState())) { + if (!isAwayFromThisComputer(useAppStore.getState())) { showClaudeThemeSyncOffer() return () => {} } const unsubscribe = useAppStore.subscribe((state, previous) => { - if (state.activeWorktreeId !== previous.activeWorktreeId && !isOnCloudWorkspace(state)) { + const moved = + state.activeWorktreeId !== previous.activeWorktreeId || + state.activePendingCreationId !== previous.activePendingCreationId || + state.activeWorkspaceExecutionHostId !== previous.activeWorkspaceExecutionHostId + if (moved && !isAwayFromThisComputer(state)) { unsubscribe() showClaudeThemeSyncOffer() }