From ea5bc4619955fa3f962a72c5aea0cb268d497bf8 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 13 Nov 2026 08:43:00 -0800 Subject: [PATCH] fix(cloud): a paired cloud workspace's terminal recovery knows it is asleep or waking (ASLEEP-SR-RECONNECTING) (#724) useCloudRecoveryContext counted only owned workspaces as cloud, so for a paired one its asleep and waking states were unknown to the recovery notices: the remote-server outage notice ('Reconnecting to ... (cloud)', role=status, aria-live=polite) stayed up under the asleep view, where a screen reader would announce it (n56 DOM dump). Paired rows count as cloud there too, so the notice stays silent while asleep or waking. --- .../use-cloud-recovery-context.test.ts | 20 +++++++++++++++++++ .../orca-cloud/use-cloud-recovery-context.ts | 7 ++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/lib/orca-cloud/use-cloud-recovery-context.test.ts b/src/renderer/src/lib/orca-cloud/use-cloud-recovery-context.test.ts index e59d4e7406b..c6df548be40 100644 --- a/src/renderer/src/lib/orca-cloud/use-cloud-recovery-context.test.ts +++ b/src/renderer/src/lib/orca-cloud/use-cloud-recovery-context.test.ts @@ -100,3 +100,23 @@ describe('terminal recovery for an asleep Orca Cloud workspace (RA-12)', () => { expect(result.current).toBeNull() }) }) + +describe('a paired cloud workspace (ASLEEP-SR-RECONNECTING)', () => { + it('is cloud and asleep, so the outage notice stays silent under the asleep view', () => { + act(() => + seedCloudWorkspaceSnapshot({ + paired: { ws: 'env-paired' }, + idsLoaded: true, + status: { ws: { status: status('sleeping'), loading: false, error: null, fetchedAt: T0 } } + }) + ) + const { result } = renderHook(() => useCloudRecoveryContext('ws')) + expect(result.current).toMatchObject({ asleep: true, waking: false }) + }) + + it('a workspace that is neither owned nor paired is still not cloud', () => { + act(() => seedCloudWorkspaceSnapshot({ idsLoaded: true })) + const { result } = renderHook(() => useCloudRecoveryContext('ws')) + expect(result.current).toBeNull() + }) +}) diff --git a/src/renderer/src/lib/orca-cloud/use-cloud-recovery-context.ts b/src/renderer/src/lib/orca-cloud/use-cloud-recovery-context.ts index 67fe8d60951..1a9d9eeb5e7 100644 --- a/src/renderer/src/lib/orca-cloud/use-cloud-recovery-context.ts +++ b/src/renderer/src/lib/orca-cloud/use-cloud-recovery-context.ts @@ -19,7 +19,12 @@ export type CloudRecoveryContext = { export function useCloudRecoveryContext( worktreeId: string | null | undefined ): CloudRecoveryContext | null { - const isCloud = useIsCloudWorkspace(worktreeId) + // ASLEEP-SR-RECONNECTING: a paired cloud workspace is cloud here too. Owned-only left its asleep + // and waking states unknown to the recovery notices, so the outage notice ("Reconnecting to …", + // a polite live region) stayed up under the asleep view and a screen reader announced it. + const owned = useIsCloudWorkspace(worktreeId) + const paired = useCloudWorkspace((s) => Boolean(worktreeId && worktreeId in s.paired)) + const isCloud = owned || paired const wake = useCloudWorkspace((s) => (worktreeId ? s.wake[worktreeId] : undefined)) const phase = wake?.phase const status = useCloudWorkspace((s) => (worktreeId ? s.status[worktreeId]?.status : undefined))