diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.crew-pane.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.crew-pane.test.tsx index 65851b4ede5..5a72453c362 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.crew-pane.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.crew-pane.test.tsx @@ -10,6 +10,12 @@ import { testOrcaSessionId } from '../../../../shared/orca-session-address-test- import { getDefaultSettings } from '../../../../shared/constants' import { useAppStore } from '@/store' +// Keep the dormant panel's interaction coverage independent of its release availability. +vi.mock('../orchestration-crew/use-orchestration-panel-enabled', () => ({ + useOrchestrationPanelEnabled: () => + useAppStore((state) => state.settings?.experimentalOrchestrationPanel === true) +})) + const { mocks, moduleFactories, resetStructuredSessionMocks } = await vi.hoisted(async () => (await import('./NativeChatStructuredSession.test-harness')).createStructuredSessionMocks() ) diff --git a/src/renderer/src/components/orchestration-crew/TerminalCrewPortals.test.tsx b/src/renderer/src/components/orchestration-crew/TerminalCrewPortals.test.tsx index 9e99961c123..c00d80967ca 100644 --- a/src/renderer/src/components/orchestration-crew/TerminalCrewPortals.test.tsx +++ b/src/renderer/src/components/orchestration-crew/TerminalCrewPortals.test.tsx @@ -17,6 +17,11 @@ import { TerminalCrewPortals } from './TerminalCrewPortals' import { holdPhysicalCloseTasks } from './crew-menu.test-fixture' const rig = vi.hoisted(() => ({ open: vi.fn(), copy: vi.fn(), identity: vi.fn(), crew: vi.fn() })) +// Keep the dormant panel's interaction coverage independent of its release availability. +vi.mock('./use-orchestration-panel-enabled', () => ({ + useOrchestrationPanelEnabled: () => + useAppStore((state) => state.settings?.experimentalOrchestrationPanel === true) +})) vi.mock('./use-terminal-crew-identity', () => ({ useTerminalCrewIdentity: (paneKey: string) => { rig.identity(paneKey) diff --git a/src/renderer/src/components/orchestration-crew/orchestration-panel-suspended.test.tsx b/src/renderer/src/components/orchestration-crew/orchestration-panel-suspended.test.tsx new file mode 100644 index 00000000000..e4056dc646a --- /dev/null +++ b/src/renderer/src/components/orchestration-crew/orchestration-panel-suspended.test.tsx @@ -0,0 +1,78 @@ +// @vitest-environment happy-dom +import '@testing-library/jest-dom/vitest' +import { cleanup, render, screen } from '@testing-library/react' +import type { ComponentProps } from 'react' +import { afterEach, expect, it, vi } from 'vitest' +import { getDefaultSettings } from '../../../../shared/constants' +import { useAppStore } from '@/store' +import { NativeChatCrewFrame } from './NativeChatCrewPanel' +import { TerminalCrewPortals } from './TerminalCrewPortals' +import { ExperimentalPane, getExperimentalPaneSearchEntries } from '../settings/ExperimentalPane' +import { TooltipProvider } from '../ui/tooltip' +import { i18n, loadRendererUiLanguage, translate } from '@/i18n/i18n' + +const initialState = useAppStore.getState() +afterEach(async () => { + cleanup() + useAppStore.setState(initialState, true) + vi.restoreAllMocks() + vi.unstubAllGlobals() + await i18n.changeLanguage('en') +}) + +it('keeps restored opt-in settings dormant across terminal and native-chat panes', async () => { + const saved = { ...getDefaultSettings('/home/test'), experimentalOrchestrationPanel: true } + vi.stubGlobal('api', { settings: { get: vi.fn().mockResolvedValue(saved) } }) + await useAppStore.getState().fetchSettings() + expect(useAppStore.getState().settings?.experimentalOrchestrationPanel).toBe(true) + + const readPanes = vi.fn(() => []) + const controller: ComponentProps['controller'] = { + tabId: 'terminal', + worktreeId: 'workspace', + managerRef: { current: null }, + paneTransportsRef: { current: new Map() }, + isRendererVisible: true, + expandedPaneId: null, + isolatedPaneKey: null, + get managedPanes() { + return readPanes() + }, + effectiveChatViewMode: false, + chatPane: null + } + const mountPanel = vi.fn(() => ) + const Panel = mountPanel + render( + <> + {Array.from({ length: 172 }, (_, index) => ( + }> + + Conversation {index} + + ))} + + ) + expect(screen.getByText('Conversation 171')).toBeInTheDocument() + expect(mountPanel).not.toHaveBeenCalled() + expect(readPanes).not.toHaveBeenCalled() +}) + +it.each(['en', 'de'] as const)('removes the switch and search result in %s', async (language) => { + await i18n.changeLanguage(await loadRendererUiLanguage(language)) + const settings = { ...getDefaultSettings('/home/test'), experimentalOrchestrationPanel: true } + useAppStore.setState({ settings, settingsSearchQuery: '' }) + const view = render( + + + + ) + const title = translate( + 'auto.components.settings.experimental.search.orchestrationPanel.title', + 'Orchestration panel' + ) + expect(view.container.querySelector('#experimental-orchestration-panel')).toBeNull() + expect(screen.queryByText(title)).not.toBeInTheDocument() + expect(getExperimentalPaneSearchEntries().some((entry) => entry.title === title)).toBe(false) + expect(view.container.querySelector('#experimental-browser-extensions')).not.toBeNull() +}) diff --git a/src/renderer/src/components/orchestration-crew/use-orchestration-panel-enabled.ts b/src/renderer/src/components/orchestration-crew/use-orchestration-panel-enabled.ts index 4c256f7d51d..a5bae622ccc 100644 --- a/src/renderer/src/components/orchestration-crew/use-orchestration-panel-enabled.ts +++ b/src/renderer/src/components/orchestration-crew/use-orchestration-panel-enabled.ts @@ -1,6 +1,4 @@ -import { useAppStore } from '@/store' - -/** Experimental gate for every orchestration panel mount; read live so toggling needs no restart. */ export function useOrchestrationPanelEnabled(): boolean { - return useAppStore((state) => state.settings?.experimentalOrchestrationPanel === true) + // Suspended: panel subscriptions amplify status updates into host-wide reads and copies. + return false } diff --git a/src/renderer/src/components/settings/ExperimentalPane.fixture.tsx b/src/renderer/src/components/settings/ExperimentalPane.fixture.tsx new file mode 100644 index 00000000000..aaae8d26797 --- /dev/null +++ b/src/renderer/src/components/settings/ExperimentalPane.fixture.tsx @@ -0,0 +1,14 @@ +import { defineFixture } from '../../component-fixtures/component-fixture' +import { getDefaultSettings } from '../../../../shared/constants' +import { ExperimentalPane } from './ExperimentalPane' + +const settings = { + ...getDefaultSettings('/home/test'), + experimentalOrchestrationPanel: true +} + +export const suspendedOrchestrationPanel = defineFixture({ + width: 760, + store: { settings }, + render: () => {}} /> +}) diff --git a/src/renderer/src/components/settings/ExperimentalPane.tsx b/src/renderer/src/components/settings/ExperimentalPane.tsx index 55907a40562..eb18bf91049 100644 --- a/src/renderer/src/components/settings/ExperimentalPane.tsx +++ b/src/renderer/src/components/settings/ExperimentalPane.tsx @@ -11,7 +11,6 @@ import { translate } from '@/i18n/i18n' import { AgentDashboardExperimentalSetting } from './AgentDashboardExperimentalSetting' import { EphemeralVmsExperimentalSetting } from './EphemeralVmsExperimentalSetting' import { BrowserExtensionsExperimentalSetting } from './BrowserExtensionsExperimentalSetting' -import { OrchestrationPanelExperimentalSetting } from './OrchestrationPanelExperimentalSetting' import { WslHostsExperimentalSetting } from './WslHostsExperimentalSetting' import { wslHostsAvailable } from '../sidebar/use-wsl-hosts-enabled' import { @@ -263,8 +262,6 @@ export function ExperimentalPane({ - - {wslHostsAvailable() ? ( ) : null} diff --git a/src/renderer/src/components/settings/OrchestrationPanelExperimentalSetting.tsx b/src/renderer/src/components/settings/OrchestrationPanelExperimentalSetting.tsx deleted file mode 100644 index 63211202f9c..00000000000 --- a/src/renderer/src/components/settings/OrchestrationPanelExperimentalSetting.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { translate } from '@/i18n/i18n' -import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitch } from './SettingsFormControls' -import { getExperimentalSearchEntry } from './experimental-search' - -type OrchestrationPanelExperimentalSettingProps = { - settings: GlobalSettings - updateSettings: (updates: Partial) => void -} - -export function OrchestrationPanelExperimentalSetting({ - settings, - updateSettings -}: OrchestrationPanelExperimentalSettingProps): React.JSX.Element { - const entry = getExperimentalSearchEntry().orchestrationPanel - const enabled = settings.experimentalOrchestrationPanel === true - - return ( - -
-
- -

