diff --git a/src/renderer/src/components/orca-cloud-setup/CloudSetupPage.fixture.tsx b/src/renderer/src/components/orca-cloud-setup/CloudSetupPage.fixture.tsx new file mode 100644 index 00000000000..50ba0a85a18 --- /dev/null +++ b/src/renderer/src/components/orca-cloud-setup/CloudSetupPage.fixture.tsx @@ -0,0 +1,94 @@ +import { defineFixture } from '../../component-fixtures/component-fixture' +import type { CloudSetupStep } from '@/components/new-workspace/run-on/cloud-start-model' +import { CloudSetupPage } from './CloudSetupPage' +import { cloudSetupPageModel } from './cloud-setup-page-model' +import type { CloudSetupFlow } from './use-cloud-setup-flow' + +const noop = (): void => {} + +function flow(rows: CloudSetupStep[]): CloudSetupFlow { + return { + ...cloudSetupPageModel(rows), + busy: false, + signingIn: false, + signInDidNotFinish: false, + cancelSignIn: noop, + abandon: noop, + inBrowser: false, + error: null, + canManageBilling: true, + teamAction: null, + continueInBrowser: noop, + startTrial: noop, + fixBilling: noop, + installGitHub: noop, + checkAgain: noop, + copyLink: null, + reopenBrowser: noop + } +} + +function page(rows: CloudSetupStep[], agent: 'claude' | 'codex', label: string) { + return ( +
+ +
+ ) +} + +/** DS-b: signed out. The web's four steps from the first page: Account · Team · Plan · GitHub. */ +export const signedOut = defineFixture({ + width: 1000, + render: () => + page( + [ + { id: 'account', state: 'needed', need: 'sign-in', canFix: true }, + { id: 'plan', state: 'pending', need: 'trial' }, + { id: 'github', state: 'needed', need: 'github', canFix: true }, + { id: 'agent', state: 'optional' } + ], + 'claude', + 'Claude' + ) +}) + +/** DS-b: signed in on a trial-eligible team. Team ticks with Account; the step reads Plan, not Trial. */ +export const trialPlan = defineFixture({ + width: 1000, + render: () => + page( + [ + { id: 'account', state: 'done' }, + { id: 'plan', state: 'needed', need: 'trial', canFix: true, trialSeconds: 7200 }, + { id: 'github', state: 'needed', need: 'github', canFix: true }, + { id: 'agent', state: 'optional' } + ], + 'codex', + 'Codex' + ) +}) + +/** DS-b: only GitHub left. NS-04 (e): the agent's glyph, muted, before its name in the header line. */ +export const githubLeft = defineFixture({ + width: 1000, + render: () => + page( + [ + { id: 'account', state: 'done' }, + { id: 'plan', state: 'done' }, + { id: 'github', state: 'needed', need: 'github', canFix: true }, + { id: 'agent', state: 'optional' } + ], + 'claude', + 'Claude' + ) +}) diff --git a/src/renderer/src/components/orca-cloud-setup/CloudSetupPage.tsx b/src/renderer/src/components/orca-cloud-setup/CloudSetupPage.tsx index 255e7e0e41b..95b90edf2f2 100644 --- a/src/renderer/src/components/orca-cloud-setup/CloudSetupPage.tsx +++ b/src/renderer/src/components/orca-cloud-setup/CloudSetupPage.tsx @@ -8,6 +8,8 @@ import { Button } from '@/components/ui/button' import { Skeleton } from '@/components/ui/skeleton' import { cn } from '@/lib/utils' import { useTranslate } from '@/i18n/use-translate' +import { AgentIcon } from '@/components/agent/icons/AgentIcon' +import type { TerminalAgent } from '../../../../shared/agent-status/identity/terminal-agent' import type { CloudSetupStep, CloudSetupStepId @@ -21,6 +23,8 @@ export type CloudSetupPageProps = { projectName: string | null prompt: string agentLabel: string | null + /** The agent the prompt starts with: its glyph sits before its name in the header line (NS-04). */ + agent?: TerminalAgent | null /** Back from the first step: Create workspace again, with the prompt, project and agent kept. */ onBackToComposer: () => void /** The × in the corner: leave setup, keep the draft (nothing starts). */ @@ -253,6 +257,7 @@ export function CloudSetupPage({ projectName, prompt, agentLabel, + agent = null, onBackToComposer, onExit, starting @@ -304,8 +309,7 @@ export function CloudSetupPage({ prompt.trim() ? t('cloudSetupPage.headerFor', 'Setting up Orca Cloud for {{name}}', { name: prompt.trim() }) : t('cloudSetupPage.header', 'Setting up Orca Cloud'), - projectName, - agentLabel + projectName ] .filter(Boolean) .join(' · ') @@ -326,6 +330,18 @@ export function CloudSetupPage({ data-cloud-setup-context="true" > {context} + {agentLabel ? ( + <> + {' · '} + {/* NS-04 (e): the agent's glyph, muted like the line (never the coloured mark). */} + {agent ? ( + + ) : null} + {agentLabel} + + ) : null}