mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 19:34:29 +00:00
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)
This commit is contained in:
@@ -148,7 +148,8 @@ export function HostSectionHeader({
|
||||
<div className="flex min-w-0 flex-1 items-center gap-1.5">
|
||||
<span
|
||||
className={cn(
|
||||
'min-w-0 truncate text-[12px] font-semibold leading-none',
|
||||
// The host name wins over its detail: "Orca Cloud" stays whole, "1 running · 1 asleep" truncates.
|
||||
'min-w-0 max-w-[70%] shrink-0 truncate text-[12px] font-semibold leading-none',
|
||||
isDisconnected || isSuspended ? 'text-muted-foreground' : 'text-foreground'
|
||||
)}
|
||||
>
|
||||
@@ -157,7 +158,7 @@ export function HostSectionHeader({
|
||||
{detail ? (
|
||||
<span
|
||||
className={cn(
|
||||
'shrink-0 truncate text-[10px] leading-none',
|
||||
'min-w-0 truncate text-[10px] leading-none',
|
||||
detail.isWarning ? 'text-destructive' : 'text-muted-foreground/70'
|
||||
)}
|
||||
>
|
||||
|
||||
+25
-6
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user