From 32b4f457042dea08215f6be08d5aaae9349b0564 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 17:05:53 -0800 Subject: [PATCH 1/3] fix(cloud): RA-5 Agent accounts polish from the real-app re-check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - S3 host column: the name keeps a 6rem minimum so 'Orca Cloud' never truncates; the muted detail gives way first. - 'Needs attention · 0' shows 'Nothing needs attention.' instead of a header-only table. - An expired Orca Cloud row offers Renew plus a ⋯ with Remove…, which confirms like the active row (shared RemoveConfirmRow). - 'Renew' everywhere for an expired account: the build-sheet row no longer says 'Sign in again'. - The not-set-up Claude row offers 'Paste a token instead' (S0's existing paste path) under its detail. Fixtures: OrcaCloudAccounts:expiredRemoveConfirm, AgentAccountsPane:nothingNeedsAttention. --- .../AgentAccountsPane.fixture.tsx | 12 ++ .../agent-accounts/OrcaCloudAccountRow.tsx | 39 +++++- .../OrcaCloudAccounts.fixture.tsx | 7 ++ .../agent-accounts/OrcaCloudAccounts.test.tsx | 24 ++++ .../agent-accounts/OrcaCloudActiveRow.tsx | 44 +------ .../agent-accounts/OrcaCloudRemoveRow.tsx | 111 ++++++++++++++++++ .../overview/AgentAccountsOverview.test.tsx | 46 ++++++++ .../overview/AgentAccountsOverview.tsx | 15 ++- .../VmBuildCloudAgentsRowView.tsx | 2 +- .../cloud-agents-row/build-agents-row-copy.ts | 5 +- .../src/i18n/en-runtime-required.json | 4 + src/renderer/src/i18n/locales/en.json | 7 +- 12 files changed, 262 insertions(+), 54 deletions(-) create mode 100644 src/renderer/src/components/settings/agent-accounts/OrcaCloudRemoveRow.tsx create mode 100644 src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverview.test.tsx diff --git a/src/renderer/src/components/settings/agent-accounts/AgentAccountsPane.fixture.tsx b/src/renderer/src/components/settings/agent-accounts/AgentAccountsPane.fixture.tsx index 0ac84022be3..9fe7ee78af0 100644 --- a/src/renderer/src/components/settings/agent-accounts/AgentAccountsPane.fixture.tsx +++ b/src/renderer/src/components/settings/agent-accounts/AgentAccountsPane.fixture.tsx @@ -90,6 +90,18 @@ export const overview = defineFixture({ ) }) +/** RA-5: the Needs attention filter with nothing in it says so instead of an empty table. */ +export const nothingNeedsAttention = defineFixture({ + width: 860, + render: () => ( + + ) +}) + export const needsAttention = defineFixture({ width: 860, render: () => ( diff --git a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx index f2678f4e60b..de8a74e13d6 100644 --- a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx +++ b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx @@ -14,6 +14,7 @@ import { agentName, keyPhrase, productName, setupFailureCopy } from './orca-clou import type { OrcaCloudAccountsActions } from './orca-cloud-accounts-types' import { ActiveRow, ChoiceRow } from './OrcaCloudActiveRow' import { SetupRow } from './OrcaCloudSetupRow' +import { RemoveConfirmRow, RowRemoveMenu } from './OrcaCloudRemoveRow' export function AccountRow({ agent, @@ -61,7 +62,20 @@ export function AccountRow({ {useAccount} } - /> + > + {/* The paste path stays reachable without waiting for the browser (RA-5). */} + {agent === 'claude' ? ( + + ) : null} + ) break case 'setup': @@ -107,7 +121,14 @@ export function AccountRow({ ) break case 'expired': - content = ( + content = confirmRemove ? ( + + ) : ( actions.start(agent)}> - {t('orcaCloudAccounts.renew', 'Renew')} - + <> + + setConfirmRemove(true)} /> + } /> ) diff --git a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.fixture.tsx b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.fixture.tsx index 85165bbbad7..7e366be90d8 100644 --- a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.fixture.tsx +++ b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.fixture.tsx @@ -151,6 +151,13 @@ export const removeConfirm = fixture({ claude: CLAUDE_ACTIVE, codex: CODEX_TEAM confirmRemove: 'claude' }) +/** RA-5: Remove… from an expired row's ⋯ confirms like the active row. */ +export const expiredRemoveConfirm = fixture( + { claude: { kind: 'expired', keyKind: null, covered: false }, codex: CODEX_TEAM }, + READY, + { confirmRemove: 'claude' } +) + export const killSwitch = fixture({ claude: CLAUDE_ACTIVE, codex: { kind: 'killSwitch' } diff --git a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.test.tsx b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.test.tsx index ed43bdfb775..5f4fd4ef198 100644 --- a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.test.tsx +++ b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccounts.test.tsx @@ -118,6 +118,30 @@ describe('OrcaCloudAccountsView', () => { ) }) + it('offers Paste a token instead on the not-set-up Claude row only (RA-5)', () => { + const handlers = view({ claude: NOT_SET_UP, codex: NOT_SET_UP }) + const paste = screen.getAllByRole('button', { name: 'Paste a token instead' }) + expect(paste).toHaveLength(1) + fireEvent.click(paste[0]) + expect(handlers.usePaste).toHaveBeenCalledOnce() + }) + + it('an expired row offers Renew and a ⋯ with Remove, which confirms first (RA-5)', async () => { + const handlers = view({ + claude: { kind: 'expired', keyKind: null, covered: false }, + codex: NOT_SET_UP + }) + expect(screen.getByRole('button', { name: 'Renew' })).toBeTruthy() + expect(screen.queryByRole('button', { name: /Sign in again/ })).toBeNull() + const menu = screen.getByRole('button', { name: 'Claude account options' }) + fireEvent.pointerDown(menu, { button: 0, ctrlKey: false }) + fireEvent.click(await screen.findByRole('menuitem', { name: 'Remove…' })) + const remove = await screen.findByRole('button', { name: 'Remove' }) + expect(handlers.remove).not.toHaveBeenCalled() + fireEvent.click(remove) + await waitFor(() => expect(handlers.remove).toHaveBeenCalledWith('claude')) + }) + it('shows the kill switch as info with no action, and signed out with Sign in', () => { view({ claude: { kind: 'killSwitch' }, codex: NOT_SET_UP }) expect(screen.getByText('Signs in for each cloud workspace')).toBeTruthy() diff --git a/src/renderer/src/components/settings/agent-accounts/OrcaCloudActiveRow.tsx b/src/renderer/src/components/settings/agent-accounts/OrcaCloudActiveRow.tsx index 51e95ce65d7..4a080298d95 100644 --- a/src/renderer/src/components/settings/agent-accounts/OrcaCloudActiveRow.tsx +++ b/src/renderer/src/components/settings/agent-accounts/OrcaCloudActiveRow.tsx @@ -20,6 +20,7 @@ import { productName } from './orca-cloud-accounts-copy' import type { OrcaCloudAccountsActions } from './orca-cloud-accounts-types' +import { RemoveConfirmRow } from './OrcaCloudRemoveRow' export function ActiveRow({ agent, @@ -52,46 +53,11 @@ export function ActiveRow({ } if (confirmRemove) { return ( - - - - - } + actions={actions} + setConfirmRemove={setConfirmRemove} + setRowError={setRowError} /> ) } diff --git a/src/renderer/src/components/settings/agent-accounts/OrcaCloudRemoveRow.tsx b/src/renderer/src/components/settings/agent-accounts/OrcaCloudRemoveRow.tsx new file mode 100644 index 00000000000..0425cb34cbd --- /dev/null +++ b/src/renderer/src/components/settings/agent-accounts/OrcaCloudRemoveRow.tsx @@ -0,0 +1,111 @@ +// Remove… for a saved Orca-account credential: the confirm row (active and expired rows) and the +// expired row's ⋯ menu that opens it (RA-5). +import type React from 'react' +import { useState } from 'react' +import { MoreHorizontal } from 'lucide-react' +import { useTranslate } from '@/i18n/use-translate' +import { Button } from '@/components/ui/button' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger +} from '@/components/ui/dropdown-menu' +import type { + OrcaCloudAccountAgent, + OrcaCloudAgentsErrorCode +} from '../../../../../shared/orca-cloud-agents/orca-cloud-agents-wire' +import { RowShell } from './orca-cloud-account-row-shell' +import { agentName, productName } from './orca-cloud-accounts-copy' +import type { OrcaCloudAccountsActions } from './orca-cloud-accounts-types' + +export function RemoveConfirmRow({ + agent, + actions, + setConfirmRemove, + setRowError +}: { + agent: OrcaCloudAccountAgent + actions: OrcaCloudAccountsActions + setConfirmRemove: (open: boolean) => void + setRowError: (error: OrcaCloudAgentsErrorCode | null) => void +}): React.JSX.Element { + const t = useTranslate() + const [busy, setBusy] = useState(false) + const product = productName(agent, t) + const remove = async (): Promise => { + setBusy(true) + const error = await actions.remove(agent) + setBusy(false) + setRowError(error) + if (!error) { + setConfirmRemove(false) + } + } + return ( + + + + + } + /> + ) +} + +export function RowRemoveMenu({ + agent, + onRemove +}: { + agent: OrcaCloudAccountAgent + onRemove: () => void +}): React.JSX.Element { + const t = useTranslate() + return ( + + + + + + + {t('orcaCloudAccounts.removeEllipsis', 'Remove…')} + + + + ) +} diff --git a/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverview.test.tsx b/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverview.test.tsx new file mode 100644 index 00000000000..f2edf93c614 --- /dev/null +++ b/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverview.test.tsx @@ -0,0 +1,46 @@ +// @vitest-environment happy-dom +import { afterEach, describe, expect, it, vi } from 'vitest' +import { cleanup, fireEvent, render, screen } from '@testing-library/react' +import { AgentAccountsOverview } from './AgentAccountsOverview' +import type { OverviewRow } from './agent-accounts-overview-model' + +const CLOUD: OverviewRow = { + id: 'cloud', + hostId: null, + label: 'Orca Cloud', + kind: 'cloud', + availability: 'available', + cells: { claude: { kind: 'cloudAccount' }, codex: { kind: 'cloudAccount' } }, + attention: false, + action: null +} + +function overview(rows: readonly OverviewRow[]): void { + render( + + ) +} + +describe('AgentAccountsOverview (RA-5)', () => { + afterEach(cleanup) + + it('says nothing needs attention instead of an empty table', () => { + overview([CLOUD]) + fireEvent.click(screen.getByRole('radio', { name: 'Needs attention · 0' })) + expect(screen.getByText('Nothing needs attention.')).toBeTruthy() + expect(screen.queryByRole('table')).toBeNull() + }) + + it('never truncates the Orca Cloud name away: it keeps a minimum width', () => { + overview([CLOUD]) + const name = screen.getByText('Orca Cloud', { selector: 'span' }) + expect(name.className).toContain('min-w-[6rem]') + expect(screen.getByText('all your cloud workspaces').className).toContain('truncate') + }) +}) diff --git a/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverview.tsx b/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverview.tsx index e1fdadf2e00..4824df51f85 100644 --- a/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverview.tsx +++ b/src/renderer/src/components/settings/agent-accounts/overview/AgentAccountsOverview.tsx @@ -26,6 +26,8 @@ export type AgentAccountsOverviewProps = { summary: string onOpenRow: (row: OverviewRow) => void onAction: (row: OverviewRow, action: OverviewAction) => void + /** Fixtures only: the filter the list opens on. */ + initialFilter?: 'all' | 'attention' } function actionLabel(action: OverviewAction, t: Translate): string { @@ -97,15 +99,18 @@ function HostHeader({ row }: { row: OverviewRow }): React.JSX.Element { return ( - {name} - {detail ? {detail} : null} + {/* The name keeps room for "Orca Cloud"; the muted detail gives way first (RA-5). */} + {name} + {detail ? ( + {detail} + ) : null} ) } export function AgentAccountsOverview(props: AgentAccountsOverviewProps): React.JSX.Element { const t = useTranslate() - const [filter, setFilter] = useState<'all' | 'attention'>('all') + const [filter, setFilter] = useState<'all' | 'attention'>(props.initialFilter ?? 'all') const attention = props.rows.filter((row) => row.attention).length const shown = filter === 'attention' ? props.rows.filter((row) => row.attention) : props.rows const onlyLocal = !props.loading && props.rows.every((row) => row.kind === 'local') @@ -153,6 +158,10 @@ export function AgentAccountsOverview(props: AgentAccountsOverviewProps): React. ))} + ) : shown.length === 0 ? ( +

+ {t('agentAccountsOverview.nothingNeedsAttention', 'Nothing needs attention.')} +

) : ( diff --git a/src/renderer/src/components/worktree-creation/cloud-agents-row/VmBuildCloudAgentsRowView.tsx b/src/renderer/src/components/worktree-creation/cloud-agents-row/VmBuildCloudAgentsRowView.tsx index ce11db5c3e4..82f2d478780 100644 --- a/src/renderer/src/components/worktree-creation/cloud-agents-row/VmBuildCloudAgentsRowView.tsx +++ b/src/renderer/src/components/worktree-creation/cloud-agents-row/VmBuildCloudAgentsRowView.tsx @@ -163,7 +163,7 @@ function Trailing({ case 'expired': return ( ) case 'killSwitch': diff --git a/src/renderer/src/components/worktree-creation/cloud-agents-row/build-agents-row-copy.ts b/src/renderer/src/components/worktree-creation/cloud-agents-row/build-agents-row-copy.ts index cff24024bcf..b0c1bc93aa2 100644 --- a/src/renderer/src/components/worktree-creation/cloud-agents-row/build-agents-row-copy.ts +++ b/src/renderer/src/components/worktree-creation/cloud-agents-row/build-agents-row-copy.ts @@ -128,10 +128,7 @@ export function buildAgentsRowText( title: t('vmBuildAgents.expired', 'Your {{agent}} sign-in for Orca Cloud expired', { agent: agentName(model.agent, t) }), - detail: t( - 'vmBuildAgents.expiredDetail', - 'Sign in again once. Every cloud workspace picks it up.' - ) + detail: t('vmBuildAgents.expiredDetail', 'Renew once. Every cloud workspace picks it up.') } case 'killSwitch': return { diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index c8b80b343c3..276021a7f92 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -2802,6 +2802,10 @@ "updateServerUnreachable": "Couldn't reach the update server. Try again in a few minutes." } }, + "vmBuildAgents": { + "expiredDetail": "Sign in again once. Every cloud workspace picks it up.", + "signInAgain": "Sign in again" + }, "workspace": { "links": { "linkedCount_one": "{{count}} linked", diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 4c14c29ad7e..4f7fecce3e3 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -27868,7 +27868,9 @@ "copyAndOpen": "Copy code and open", "unavailable": "Signs in for each cloud workspace", "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." + "allUnavailable": "Claude and Codex sign in for each cloud workspace for now.", + "pasteTokenInstead": "Paste a token instead", + "rowMenu": "{{agent}} account options" }, "vmBuildAgents": { "menu": { @@ -27962,7 +27964,8 @@ "cloudNotSetUp": "Not set up", "cloudPaused": "Each workspace signs in (temporarily)", "apiKeyOverrides": "API key overrides sign-in" - } + }, + "nothingNeedsAttention": "Nothing needs attention." }, "agentSignInStrip": { "sandbox": "the sandbox", From 4fcfd84e81698b9c36b03aa15db8c22e75a3305a Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 17:18:20 -0800 Subject: [PATCH 2/3] fix(cloud): RA-5 lint and catalog fixes (link button, new expired-detail key, retired keys removed) --- .../settings/agent-accounts/OrcaCloudAccountRow.tsx | 8 +------- .../cloud-agents-row/build-agents-row-copy.ts | 5 ++++- src/renderer/src/i18n/en-runtime-required.json | 4 ---- src/renderer/src/i18n/locales/en.json | 5 ++--- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx index de8a74e13d6..56b88eef758 100644 --- a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx +++ b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx @@ -65,13 +65,7 @@ export function AccountRow({ > {/* The paste path stays reachable without waiting for the browser (RA-5). */} {agent === 'claude' ? ( - ) : null} diff --git a/src/renderer/src/components/worktree-creation/cloud-agents-row/build-agents-row-copy.ts b/src/renderer/src/components/worktree-creation/cloud-agents-row/build-agents-row-copy.ts index b0c1bc93aa2..5297ae80e98 100644 --- a/src/renderer/src/components/worktree-creation/cloud-agents-row/build-agents-row-copy.ts +++ b/src/renderer/src/components/worktree-creation/cloud-agents-row/build-agents-row-copy.ts @@ -128,7 +128,10 @@ export function buildAgentsRowText( title: t('vmBuildAgents.expired', 'Your {{agent}} sign-in for Orca Cloud expired', { agent: agentName(model.agent, t) }), - detail: t('vmBuildAgents.expiredDetail', 'Renew once. Every cloud workspace picks it up.') + detail: t( + 'vmBuildAgents.expiredDetailRenew', + 'Renew once. Every cloud workspace picks it up.' + ) } case 'killSwitch': return { diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index 276021a7f92..c8b80b343c3 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -2802,10 +2802,6 @@ "updateServerUnreachable": "Couldn't reach the update server. Try again in a few minutes." } }, - "vmBuildAgents": { - "expiredDetail": "Sign in again once. Every cloud workspace picks it up.", - "signInAgain": "Sign in again" - }, "workspace": { "links": { "linkedCount_one": "{{count}} linked", diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 4f7fecce3e3..86d3932e883 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -27893,7 +27893,6 @@ "pasteToken": "Paste token", "tryAgain": "Try again", "dismiss": "Dismiss", - "signInAgain": "Sign in again", "signInHere": "Sign in for this workspace", "checking": "Checking agent sign-in", "readyDetail": "Every cloud workspace uses it. Nothing to do here.", @@ -27917,7 +27916,6 @@ "offerDetail": "Sign in to {{agents}} once. Every cloud workspace uses it.", "stillOpens": "The workspace still opens.", "expired": "Your {{agent}} sign-in for Orca Cloud expired", - "expiredDetail": "Sign in again once. Every cloud workspace picks it up.", "agentSignIn": "{{agent}} sign-in", "paused": "Orca account sign-in is paused", "pausedDetail": "This sign-in stays with this workspace.", @@ -27925,7 +27923,8 @@ "errorDetail": "The workspace still opens. Agents can sign in later.", "groupAccount": "{{agents}} from your Orca account", "groupKey": "{{agents}} with {{key}}", - "notOffered": "Signs in for each cloud workspace for now" + "notOffered": "Signs in for each cloud workspace for now", + "expiredDetailRenew": "Renew once. Every cloud workspace picks it up." }, "agentAccountsOverview": { "action": { From 3dc4899821610b474aabcbba2d0559e87474e9cb Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 17:24:14 -0800 Subject: [PATCH 3/3] fix(cloud): RA-5 Paste a token instead as a muted link (link-muted button variant) --- .../settings/agent-accounts/OrcaCloudAccountRow.tsx | 8 +++++++- src/renderer/src/components/ui/button.tsx | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx index 56b88eef758..7d7de566c6c 100644 --- a/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx +++ b/src/renderer/src/components/settings/agent-accounts/OrcaCloudAccountRow.tsx @@ -65,7 +65,13 @@ export function AccountRow({ > {/* The paste path stays reachable without waiting for the browser (RA-5). */} {agent === 'claude' ? ( - ) : null} diff --git a/src/renderer/src/components/ui/button.tsx b/src/renderer/src/components/ui/button.tsx index 1485c0ed778..dcd3bc1b29f 100644 --- a/src/renderer/src/components/ui/button.tsx +++ b/src/renderer/src/components/ui/button.tsx @@ -36,6 +36,9 @@ const buttonVariants = cva( quiet: 'text-muted-foreground hover:bg-accent hover:text-foreground dark:hover:bg-accent/50', link: 'text-primary underline-offset-4 hover:underline focus-visible:underline', + // A secondary escape hatch under a row's detail (e.g. "Paste a token instead"): muted, link-styled. + 'link-muted': + 'text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:underline', 'menu-launch': 'min-w-0 flex-1 justify-start rounded-l-[7px] rounded-r-none text-foreground', 'menu-segment': 'rounded-l-none border-l border-border',