diff --git a/.vscode/settings.json b/.vscode/settings.json index 9fc915163ee..8ccf6b95f1d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -214,5 +214,4 @@ "azureMcp.serverMode": "all", "azureMcp.readOnly": true, "chat.tools.terminal.outputLocation": "none", - "chat.agentSessionsViewLocation": "single-view" } diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts index ab07d381d89..2ccecb2b96d 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts @@ -516,8 +516,8 @@ export function registerChatActions() { ContextKeyExpr.equals('view', ChatViewId), ChatContextKeys.inEmptyStateWithHistoryEnabled.negate() ), - group: 'navigation', - order: 2 + group: '2_history', + order: 1 }, { id: MenuId.EditorTitle, diff --git a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts index 5b8ac17f346..0251b256d13 100644 --- a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts +++ b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts @@ -529,7 +529,7 @@ configurationRegistry.registerConfiguration({ type: 'string', enum: ['disabled', 'view', 'single-view'], description: nls.localize('chat.sessionsViewLocation.description', "Controls where to show the agent sessions menu."), - default: 'view', + default: product.quality === 'stable' ? 'view' : 'single-view', tags: ['experimental'], experiment: { mode: 'auto' diff --git a/src/vs/workbench/contrib/chat/browser/chatSetup.ts b/src/vs/workbench/contrib/chat/browser/chatSetup.ts index 9f504dd75b6..f275faa8289 100644 --- a/src/vs/workbench/contrib/chat/browser/chatSetup.ts +++ b/src/vs/workbench/contrib/chat/browser/chatSetup.ts @@ -87,6 +87,7 @@ import { IPosition } from '../../../../editor/common/core/position.js'; import { IMarker, IMarkerService, MarkerSeverity } from '../../../../platform/markers/common/markers.js'; import { EditorContextKeys } from '../../../../editor/common/editorContextKeys.js'; import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js'; +import { AGENT_SESSIONS_VIEW_CONTAINER_ID } from './agentSessions/agentSessions.js'; const defaultChat = { extensionId: product.defaultChatAgent?.extensionId ?? '', @@ -1672,9 +1673,12 @@ export class ChatTeardownContribution extends Disposable implements IWorkbenchCo const activeContainers = this.viewDescriptorService.getViewContainersByLocation(ViewContainerLocation.AuxiliaryBar).filter( container => this.viewDescriptorService.getViewContainerModel(container).activeViewDescriptors.length > 0 ); + const hasChatView = activeContainers.some(container => container.id === CHAT_SIDEBAR_PANEL_ID); + const hasAgentSessionsView = activeContainers.some(container => container.id === AGENT_SESSIONS_VIEW_CONTAINER_ID); if ( - (activeContainers.length === 0) || // chat view is already gone but we know it was there before - (activeContainers.length === 1 && activeContainers.at(0)?.id === CHAT_SIDEBAR_PANEL_ID) // chat view is the only view which is going to go away + (activeContainers.length === 0) || // chat view is already gone but we know it was there before + (activeContainers.length === 1 && (hasChatView || hasAgentSessionsView)) || // chat view or agent sessions is the only view which is going to go away + (activeContainers.length === 2 && hasChatView && hasAgentSessionsView) // both chat and agent sessions view are going to go away ) { this.layoutService.setPartHidden(true, Parts.AUXILIARYBAR_PART); // hide if there are no views in the secondary sidebar }