@@ -29,7 +29,5 @@ export const nonHttp = defineFixture({
})
export const openFailed = defineFixture({
width: 740,
- render: () => (
-
- )
+ render: () =>
})
diff --git a/src/renderer/src/components/browser-pane/stream-remote/sandbox-only-browser-page-state.test.ts b/src/renderer/src/components/browser-pane/stream-remote/sandbox-only-browser-page-state.test.ts
index 3310d7be149..4e3120bf22d 100644
--- a/src/renderer/src/components/browser-pane/stream-remote/sandbox-only-browser-page-state.test.ts
+++ b/src/renderer/src/components/browser-pane/stream-remote/sandbox-only-browser-page-state.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest'
import { canOpenSandboxPageOnThisComputer } from './sandbox-only-browser-page-state'
+import { resolveScreencastSupport } from './use-sandbox-only-browser-page'
describe('canOpenSandboxPageOnThisComputer', () => {
it('offers http(s) pages, including the sandbox localhost', () => {
@@ -15,3 +16,20 @@ describe('canOpenSandboxPageOnThisComputer', () => {
expect(canOpenSandboxPageOnThisComputer('not a url')).toBe(false)
})
})
+
+describe('resolveScreencastSupport', () => {
+ it('treats a pending or failed probe as no screencast on Orca Cloud', () => {
+ expect(resolveScreencastSupport('pending', true)).toBe(false)
+ expect(resolveScreencastSupport('failed', true)).toBe(false)
+ expect(resolveScreencastSupport(false, true)).toBe(false)
+ // A future orcad that streams is honoured once proven.
+ expect(resolveScreencastSupport(true, true)).toBe(true)
+ })
+
+ it('keeps other hosts on the stream path until the probe says otherwise', () => {
+ expect(resolveScreencastSupport('pending', false)).toBe(null)
+ expect(resolveScreencastSupport('failed', false)).toBe(null)
+ expect(resolveScreencastSupport(true, false)).toBe(true)
+ expect(resolveScreencastSupport(false, false)).toBe(false)
+ })
+})
diff --git a/src/renderer/src/components/browser-pane/stream-remote/sandbox-only-browser-page-state.tsx b/src/renderer/src/components/browser-pane/stream-remote/sandbox-only-browser-page-state.tsx
index 70f9b0a2f5c..c2b1c1a0669 100644
--- a/src/renderer/src/components/browser-pane/stream-remote/sandbox-only-browser-page-state.tsx
+++ b/src/renderer/src/components/browser-pane/stream-remote/sandbox-only-browser-page-state.tsx
@@ -24,11 +24,16 @@ export function SandboxOnlyBrowserPageState({
}: {
url: string
opening: boolean
- error: string | null
+ /** The last open attempt failed; the button doubles as the retry. */
+ error: boolean
onOpenOnThisComputer: () => void
}): React.JSX.Element {
const t = useTranslate()
const canOpen = canOpenSandboxPageOnThisComputer(url)
+ const cantShow = t(
+ 'auto.components.browser.pane.SandboxOnlyBrowserPage.cantShow',
+ "Orca can't show the sandbox's browser here yet."
+ )
return (
- {t(
- 'auto.components.browser.pane.SandboxOnlyBrowserPage.body',
- "Orca can't show the sandbox's browser here yet. Open the page on this computer to see it. Pages the agent signed in to will open signed out."
- )}
+ {canOpen
+ ? t(
+ 'auto.components.browser.pane.SandboxOnlyBrowserPage.body',
+ "Orca can't show the sandbox's browser here yet. Open the page on this computer to see it. Pages the agent signed in to will open signed out."
+ )
+ : cantShow}