From 78393d13663edf72162079929510204b2fb843d9 Mon Sep 17 00:00:00 2001
From: Neil
Date: Mon, 16 Nov 2026 01:33:42 -0800
Subject: [PATCH] feat(cloud): TEAM-SHARING-HOLD no mention of sharing in local
commands while it's held
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Same cloudTeamSharing capability as #825 (absent = off):
- Settings › Local commands: rows no longer say "Shared with your team" / "Off · Shared with your
team", and turning one on doesn't ask the shared-workspace question.
- The local command approval dialog drops "Teammates share this workspace…".
The control plane's own `shared_needs_confirmation` refusal still asks (a safety check, and with
sharing held the server reports no workspace as shared).
---
.../LocalCommandApprovalDialog.tsx | 5 +-
.../local-command-sharing-hold.test.tsx | 67 +++++++++++++++++++
.../orca-cloud/OrcaCloudLocalCommandsPane.tsx | 20 ++++--
3 files changed, 87 insertions(+), 5 deletions(-)
create mode 100644 src/renderer/src/components/local-commands/local-command-sharing-hold.test.tsx
diff --git a/src/renderer/src/components/local-commands/LocalCommandApprovalDialog.tsx b/src/renderer/src/components/local-commands/LocalCommandApprovalDialog.tsx
index 93718c828fa..26523be47aa 100644
--- a/src/renderer/src/components/local-commands/LocalCommandApprovalDialog.tsx
+++ b/src/renderer/src/components/local-commands/LocalCommandApprovalDialog.tsx
@@ -1,4 +1,5 @@
import { useCallback, useEffect, useRef, useState } from 'react'
+import { useCloudTeamSharingEnabled } from '@/lib/orca-cloud/cloud-team-sharing-flag'
import { TriangleAlert } from 'lucide-react'
import { toast } from 'sonner'
import { Button } from '@/components/ui/button'
@@ -54,6 +55,7 @@ export function LocalCommandApprovalDialogView({
/** Denies this request and turns local commands off for the workspace. */
onTurnOff: () => void
}): React.JSX.Element {
+ const teamSharing = useCloudTeamSharingEnabled()
const t = useTranslate()
// A long command must be scrolled to its end before it can be allowed: nothing stays out of view.
const [readToEnd, setReadToEnd] = useState(false)
@@ -164,7 +166,8 @@ export function LocalCommandApprovalDialogView({
)}
) : null}
- {prompt.shared ? (
+ {/* TEAM-SHARING-HOLD: no teammates can message while sharing is held. */}
+ {prompt.shared && teamSharing ? (
{t(
'localCommands.prompt.shared',
diff --git a/src/renderer/src/components/local-commands/local-command-sharing-hold.test.tsx b/src/renderer/src/components/local-commands/local-command-sharing-hold.test.tsx
new file mode 100644
index 00000000000..0c9e3ce2426
--- /dev/null
+++ b/src/renderer/src/components/local-commands/local-command-sharing-hold.test.tsx
@@ -0,0 +1,67 @@
+// @vitest-environment happy-dom
+// TEAM-SHARING-HOLD: the approval dialog says nothing about teammates while team sharing is held.
+import { act } from 'react'
+import { createRoot, type Root } from 'react-dom/client'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+const teamSharing = vi.hoisted(() => ({ on: false }))
+vi.mock('@/lib/orca-cloud/cloud-team-sharing-flag', () => ({
+ cloudTeamSharingEnabled: () => teamSharing.on,
+ useCloudTeamSharingEnabled: () => teamSharing.on
+}))
+
+import { Dialog } from '@/components/ui/dialog'
+import { TooltipProvider } from '@/components/ui/tooltip'
+import { LocalCommandApprovalDialogView } from './LocalCommandApprovalDialog'
+
+globalThis.IS_REACT_ACT_ENVIRONMENT = true
+let root: Root | null = null
+afterEach(async () => {
+ await act(async () => root?.unmount())
+ root = null
+ document.body.innerHTML = ''
+})
+
+async function show(): Promise {
+ const container = document.createElement('div')
+ document.body.appendChild(container)
+ root = createRoot(container)
+ const prompt = {
+ requestId: 'r1',
+ workspace: 'web',
+ command: 'ls -la',
+ cwd: '/tmp',
+ shared: true,
+ timeoutSeconds: 120
+ }
+ await act(async () =>
+ root!.render(
+
+
+
+ )
+ )
+ return document.body.textContent ?? ''
+}
+
+describe('the teammates note on a local command request', () => {
+ it('held: no mention of teammates', async () => {
+ teamSharing.on = false
+ expect(await show()).not.toContain('Teammates share this workspace')
+ })
+
+ it('sharing on: says a teammate may have led to it', async () => {
+ teamSharing.on = true
+ expect(await show()).toContain('Teammates share this workspace')
+ })
+})
diff --git a/src/renderer/src/components/settings/orca-cloud/OrcaCloudLocalCommandsPane.tsx b/src/renderer/src/components/settings/orca-cloud/OrcaCloudLocalCommandsPane.tsx
index 71ab6b3af93..9ecda1bdcbd 100644
--- a/src/renderer/src/components/settings/orca-cloud/OrcaCloudLocalCommandsPane.tsx
+++ b/src/renderer/src/components/settings/orca-cloud/OrcaCloudLocalCommandsPane.tsx
@@ -1,4 +1,5 @@
import { useCallback, useEffect, useState } from 'react'
+import { cloudTeamSharingEnabled } from '@/lib/orca-cloud/cloud-team-sharing-flag'
import { SquareTerminal } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { InlineError } from '@/components/ui/inline-error'
@@ -20,16 +21,22 @@ import { LocalCommandText } from '../../local-commands/LocalCommandText'
const AUDIT_ROWS = 20
-function workspaceDetail(row: LocalCommandWorkspaceRow, t: Translate): string {
+function workspaceDetail(
+ row: LocalCommandWorkspaceRow,
+ t: Translate,
+ teamSharing = cloudTeamSharingEnabled()
+): string {
+ // TEAM-SHARING-HOLD: no mention of sharing while team sharing is held.
+ const shared = teamSharing && row.shared
if (row.isOwner === false) {
return t('localCommands.settings.notOwner', 'Only the workspace owner can turn this on.')
}
if (!row.enabled) {
- return row.shared
+ return shared
? t('localCommands.settings.offShared', 'Off · Shared with your team')
: t('localCommands.settings.off', 'Off')
}
- const sharing = row.shared
+ const sharing = shared
? ` · ${t('localCommands.settings.sharedOn', 'Shared with your team')}`
: ''
return row.connected
@@ -318,7 +325,12 @@ export function OrcaCloudLocalCommandsPane(): React.JSX.Element {
surface: 'security',
initialFocus: 'cancel'
})
- if (enabling && row.shared && !(allowShared = await confirmShared())) {
+ if (
+ enabling &&
+ row.shared &&
+ cloudTeamSharingEnabled() &&
+ !(allowShared = await confirmShared())
+ ) {
return
}
setPendingSandboxId(row.sandboxId)