From 03093cc6f64fa764a9015357542e9202bf2036a7 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 19:43:03 -0800 Subject: [PATCH 1/2] feat(cloud): JA-04 focused Orca Cloud sign-in sheet; no duplicate Orca Cloud host row; account-wide copy Every Orca Cloud 'Set up once' / 'Renew' (composer row, sign-in strip, VM build row, A16 panel) opens one sheet with only Claude and Codex (S0's rows) instead of scrolling Settings past this computer's provider accounts. The Hosts table drops its Orca Cloud row: the page's Orca Cloud part below is the one place for it. 'Set up once on this computer' becomes 'Set up once' (setup is account-wide). --- src/renderer/src/App.tsx | 2 + .../open-agent-host-settings.ts | 5 ++ .../CloudAgentSignInStripPortals.tsx | 5 +- .../new-workspace/OrcaCloudAgentSetupRow.tsx | 8 +- .../agent-accounts/OrcaCloudAccounts.tsx | 4 +- .../overview/AgentAccountsOverviewSection.tsx | 51 ++----------- .../sign-in-sheet/OrcaCloudSignInSheet.tsx | 75 +++++++++++++++++++ .../orca-cloud-sign-in-sheet-store.ts | 37 +++++++++ ...ngs-orca-cloud-agent-accounts-sections.tsx | 4 +- .../VmBuildCloudAgentsRow.tsx | 7 +- src/renderer/src/i18n/locales/en.json | 10 ++- 11 files changed, 146 insertions(+), 62 deletions(-) create mode 100644 src/renderer/src/components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx create mode 100644 src/renderer/src/components/settings/agent-accounts/sign-in-sheet/orca-cloud-sign-in-sheet-store.ts diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 65d9149536e..873546f3b2b 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -8,6 +8,7 @@ import { BrowserExtensionInstallDialog } from './components/browser-extension-in import { PlansDialogHost } from './components/billing/plans/PlansDialogHost' import { CloudMoveToComputerDialogMount } from './components/orca-cloud/CloudMoveToComputerDialogMount' import { CloudSecretsAskDialogHost } from './components/cloud-secrets-ask/CloudSecretsMissingNotice' +import { OrcaCloudSignInSheet } from './components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet' import { AgentHostPanel } from './components/agent-host-panel/AgentHostPanel' import { SecretRequestUnseenNotifier } from './components/agent-pane/SecretRequestUnseenNotifier' import { TeamDialogHost } from './components/billing/team/TeamDialogHost' @@ -127,6 +128,7 @@ function App(): React.JSX.Element { + diff --git a/src/renderer/src/components/agent-host-panel/open-agent-host-settings.ts b/src/renderer/src/components/agent-host-panel/open-agent-host-settings.ts index 3585214c722..b5634b5bdc2 100644 --- a/src/renderer/src/components/agent-host-panel/open-agent-host-settings.ts +++ b/src/renderer/src/components/agent-host-panel/open-agent-host-settings.ts @@ -1,6 +1,7 @@ // The panel's footer links and row actions open Settings over it; the panel closes first so focus // lands in Settings rather than behind the sheet. import { useAppStore } from '@/store' +import { openOrcaCloudSignInSheet } from '@/components/settings/agent-accounts/sign-in-sheet/orca-cloud-sign-in-sheet-store' import type { AgentHostFooterLink } from './agent-host-capabilities' import { closeAgentHostPanel } from './agent-host-panel-store' @@ -16,6 +17,10 @@ const TARGET = { export function openAgentHostSettings(link: AgentHostFooterLink): void { closeAgentHostPanel() + if (link === 'agentAccounts') { + openOrcaCloudSignInSheet() + return + } const target: { pane: (typeof TARGET)[AgentHostFooterLink]['pane']; sectionId?: string } = TARGET[link] const store = useAppStore.getState() diff --git a/src/renderer/src/components/agent-sign-in-strip/CloudAgentSignInStripPortals.tsx b/src/renderer/src/components/agent-sign-in-strip/CloudAgentSignInStripPortals.tsx index 7999809739f..24cf1ee152c 100644 --- a/src/renderer/src/components/agent-sign-in-strip/CloudAgentSignInStripPortals.tsx +++ b/src/renderer/src/components/agent-sign-in-strip/CloudAgentSignInStripPortals.tsx @@ -2,6 +2,7 @@ // private launch hold waits, or #40228's per-workspace gate while the Orca-account path is paused or // never offered. It overlays the top 56 px of the pane while the agent hasn't started, so the // terminal's size never changes. SSH, WSL and paired hosts keep #40228's card. +import { openOrcaCloudSignInSheet } from '@/components/settings/agent-accounts/sign-in-sheet/orca-cloud-sign-in-sheet-store' import React, { useEffect, useSyncExternalStore } from 'react' import { createPortal } from 'react-dom' import { useAppStore } from '@/store' @@ -51,7 +52,7 @@ export function useCloudGatePaneKeys(controller: TerminalPaneController): Readon return new Set(joined ? joined.split('\u0000') : []) } -function openSettings(pane: 'accounts' | 'cloud-secrets', sectionId?: string): void { +function openSettings(pane: 'cloud-secrets', sectionId?: string): void { const store = useAppStore.getState() store.openSettingsTarget({ pane, repoId: null, ...(sectionId ? { sectionId } : {}) }) store.openSettingsPage() @@ -119,7 +120,7 @@ function CloudStripPortal({ primary: (action) => { switch (action.kind) { case 'renew': - openSettings('accounts', 'orca-cloud') + openOrcaCloudSignInSheet() return case 'signIn': gateActions.signIn() diff --git a/src/renderer/src/components/new-workspace/OrcaCloudAgentSetupRow.tsx b/src/renderer/src/components/new-workspace/OrcaCloudAgentSetupRow.tsx index e3d3b0efcd9..5c0ed699d05 100644 --- a/src/renderer/src/components/new-workspace/OrcaCloudAgentSetupRow.tsx +++ b/src/renderer/src/components/new-workspace/OrcaCloudAgentSetupRow.tsx @@ -2,8 +2,8 @@ // Later" hint: it says how the composer's agent will sign in, links to the one-time setup in // Settings → Agent accounts, and never blocks Start or signs in per sandbox. import { useEffect } from 'react' +import { openOrcaCloudSignInSheet } from '@/components/settings/agent-accounts/sign-in-sheet/orca-cloud-sign-in-sheet-store' import { CircleCheck, CircleDashed, Info, TriangleAlert } from 'lucide-react' -import { useAppStore } from '@/store/index' import { useTranslate, type Translate } from '@/i18n/use-translate' import { Button } from '@/components/ui/button' import { Skeleton } from '@/components/ui/skeleton' @@ -19,11 +19,9 @@ import { noteComposerAgentCoverage } from '@/lib/orca-cloud/cloud-first-start-ag import type { OrcaCloudRunTargetAccess } from './orca-cloud-run-target-access' import { agentName, keySourceLabel } from '../settings/agent-accounts/orca-cloud-accounts-copy' -/** Settings → Agent accounts, scrolled to the Orca Cloud section (S0). The composer stays open. */ +/** The focused Orca Cloud sign-in sheet (JA-04), over the composer, which stays open. */ export function openOrcaCloudAgentAccounts(): void { - useAppStore - .getState() - .openSettingsTarget({ pane: 'accounts', repoId: null, sectionId: 'orca-cloud' }) + openOrcaCloudSignInSheet() } export function orcaCloudAgentCoveredLabel( diff --git a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.tsx b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.tsx index 893a54ebcd9..66c70cab1ec 100644 --- a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.tsx +++ b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.tsx @@ -153,8 +153,8 @@ export function OrcaCloudAccountsView({ )} diff --git a/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverviewSection.tsx b/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverviewSection.tsx index 362ca159749..74951c2e387 100644 --- a/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverviewSection.tsx +++ b/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverviewSection.tsx @@ -1,11 +1,9 @@ -// Wires S3 to the renderer's host list, the per-host sign-in probes and the Orca account. Rows open -// the A16 panel; the Orca Cloud row scrolls to S0 below (one row stands for every cloud workspace). -import React, { useEffect, useMemo, useState } from 'react' +// Wires S3 to the renderer's host list and the per-host sign-in probes. Rows open the A16 panel. +// No Orca Cloud row (JA-04): the page's own Orca Cloud part right below is the one place for it. +import React, { useMemo } from 'react' import { useAppStore } from '@/store' import { useTranslate } from '@/i18n/use-translate' -import { useOrcaCloudAgentAccounts } from '@/lib/orca-cloud/orca-cloud-agent-accounts-store' import { openAgentHostPanel } from '../../../agent-host-panel/agent-host-panel-store' -import { ORCA_CLOUD_ACCOUNTS_SECTION_ID } from '../OrcaCloudAccounts' import { overviewRows, type OverviewAction, @@ -22,28 +20,6 @@ function openSettings(pane: 'accounts', sectionId?: string): void { store.openSettingsPage() } -/** A member can't change team keys: their key cells say "set by your team". */ -function useIsCloudMember(enabled: boolean): boolean { - const [member, setMember] = useState(false) - useEffect(() => { - if (!enabled) { - return - } - let cancelled = false - void (window.api.cloudSecrets?.effective({}) ?? Promise.resolve(null)) - .catch(() => null) - .then((result) => { - if (!cancelled && result?.ok) { - setMember(!result.value.caller.canWrite.org) - } - }) - return () => { - cancelled = true - } - }, [enabled]) - return member -} - export function AgentAccountsOverviewSection({ hideHeader = false }: { @@ -52,28 +28,11 @@ export function AgentAccountsOverviewSection({ const t = useTranslate() const hosts = useOverviewHosts() const { probes, checkAgain, firstPassDone } = useOverviewProbes(hosts) - const accounts = useOrcaCloudAgentAccounts() - const ready = accounts.load.kind === 'ready' - const member = useIsCloudMember(ready) - const signedOutOfOrca = accounts.load.kind === 'failed' && accounts.load.error === 'signed_out' - const rows = useMemo( - () => - overviewRows({ - hosts, - probes, - cloud: - accounts.load.kind === 'ready' - ? { status: accounts.load.status, keyKinds: accounts.keyKinds, member } - : null - }), - [hosts, probes, accounts.load, accounts.keyKinds, member] - ) + const rows = useMemo(() => overviewRows({ hosts, probes, cloud: null }), [hosts, probes]) const hostById = new Map(hosts.map((host) => [host.hostId, host])) const open = (row: OverviewRow, focus?: 'claude' | 'codex'): void => { const host = row.hostId ? hostById.get(row.hostId) : undefined if (!host) { - // Orca Cloud: S0 below owns setup and the Source for every cloud workspace. - document.getElementById(ORCA_CLOUD_ACCOUNTS_SECTION_ID)?.scrollIntoView({ block: 'start' }) return } openAgentHostPanel({ @@ -111,7 +70,7 @@ export function AgentAccountsOverviewSection({ return ( open(row)} diff --git a/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx b/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx new file mode 100644 index 00000000000..67ba6b64dfd --- /dev/null +++ b/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx @@ -0,0 +1,75 @@ +// JA-04: the focused Orca Cloud sign-in sheet. Only Claude and Codex, each with its one action and +// status (S0's rows), so "Set up once" never lands on this computer's provider accounts. +import React from 'react' +import { useAppStore } from '@/store' +import { useTranslate } from '@/i18n/use-translate' +import { + Sheet, + SheetContent, + SheetDescription, + SheetHeader, + SheetTitle +} from '@/components/ui/sheet' +import { OrcaCloudAccountsSection } from '../OrcaCloudAccountsSection' +import { + closeOrcaCloudSignInSheet, + useOrcaCloudSignInSheetOpen +} from './orca-cloud-sign-in-sheet-store' + +function openAllAgentAccounts(): void { + closeOrcaCloudSignInSheet() + const store = useAppStore.getState() + store.openSettingsTarget({ pane: 'accounts', repoId: null, sectionId: 'orca-cloud' }) + store.openSettingsPage() +} + +/** The sheet's contents; the host owns the Sheet so fixtures can render it open. */ +export function OrcaCloudSignInSheetView({ + body +}: { + /** S0's rows; fixtures pass a fixed view. */ + body: React.ReactNode +}): React.JSX.Element { + const t = useTranslate() + const titleId = React.useId() + return ( + +
+ + + {t('orcaCloudSignInSheet.title', 'Agents in Orca Cloud')} + + + {t( + 'orcaCloudSignInSheet.description', + 'Set up Claude and Codex once. Every cloud workspace uses them, including new, cloned and restarted ones.' + )} + + +
+
{body}
+ +
+ ) +} + +/** Mounted once in App; opened by openOrcaCloudSignInSheet(). */ +export function OrcaCloudSignInSheet(): React.JSX.Element { + const open = useOrcaCloudSignInSheetOpen() + return ( + !next && closeOrcaCloudSignInSheet()}> + {open ? } /> : null} + + ) +} diff --git a/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/orca-cloud-sign-in-sheet-store.ts b/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/orca-cloud-sign-in-sheet-store.ts new file mode 100644 index 00000000000..4c5c9c5e1e0 --- /dev/null +++ b/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/orca-cloud-sign-in-sheet-store.ts @@ -0,0 +1,37 @@ +// JA-04: every "Set up once" / "Renew" for Orca Cloud opens one focused sheet (Claude and Codex +// only) instead of Settings, so nobody scrolls past this computer's provider accounts to reach it. +import { useSyncExternalStore } from 'react' + +let open = false +const listeners = new Set<() => void>() + +function set(next: boolean): void { + if (open === next) { + return + } + open = next + for (const listener of listeners) { + listener() + } +} + +export function openOrcaCloudSignInSheet(): void { + set(true) +} + +export function closeOrcaCloudSignInSheet(): void { + set(false) +} + +function subscribe(listener: () => void): () => void { + listeners.add(listener) + return () => listeners.delete(listener) +} + +export function useOrcaCloudSignInSheetOpen(): boolean { + return useSyncExternalStore( + subscribe, + () => open, + () => false + ) +} diff --git a/src/renderer/src/components/settings/page/settings-orca-cloud-agent-accounts-sections.tsx b/src/renderer/src/components/settings/page/settings-orca-cloud-agent-accounts-sections.tsx index 81d7aa181ec..71222c6103b 100644 --- a/src/renderer/src/components/settings/page/settings-orca-cloud-agent-accounts-sections.tsx +++ b/src/renderer/src/components/settings/page/settings-orca-cloud-agent-accounts-sections.tsx @@ -30,8 +30,8 @@ export function orcaCloudAgentAccountsParts( id: 'accounts-orca-cloud', title: t('orcaCloudAccounts.title', 'Orca Cloud'), description: t( - 'orcaCloudAccounts.help', - 'Set up once on this computer. Every cloud workspace uses it, including new, cloned and restarted ones.' + 'orcaCloudAccounts.helpAccountWide', + 'Set up once. Every cloud workspace uses it, including new, cloned and restarted ones.' ), content: } diff --git a/src/renderer/src/components/worktree-creation/cloud-agents-row/VmBuildCloudAgentsRow.tsx b/src/renderer/src/components/worktree-creation/cloud-agents-row/VmBuildCloudAgentsRow.tsx index b61d73246f0..f3694cdc101 100644 --- a/src/renderer/src/components/worktree-creation/cloud-agents-row/VmBuildCloudAgentsRow.tsx +++ b/src/renderer/src/components/worktree-creation/cloud-agents-row/VmBuildCloudAgentsRow.tsx @@ -1,6 +1,7 @@ // Live Agents row for an Orca Cloud build. Reads the Orca account once (shared store with S0 and the // composer), never the sandbox; runs S0's setup inline when nothing is set up (R2), and writes the // per-workspace Source from the ⋯ menu (S1-b). +import { openOrcaCloudSignInSheet } from '@/components/settings/agent-accounts/sign-in-sheet/orca-cloud-sign-in-sheet-store' import React, { useCallback, useEffect, useRef, useState } from 'react' import { toast } from 'sonner' import { useAppStore } from '@/store' @@ -32,7 +33,7 @@ import { VmBuildAgentSignInRow } from '../VmBuildAgentSignInRow' import { VmBuildCloudAgentsMenu, type WorkspaceSourcesLoad } from './VmBuildCloudAgentsMenu' import { VmBuildCloudAgentsRowView, type DesktopKeySave } from './VmBuildCloudAgentsRowView' -function openSettings(pane: 'accounts' | 'cloud-secrets', sectionId?: string): void { +function openSettings(pane: 'cloud-secrets', sectionId?: string): void { const store = useAppStore.getState() store.openSettingsTarget({ pane, repoId: null, ...(sectionId ? { sectionId } : {}) }) store.openSettingsPage() @@ -156,7 +157,7 @@ export function VmBuildCloudAgentsRow({ sources={sources} onOpen={readSources} onChoose={choose} - onManage={() => openSettings('accounts', 'orca-cloud')} + onManage={() => openOrcaCloudSignInSheet()} onUseKey={() => openSettings('cloud-secrets')} /> ) @@ -184,7 +185,7 @@ export function VmBuildCloudAgentsRow({ void api?.acknowledge({ agent }) }, retryLoad: () => void reloadOrcaCloudAgentAccounts(), - manage: () => openSettings('accounts', 'orca-cloud'), + manage: () => openOrcaCloudSignInSheet(), saveDesktopKey: saveKey, signInHere: (agent) => { nextRequest.current += 1 diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index ec448c98c22..1ff4d702bcb 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -27814,7 +27814,6 @@ "signIn": "Sign in", "loadFailed": "Couldn’t load your agent accounts.", "title": "Orca Cloud", - "help": "Set up once on this computer. Every cloud workspace uses it, including new, cloned and restarted ones.", "policy": "Your Claude and ChatGPT accounts are used only in your own workspaces. Teammates never use them.", "codeCopied": "Code copied", "agent": { @@ -27843,7 +27842,8 @@ "unavailableDetail": "Signing in once with your {{product}} account isn’t available in Orca Cloud yet. Each new cloud workspace asks you to sign in.", "allUnavailable": "Claude and Codex sign in for each cloud workspace for now.", "pasteTokenInstead": "Paste a token instead", - "rowMenu": "{{agent}} account options" + "rowMenu": "{{agent}} account options", + "helpAccountWide": "Set up once. Every cloud workspace uses it, including new, cloned and restarted ones." }, "vmBuildAgents": { "menu": { @@ -28086,5 +28086,11 @@ }, "untitled": "New cloud workspace", "waitingBrowser": "Waiting for your browser…" + }, + "orcaCloudSignInSheet": { + "title": "Agents in Orca Cloud", + "description": "Set up Claude and Codex once. Every cloud workspace uses them, including new, cloned and restarted ones.", + "footerLabel": "Related settings", + "allAccounts": "All agent accounts" } } From bd6cd6e7f82915c0a8bdeb2d2a864c3e1a712e8d Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 20:11:12 -0800 Subject: [PATCH 2/2] feat(cloud): JA-04 sheet 600px wide; sidebar row 'Set up once' opens the sheet too --- .../src/components/orca-cloud/CloudAgentRowSignInTarget.tsx | 4 +--- .../agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/components/orca-cloud/CloudAgentRowSignInTarget.tsx b/src/renderer/src/components/orca-cloud/CloudAgentRowSignInTarget.tsx index daba491c714..03c6030286a 100644 --- a/src/renderer/src/components/orca-cloud/CloudAgentRowSignInTarget.tsx +++ b/src/renderer/src/components/orca-cloud/CloudAgentRowSignInTarget.tsx @@ -1,7 +1,6 @@ // The status (dot and text) of a cloud agent row that needs sign-in: clicking it opens // Settings → Agent accounts, where the fix lives. The rest of the row still opens the pane. import React, { useCallback } from 'react' -import { useAppStore } from '@/store' import { cn } from '@/lib/utils' import { AgentStateDot } from '@/components/AgentStateDot' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' @@ -11,10 +10,9 @@ import { openOrcaCloudAgentAccounts } from '@/components/new-workspace/OrcaCloud /** What the status shows: its label, the agent's catalog name, and the tooltip naming the fix. */ export type CloudAgentRowStatusText = { label: string; agentName: string; tooltip: string | null } -/** The composer's "Set up once" target, plus opening Settings, which the sidebar has closed. */ +/** The sidebar row's "Set up once": the focused Orca Cloud sign-in sheet (JA-04). */ export function openCloudAgentAccountsSettings(): void { openOrcaCloudAgentAccounts() - useAppStore.getState().openSettingsPage() } /** diff --git a/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx b/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx index 67ba6b64dfd..ebec6ee976d 100644 --- a/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx +++ b/src/renderer/src/components/settings/agent-accounts/sign-in-sheet/OrcaCloudSignInSheet.tsx @@ -33,7 +33,7 @@ export function OrcaCloudSignInSheetView({ const t = useTranslate() const titleId = React.useId() return ( - +