mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
Disable the lagging experimental orchestration panel (#37527)
* Disable the orchestration panel after reported app lag * test: expect suspended orchestration card to stay hidden
This commit is contained in:
@@ -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()
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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<typeof TerminalCrewPortals>['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(() => <aside>Orchestration subscription</aside>)
|
||||
const Panel = mountPanel
|
||||
render(
|
||||
<>
|
||||
{Array.from({ length: 172 }, (_, index) => (
|
||||
<NativeChatCrewFrame key={index} panel={<Panel />}>
|
||||
<TerminalCrewPortals controller={controller} />
|
||||
<span>Conversation {index}</span>
|
||||
</NativeChatCrewFrame>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
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(
|
||||
<TooltipProvider>
|
||||
<ExperimentalPane settings={settings} updateSettings={vi.fn()} hiddenExperimentalUnlocked />
|
||||
</TooltipProvider>
|
||||
)
|
||||
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()
|
||||
})
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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: () => <ExperimentalPane settings={settings} updateSettings={() => {}} />
|
||||
})
|
||||
@@ -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({
|
||||
|
||||
<BrowserExtensionsExperimentalSetting settings={settings} updateSettings={updateSettings} />
|
||||
|
||||
<OrchestrationPanelExperimentalSetting settings={settings} updateSettings={updateSettings} />
|
||||
|
||||
{wslHostsAvailable() ? (
|
||||
<WslHostsExperimentalSetting settings={settings} updateSettings={updateSettings} />
|
||||
) : 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<GlobalSettings>) => void
|
||||
}
|
||||
|
||||
export function OrchestrationPanelExperimentalSetting({
|
||||
settings,
|
||||
updateSettings
|
||||
}: OrchestrationPanelExperimentalSettingProps): React.JSX.Element {
|
||||
const entry = getExperimentalSearchEntry().orchestrationPanel
|
||||
const enabled = settings.experimentalOrchestrationPanel === true
|
||||
|
||||
return (
|
||||
<SearchableSetting
|
||||
title={entry.title}
|
||||
description={entry.description}
|
||||
keywords={entry.keywords}
|
||||
className="space-y-3 py-2"
|
||||
id="experimental-orchestration-panel"
|
||||
>
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div className="min-w-0 shrink space-y-0.5">
|
||||
<Label>{entry.title}</Label>
|
||||
<p className="text-xs text-muted-foreground">{entry.description}</p>
|
||||
</div>
|
||||
<SettingsSwitch
|
||||
checked={enabled}
|
||||
ariaLabel={translate(
|
||||
'auto.components.settings.ExperimentalPane.orchestrationPanel.toggleLabel',
|
||||
'Toggle orchestration panel'
|
||||
)}
|
||||
onChange={() => updateSettings({ experimentalOrchestrationPanel: !enabled })}
|
||||
/>
|
||||
</div>
|
||||
</SearchableSetting>
|
||||
)
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
})
|
||||
)
|
||||
-4
@@ -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": {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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 ({
|
||||
|
||||
Reference in New Issue
Block a user