From 03e215f687191bc46aa6863ccaa092b2963ce156 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Thu, 9 Jul 2026 01:04:29 -0700 Subject: [PATCH] Gate the optional account sign-in UI to dev builds The account switcher stays hidden in packaged builds while the feature is in progress. Dev builds still show it when the client env vars are set, and a dev-only Settings > Dev Tools > Orca Cloud section mirrors it. Co-authored-by: Orca --- .../orca-profiles/OrcaProfileSwitcher.tsx | 9 ++ .../src/components/settings/DevToolsPane.tsx | 128 +++++++++++++++--- src/renderer/src/i18n/locales/en.json | 9 +- src/renderer/src/i18n/locales/es.json | 9 +- src/renderer/src/i18n/locales/ja.json | 9 +- src/renderer/src/i18n/locales/ko.json | 9 +- src/renderer/src/i18n/locales/zh.json | 9 +- 7 files changed, 155 insertions(+), 27 deletions(-) diff --git a/src/renderer/src/components/orca-profiles/OrcaProfileSwitcher.tsx b/src/renderer/src/components/orca-profiles/OrcaProfileSwitcher.tsx index 9c18a0f5704..f8a98da9d0a 100644 --- a/src/renderer/src/components/orca-profiles/OrcaProfileSwitcher.tsx +++ b/src/renderer/src/components/orca-profiles/OrcaProfileSwitcher.tsx @@ -86,6 +86,15 @@ export function OrcaProfileSwitcher({ } }, [fetchProfiles, loading, profiles.length]) + // Why: the Orca Cloud account UX isn't ready for production users yet, so the + // trigger stays hidden in packaged builds. Dev builds still show it when + // cloud auth is configured, and a dev-only Settings > Dev Tools > Orca Cloud + // section mirrors it. import.meta.env.PROD is true only in packaged builds + // (false in dev and under vitest), so tests still exercise the render path. + if (import.meta.env.PROD) { + return null + } + // Why: paired web/mobile clients only see the desktop stub's fabricated // profile list; showing a switcher there would misreport the active profile // and none of its actions can work remotely. diff --git a/src/renderer/src/components/settings/DevToolsPane.tsx b/src/renderer/src/components/settings/DevToolsPane.tsx index f22b5823e00..e1779e9aead 100644 --- a/src/renderer/src/components/settings/DevToolsPane.tsx +++ b/src/renderer/src/components/settings/DevToolsPane.tsx @@ -6,6 +6,7 @@ import { SettingsSubsectionHeader } from './SettingsFormControls' import { showDeleteWorktreeFailureToast } from '../sidebar/delete-worktree-failure-toast' import { showLocalBaseRefUpdateSuggestionToast } from '../sidebar/local-base-ref-suggestion-toast' import { translate } from '@/i18n/i18n' +import { useAppStore } from '@/store' import type { AppState } from '@/store/types' const LONG_WORKSPACE_NAME = 'feature/dev-toast-layout-with-a-long-workspace-name' @@ -124,6 +125,85 @@ function showDeleteFailureToast(): void { }) } +// Dev-only preview of the first-party Orca Cloud sign-in. The sidebar/titlebar +// account switcher is hidden in packaged builds while the feature is in +// progress; this surfaces it (and its status) in dev when the env vars are set. +function OrcaCloudDevSubsection(): React.JSX.Element { + const authStatus = useAppStore((s) => s.orcaProfileAuthStatus) + const connecting = useAppStore((s) => s.orcaProfileConnecting) + const connect = useAppStore((s) => s.connectCurrentOrcaProfile) + const signOut = useAppStore((s) => s.signOutCurrentOrcaProfile) + const refresh = useAppStore((s) => s.fetchOrcaProfileAuthStatus) + const configured = authStatus?.configured === true + const connected = authStatus?.state === 'connected' + + return ( +
+
+
+ + {configured ? ( +
+

+ {translate('auto.components.settings.DevToolsPane.orcaCloudStatus', 'Status')}:{' '} + {authStatus?.state} +

+
+ {connected ? ( + + ) : ( + + )} + +
+
+ ) : ( +

+ {authStatus?.setupMessage ?? + translate( + 'auto.components.settings.DevToolsPane.orcaCloudNotConfigured', + 'Set ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID to preview Orca Cloud sign-in in this dev build.' + )} +

+ )} +
+ ) +} + export function DevToolsPane(): React.JSX.Element { const actions: DevToastAction[] = [ { @@ -221,28 +301,32 @@ export function DevToolsPane(): React.JSX.Element { ] return ( -
-
- - - {translate('auto.components.settings.DevToolsPane.devOnly', 'Dev only')} - -
+
+
+
+ + + {translate('auto.components.settings.DevToolsPane.devOnly', 'Dev only')} + +
-
- {actions.map((action) => ( - - ))} -
-
+
+ {actions.map((action) => ( + + ))} +
+
+ + + ) } diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 0459763855b..47f7929ce70 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -8676,7 +8676,14 @@ "behindBaseRefToastDescription": "Persistent prompt with an inline Settings link and footer action.", "notificationPlayground": "Notification playground", "notificationPlaygroundDescription": "Dev-only triggers for checking toast layout, recovery actions, and long-copy wrapping.", - "devOnly": "Dev only" + "devOnly": "Dev only", + "orcaCloud": "Orca Cloud", + "orcaCloudDescription": "Dev-only preview of first-party cloud sign-in. Hidden in production; in dev it also appears in the sidebar account switcher once ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID are set.", + "orcaCloudStatus": "Status", + "orcaCloudSignOut": "Sign out", + "orcaCloudConnect": "Connect profile", + "orcaCloudRefresh": "Refresh status", + "orcaCloudNotConfigured": "Set ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID to preview Orca Cloud sign-in in this dev build." }, "EphemeralVmRecipeRow": { "useInWorkspace": "Use in workspace" diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 1296a641f86..ca710d9af01 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -8676,7 +8676,14 @@ "behindBaseRefToastDescription": "Persistent prompt with an inline Settings link and footer action.", "notificationPlayground": "Notification playground", "notificationPlaygroundDescription": "Dev-only triggers for checking toast layout, recovery actions, and long-copy wrapping.", - "devOnly": "Dev only" + "devOnly": "Dev only", + "orcaCloud": "Orca Cloud", + "orcaCloudDescription": "Dev-only preview of first-party cloud sign-in. Hidden in production; in dev it also appears in the sidebar account switcher once ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID are set.", + "orcaCloudStatus": "Status", + "orcaCloudSignOut": "Sign out", + "orcaCloudConnect": "Connect profile", + "orcaCloudRefresh": "Refresh status", + "orcaCloudNotConfigured": "Set ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID to preview Orca Cloud sign-in in this dev build." }, "EphemeralVmRecipeRow": { "useInWorkspace": "Usar en el espacio de trabajo" diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 5ed1cdea937..87081edc7db 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -8676,7 +8676,14 @@ "behindBaseRefToastDescription": "インラインの設定リンクとフッターアクション付きの永続プロンプト。", "notificationPlayground": "Notification playground", "notificationPlaygroundDescription": "Dev-only triggers for checking toast layout, recovery actions, and long-copy wrapping.", - "devOnly": "Dev only" + "devOnly": "Dev only", + "orcaCloud": "Orca Cloud", + "orcaCloudDescription": "Dev-only preview of first-party cloud sign-in. Hidden in production; in dev it also appears in the sidebar account switcher once ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID are set.", + "orcaCloudStatus": "Status", + "orcaCloudSignOut": "Sign out", + "orcaCloudConnect": "Connect profile", + "orcaCloudRefresh": "Refresh status", + "orcaCloudNotConfigured": "Set ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID to preview Orca Cloud sign-in in this dev build." }, "EphemeralVmRecipeRow": { "useInWorkspace": "ワークスペースでの使用" diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index b50ac3b1358..9643e45c5f3 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -8676,7 +8676,14 @@ "behindBaseRefToastDescription": "인라인 설정 링크와 바닥글 작업이 있는 영구 프롬프트입니다.", "notificationPlayground": "Notification playground", "notificationPlaygroundDescription": "Dev-only triggers for checking toast layout, recovery actions, and long-copy wrapping.", - "devOnly": "Dev only" + "devOnly": "Dev only", + "orcaCloud": "Orca Cloud", + "orcaCloudDescription": "Dev-only preview of first-party cloud sign-in. Hidden in production; in dev it also appears in the sidebar account switcher once ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID are set.", + "orcaCloudStatus": "Status", + "orcaCloudSignOut": "Sign out", + "orcaCloudConnect": "Connect profile", + "orcaCloudRefresh": "Refresh status", + "orcaCloudNotConfigured": "Set ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID to preview Orca Cloud sign-in in this dev build." }, "EphemeralVmRecipeRow": { "useInWorkspace": "워크스페이스에서 사용" diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index ffa65b5ee94..b3d103d9146 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -8676,7 +8676,14 @@ "behindBaseRefToastDescription": "带有内联设置链接和底部操作按钮的持久提示。", "notificationPlayground": "通知测试面板", "notificationPlaygroundDescription": "用于检查提示布局、恢复操作和长文案换行的开发触发器。", - "devOnly": "仅开发" + "devOnly": "仅开发", + "orcaCloud": "Orca Cloud", + "orcaCloudDescription": "Dev-only preview of first-party cloud sign-in. Hidden in production; in dev it also appears in the sidebar account switcher once ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID are set.", + "orcaCloudStatus": "Status", + "orcaCloudSignOut": "Sign out", + "orcaCloudConnect": "Connect profile", + "orcaCloudRefresh": "Refresh status", + "orcaCloudNotConfigured": "Set ORCA_CLOUD_API_URL and ORCA_CLOUD_CLIENT_ID to preview Orca Cloud sign-in in this dev build." }, "EphemeralVmRecipeRow": { "useInWorkspace": "在工作区中使用"