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))