diff --git a/apps/desktop/README.md b/apps/desktop/README.md index ea7e867477e..f6c2caafc8f 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -245,8 +245,8 @@ Terminal control), which the helper refuses. With **Ask before using a new app** on, each app's first use is approved for the task or persistently, and persistent approvals are listed in Settings and can be revoked. Sign-out and deployment changes clear opt-in, the ask choice -and approvals. The conversation shows the -active app/action and a Stop button; **⌘⇧Esc** also stops active work when the shortcut is available. +and approvals. Stopping the chat response, or **⌘⇧Esc** when the shortcut is available, stops active +work; Settings shows the action in progress. Stop cancels queued actions, in-flight authorization, approval prompts and the native helper. Already completed input cannot be undone. diff --git a/apps/docs/content/docs/desktop/index.mdx b/apps/docs/content/docs/desktop/index.mdx index 5fe39e511b7..b7e088961a5 100644 --- a/apps/docs/content/docs/desktop/index.mdx +++ b/apps/docs/content/docs/desktop/index.mdx @@ -102,7 +102,7 @@ Sim can then use any app except terminals and scripting apps (Script Editor, Aut Sim can read app windows and interact through clicks, text, keyboard shortcuts, scrolling, and supported accessibility controls. Screenshots and returned app content can be sent to your Sim deployment and model. Some actions require bringing the app to the foreground; app compatibility and macOS permissions can still limit what succeeds. -The conversation shows the active app and action. Select **Stop**, or press **Cmd + Shift + Escape** when that shortcut is available, to cancel active and queued computer actions. Stopping cannot undo input already delivered to an app. Verify the app's current state before repeating an interrupted action. +Stop the chat response, or press **Cmd + Shift + Escape** when that shortcut is available, to cancel active and queued computer actions. **Settings → Desktop → Computer Use** shows the action in progress. Stopping cannot undo input already delivered to an app. Verify the app's current state before repeating an interrupted action. With **Ask before using a new app** on, use **Revoke** under **Approved apps** to remove a saved approval. Signing out or changing deployments clears the device opt-in and app approvals. Computer Use never operates Sim, macOS System Settings, password managers, terminals, or scripting apps. diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx index 4c852be0c0f..2eca1fc5feb 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx @@ -26,7 +26,6 @@ import { AssistantActionReviewMessage, useHasAssistantActionReview, } from '@/components/assistant-actions' -import { ComputerUseActivity } from '@/components/computer-use/activity' import { SMOOTH_CHASE_RATE } from '@/lib/core/utils/smooth-bottom-chase' import type { TurnOrigin } from '@/lib/mothership/generated/protocol' import { inter } from '@/app/_styles/fonts/inter/inter' @@ -1039,7 +1038,6 @@ export function MothershipChat({ onAnimationEnd={animateInput ? onInputAnimationEnd : undefined} >
- libDesktopMock) -const native = vi.hoisted(() => ({ - getActivity: vi.fn<() => Promise>(), - onActivity: vi.fn<(listener: (activity: ComputerUseActivity | null) => void) => () => void>(), - cancel: vi.fn<() => Promise>(), -})) let root: Root let container: HTMLDivElement let client: QueryClient @@ -36,10 +30,7 @@ beforeEach(() => { useMothershipEffortStore.getState().reset() useMothershipPlanEffortStore.getState().reset() client = new QueryClient({ defaultOptions: { queries: { retry: false } } }) - libDesktopMockFns.mockGetDesktopBridge.mockReturnValue({ computerUse: native }) - native.getActivity.mockResolvedValue(null) - native.onActivity.mockReturnValue(() => {}) - native.cancel.mockResolvedValue(undefined) + libDesktopMockFns.mockGetDesktopBridge.mockReturnValue(undefined) container = document.createElement('div') document.body.append(container) root = createRoot(container) @@ -108,30 +99,3 @@ it('hides the Plan model picker while its rollout is off but preserves the reque fastMode: false, }) }) -it.each([undefined, 'workspace'])( - 'chat %s exposes active native action and Stop while rollout is off', - async (workspaceId) => { - await render(false, workspaceId) - const listener = native.onActivity.mock.calls[0]?.[0] - expect(listener).toBeDefined() - if (!listener) throw new Error('Chat did not subscribe to native activity') - await act(async () => - listener({ - toolCallId: 'action', - scopeId: 'chat', - appName: 'Synthetic app', - action: 'type_text', - startedAt: 1, - stopShortcutAvailable: true, - }) - ) - const status = container.querySelector('[role="status"]') - expect(status?.textContent).toContain('Synthetic app · Typing') - const stop = status?.querySelector('button') - expect(stop?.getAttribute('aria-keyshortcuts')).toBe('Meta+Shift+Escape') - await act(async () => stop?.click()) - expect(native.cancel).toHaveBeenCalledOnce() - await act(async () => listener(null)) - expect(container.querySelector('[role="status"]')).toBeNull() - } -)