From 36aef5fe87fec21ffd4cf3c4a0ca91a6d2c0a2ac Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 10 Nov 2026 07:03:14 -0800 Subject: [PATCH] =?UTF-8?q?fix(agent-api-keys):=20design-squad=20copy=20fo?= =?UTF-8?q?r=20A5=20(older=20copy,=20one-line=20account=20failure,=20this?= =?UTF-8?q?=20computer,=20=E2=86=92=20paths)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent-api-keys/AgentApiKeyCloudLine.tsx | 81 +++++++++++-------- .../AgentApiKeysImportPanel.tsx | 12 +-- .../AgentApiKeysPane.fixture.tsx | 18 +++-- .../agent-api-keys/AgentApiKeysPane.tsx | 12 ++- .../agent-api-keys-import.test.ts | 7 +- .../agent-api-keys/agent-api-keys-import.ts | 5 -- src/renderer/src/i18n/locales/en.json | 26 +++--- 7 files changed, 81 insertions(+), 80 deletions(-) diff --git a/src/renderer/src/components/settings/agent-api-keys/AgentApiKeyCloudLine.tsx b/src/renderer/src/components/settings/agent-api-keys/AgentApiKeyCloudLine.tsx index 39681e6bcaf..343b4907bd3 100644 --- a/src/renderer/src/components/settings/agent-api-keys/AgentApiKeyCloudLine.tsx +++ b/src/renderer/src/components/settings/agent-api-keys/AgentApiKeyCloudLine.tsx @@ -35,8 +35,35 @@ export function AgentApiKeyCloudLine({ await onSaveToAccount() setSaving(false) } + // A failed account write replaces the status line: one line says what happened and offers retry. + if (failure && canSave && (state === 'local' || state === 'stale')) { + const transport = failure === 'unavailable' || failure === 'timeout' || failure === 'unknown' + return ( +
+ void save()} + /> +
+ ) + } return ( -
+
{state === 'synced' ? ( <> @@ -59,8 +86,8 @@ export function AgentApiKeyCloudLine({ ) : state === 'stale' ? t( - 'agentApiKeys.cloud.stale', - 'Your Orca account has an earlier copy · cloud workspaces still use it' + 'agentApiKeys.cloud.staleCopy', + 'Your Orca account has an older copy. Cloud workspaces still use it.' ) : t('agentApiKeys.cloud.local', 'Only on this computer')} @@ -72,37 +99,26 @@ export function AgentApiKeyCloudLine({ className="shrink-0 aria-disabled:pointer-events-none" aria-disabled={saving || undefined} aria-busy={saving || undefined} - aria-label={t( - 'agentApiKeys.cloud.saveLabel', - 'Save {{name}} to your Orca account', - { - name: envName - } - )} + aria-label={ + state === 'stale' + ? t('agentApiKeys.cloud.updateLabel', 'Update {{name}} in your Orca account', { + name: envName + }) + : t('agentApiKeys.cloud.saveLabel', 'Save {{name}} to your Orca account', { + name: envName + }) + } onClick={() => void save()} > {saving ? : null} - {t('agentApiKeys.cloud.save', 'Save to your Orca account')} + {state === 'stale' + ? t('agentApiKeys.cloud.update', 'Update your Orca account') + : t('agentApiKeys.cloud.save', 'Save to your Orca account')} ) : null} )}
- {failure && (state === 'local' || state === 'stale') ? ( - - ) : null}
) } @@ -134,7 +150,7 @@ export function AgentApiKeyRemoveFromAccountConfirm({

) : null} {otherAgents.length > 0 ? ( diff --git a/src/renderer/src/components/settings/agent-api-keys/agent-api-keys-import.test.ts b/src/renderer/src/components/settings/agent-api-keys/agent-api-keys-import.test.ts index 754ac8bf5a5..25558a1a13a 100644 --- a/src/renderer/src/components/settings/agent-api-keys/agent-api-keys-import.test.ts +++ b/src/renderer/src/components/settings/agent-api-keys/agent-api-keys-import.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { defaultImportSelection, isMacPlatform, signInProviderLabel } from './agent-api-keys-import' +import { defaultImportSelection, signInProviderLabel } from './agent-api-keys-import' describe('agent API key import helpers', () => { it('checks every found key the vault does not already hold', () => { @@ -26,11 +26,6 @@ describe('agent API key import helpers', () => { ).toEqual(['OPENAI_API_KEY']) }) - it('says "this Mac" only on macOS', () => { - expect(isMacPlatform('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)')).toBe(true) - expect(isMacPlatform('Mozilla/5.0 (Windows NT 10.0; Win64; x64)')).toBe(false) - }) - it('labels known sign-in providers', () => { expect(signInProviderLabel({ agent: 'opencode', provider: 'github-copilot' })).toBe( 'GitHub Copilot' diff --git a/src/renderer/src/components/settings/agent-api-keys/agent-api-keys-import.ts b/src/renderer/src/components/settings/agent-api-keys/agent-api-keys-import.ts index 28a3662f6a5..29c34f57950 100644 --- a/src/renderer/src/components/settings/agent-api-keys/agent-api-keys-import.ts +++ b/src/renderer/src/components/settings/agent-api-keys/agent-api-keys-import.ts @@ -16,11 +16,6 @@ export function defaultImportSelection(scan: AgentApiKeysScanResult): string[] { return scan.keys.filter((key) => !key.alreadySaved).map((key) => key.name) } -/** "this Mac" on macOS, "this computer" elsewhere. */ -export function isMacPlatform(userAgent: string = globalThis.navigator?.userAgent ?? ''): boolean { - return /Mac/i.test(userAgent) -} - export function importSourceLabel(source: LocalAgentKeySource, t: Translate): string { switch (source) { case 'opencode-auth': diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 52dfbdfc829..7ed2f196020 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -14288,7 +14288,6 @@ "confirmRemove": "Remove key", "edit": "Edit key", "remove": "Remove key", - "promise": "Keys are sealed in your OS keychain. When an agent starts, here, on an SSH host or on a paired machine, Orca passes it the key for that run only and never writes it to that machine.", "unavailableTitle": "Orca won't store API keys on this computer", "noKey": "No key. The agent uses its own sign-in.", "addKey": "Add key", @@ -27390,44 +27389,45 @@ "local": "Only on this computer", "saveLabel": "Save {{name}} to your Orca account", "save": "Save to your Orca account", - "saveFailed": "Saved on this computer, but not in your Orca account.", - "stale": "Your Orca account has an earlier copy · cloud workspaces still use it", - "saveFailedRetry": "Couldn’t reach Orca Cloud. Try again." + "updateFailed": "Saved on this computer. Couldn’t update your Orca account, so cloud workspaces still use the older copy.", + "saveFailedLocal": "Saved on this computer. Couldn’t save it to your Orca account.", + "retry": "Try again", + "staleCopy": "Your Orca account has an older copy. Cloud workspaces still use it.", + "updateLabel": "Update {{name}} in your Orca account", + "update": "Update your Orca account" }, "remove": { "confirmLabel": "Remove {{name}}", "fromAccountQuestion": "Also remove it from your Orca account? Cloud workspaces will stop using it.", "thisComputerOnly": "Remove from this computer only", "both": "Remove from both", - "kept": "Removed from this computer. {{name}} is still in your Orca account.", - "keptDetail": "Manage it in Settings › Cloud secrets." + "cancel": "Cancel", + "stillInAccount": "Still in your Orca account. Manage it in Settings → Orca Cloud → Cloud secrets." }, "import": { - "title": "Keys found on {{place}}", + "title": "Keys found on this computer", "detailSignedIn": "Orca shows names only. Imported keys are sealed on this computer, used on every host, and saved in your Orca account.", "detailSignedOut": "Orca shows names only. Imported keys are sealed on this computer and used on every host.", "scanning": "Looking for keys…", - "scanFailed": "Couldn’t look for keys on {{place}}.", + "scanFailed": "Couldn’t look for keys on this computer.", "retry": "Try again", "empty": "No agent API keys found in your shell environment, OpenCode or ~/.gemini/.env.", "alreadySaved": "Already saved for {{agent}}", - "signIn": "{{agent}} is signed in with {{provider}}. Sign in once in Settings › Agent accounts.", + "signIn": "{{agent}} is signed in with {{provider}}. Sign in once in Settings → Agent accounts.", "failed": "Couldn’t import. Nothing was changed.", "cancel": "Cancel", "submitOne": "Import 1 key", "submit": "Import {{count}} keys", - "thisMac": "this Mac", - "thisComputer": "this computer", "doneOne": "Imported 1 key.", "done": "Imported {{count}} keys.", "cloudFailed": "{{name}} is saved on this computer, but not in your Orca account.", - "open": "Import from this Mac", "openComputer": "Import from this computer", "source": { "opencode": "OpenCode sign-in file", "geminiEnv": "~/.gemini/.env", "shell": "Shell environment" } - } + }, + "promiseAccount": "Keys are sealed on this computer. When you’re signed in to Orca, they’re also saved in your Orca account for cloud workspaces. On SSH hosts and paired machines, Orca passes a key for that run only and never writes it there." } }