{entry.description}

-
- updateSettings({ experimentalOrchestrationPanel: !enabled })} - /> -
-
- ) -} diff --git a/src/renderer/src/components/settings/experimental-search.ts b/src/renderer/src/components/settings/experimental-search.ts index e3a2d94246d..68cdca63013 100644 --- a/src/renderer/src/components/settings/experimental-search.ts +++ b/src/renderer/src/components/settings/experimental-search.ts @@ -6,7 +6,6 @@ import { getNewWorktreeCardStyleSearchEntry } from './new-worktree-card-style-se import { getEphemeralVmsSearchEntry } from './ephemeral-vms-search' import { getBrowserExtensionsExperimentalSearchEntry } from './browser-extensions-experimental-search' import { getWslHostsExperimentalSearchEntry } from './wsl-hosts-experimental-search' -import { getOrchestrationPanelExperimentalSearchEntry } from './orchestration-panel-experimental-search' export const getExperimentalPaneSearchEntries = createLocalizedCatalog( (): SettingsSearchEntry[] => [ @@ -183,7 +182,6 @@ export const getExperimentalPaneSearchEntries = createLocalizedCatalog( getNewWorktreeCardStyleSearchEntry(), getEphemeralVmsSearchEntry(), getBrowserExtensionsExperimentalSearchEntry(), - getOrchestrationPanelExperimentalSearchEntry(), // Index WSL toggles only on Windows desktops that expose them. ...(typeof window !== 'undefined' && window.api?.runtimeEnvironments?.wslHosts ? [getWslHostsExperimentalSearchEntry()] @@ -232,12 +230,6 @@ export function getExperimentalSearchEntry() { 'auto.components.settings.experimental.search.browserExtensions.title', 'Browser extensions' ) - ), - orchestrationPanel: findEntry( - translate( - 'auto.components.settings.experimental.search.orchestrationPanel.title', - 'Orchestration panel' - ) ) } as const } diff --git a/src/renderer/src/components/settings/orchestration-panel-experimental-search.ts b/src/renderer/src/components/settings/orchestration-panel-experimental-search.ts deleted file mode 100644 index 58412808ab3..00000000000 --- a/src/renderer/src/components/settings/orchestration-panel-experimental-search.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { SettingsSearchEntry } from './settings-search' -import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' -import { createLocalizedCatalog } from '@/i18n/localized-catalog' - -export const getOrchestrationPanelExperimentalSearchEntry = createLocalizedCatalog( - (): SettingsSearchEntry => ({ - title: translate( - 'auto.components.settings.experimental.search.orchestrationPanel.title', - 'Orchestration panel' - ), - description: translate( - 'auto.components.settings.experimental.search.orchestrationPanel.description', - 'Shows which agents each agent is working with, beside its chat or terminal.' - ), - keywords: [ - ...translateSearchKeyword( - 'auto.components.settings.experimental.search.0d24759f14', - 'experimental' - ), - ...translateSearchKeyword( - 'auto.components.settings.experimental.search.orchestrationPanel.orchestration', - 'orchestration' - ), - ...translateSearchKeyword( - 'auto.components.settings.experimental.search.orchestrationPanel.agents', - 'agents' - ), - ...translateSearchKeyword( - 'auto.components.settings.experimental.search.orchestrationPanel.workers', - 'workers' - ), - ...translateSearchKeyword( - 'auto.components.settings.experimental.search.orchestrationPanel.manager', - 'manager' - ) - ], - targetSectionId: 'experimental-orchestration-panel' - }) -) diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index e751e0d2883..1ff357ccfe5 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -1252,10 +1252,6 @@ "permissionDenied": "Permission denied.", "symlink": "Symbolic links cannot be attached.", "unsupported": "Unsupported file type." - }, - "activateAiVaultStructuredSession": { - "worktreeDeleted": "The worktree was deleted.", - "folderWorkspaceRemoved": "The folder workspace was removed." } }, "runtime": { diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 3454135d357..cf8f50f8bf7 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -8074,9 +8074,6 @@ "browserExtensions": { "copy": "Adds Settings › Browser › Extensions for local browser profiles.", "toggleLabel": "Toggle browser extensions" - }, - "orchestrationPanel": { - "toggleLabel": "Toggle orchestration panel" } }, "FloatingWorkspacePane": { @@ -10289,14 +10286,6 @@ "extension": "extension", "chrome": "chrome", "password": "password manager" - }, - "orchestrationPanel": { - "title": "Orchestration panel", - "description": "Shows which agents each agent is working with, beside its chat or terminal.", - "orchestration": "orchestration", - "agents": "agents", - "workers": "workers", - "manager": "manager" } } }, diff --git a/tests/component-fixtures/orchestration-crew-card.spec.ts b/tests/component-fixtures/orchestration-crew-card.spec.ts index 8583e19c25f..6d51039d73a 100644 --- a/tests/component-fixtures/orchestration-crew-card.spec.ts +++ b/tests/component-fixtures/orchestration-crew-card.spec.ts @@ -15,10 +15,15 @@ async function openFixture(page: Page, name: string) { return bounds } -test('in a short native chat the card stops above the composer and scrolls', async ({ page }) => { - const card = await openFixture(page, 'tenWorkersShortChatExpanded') - const composer = await page.getByTestId('composer').boundingBox() - expect(card.y + card.height).toBeLessThanOrEqual(composer!.y) +test('a saved opt-in keeps the suspended native chat card hidden and the composer visible', async ({ + page +}) => { + await page.goto( + '/fixtures.html?id=orchestration-crew/OrchestrationCrewPanel:tenWorkersShortChatExpanded' + ) + await expect(page.locator('html')).toHaveAttribute('data-fixture-state', 'ready') + await expect(page.getByRole('complementary', { name: 'Orchestration' })).toHaveCount(0) + await expect(page.getByTestId('composer')).toBeVisible() }) test('in a short terminal the card keeps the bottom quarter clear and scrolls', async ({