mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
* Show Agent Sessions Sidebar button is noop when sessions view is disabled (fix #284307) * feedback
This commit is contained in:
@@ -694,6 +694,11 @@ abstract class UpdateChatViewWidthAction extends Action2 {
|
|||||||
const canResizeView = chatLocation !== ViewContainerLocation.Panel || (panelPosition === Position.LEFT || panelPosition === Position.RIGHT);
|
const canResizeView = chatLocation !== ViewContainerLocation.Panel || (panelPosition === Position.LEFT || panelPosition === Position.RIGHT);
|
||||||
|
|
||||||
// Update configuration if needed
|
// Update configuration if needed
|
||||||
|
const chatViewSessionsEnabled = configurationService.getValue<boolean>(ChatConfiguration.ChatViewSessionsEnabled);
|
||||||
|
if (!chatViewSessionsEnabled) {
|
||||||
|
await configurationService.updateValue(ChatConfiguration.ChatViewSessionsEnabled, true);
|
||||||
|
}
|
||||||
|
|
||||||
let chatView = viewsService.getActiveViewWithId<ChatViewPane>(ChatViewId);
|
let chatView = viewsService.getActiveViewWithId<ChatViewPane>(ChatViewId);
|
||||||
if (!chatView) {
|
if (!chatView) {
|
||||||
chatView = await viewsService.openView<ChatViewPane>(ChatViewId, false);
|
chatView = await viewsService.openView<ChatViewPane>(ChatViewId, false);
|
||||||
@@ -770,7 +775,6 @@ export class ShowAgentSessionsSidebar extends UpdateChatViewWidthAction {
|
|||||||
precondition: ContextKeyExpr.and(
|
precondition: ContextKeyExpr.and(
|
||||||
ChatContextKeys.enabled,
|
ChatContextKeys.enabled,
|
||||||
ChatContextKeys.agentSessionsViewerOrientation.isEqualTo(AgentSessionsViewerOrientation.Stacked),
|
ChatContextKeys.agentSessionsViewerOrientation.isEqualTo(AgentSessionsViewerOrientation.Stacked),
|
||||||
ContextKeyExpr.equals(`config.${ChatConfiguration.ChatViewSessionsEnabled}`, true)
|
|
||||||
),
|
),
|
||||||
f1: true,
|
f1: true,
|
||||||
category: CHAT_CATEGORY,
|
category: CHAT_CATEGORY,
|
||||||
@@ -794,7 +798,6 @@ export class HideAgentSessionsSidebar extends UpdateChatViewWidthAction {
|
|||||||
precondition: ContextKeyExpr.and(
|
precondition: ContextKeyExpr.and(
|
||||||
ChatContextKeys.enabled,
|
ChatContextKeys.enabled,
|
||||||
ChatContextKeys.agentSessionsViewerOrientation.isEqualTo(AgentSessionsViewerOrientation.SideBySide),
|
ChatContextKeys.agentSessionsViewerOrientation.isEqualTo(AgentSessionsViewerOrientation.SideBySide),
|
||||||
ContextKeyExpr.equals(`config.${ChatConfiguration.ChatViewSessionsEnabled}`, true)
|
|
||||||
),
|
),
|
||||||
f1: true,
|
f1: true,
|
||||||
category: CHAT_CATEGORY,
|
category: CHAT_CATEGORY,
|
||||||
@@ -815,10 +818,7 @@ export class ToggleAgentSessionsSidebar extends Action2 {
|
|||||||
super({
|
super({
|
||||||
id: ToggleAgentSessionsSidebar.ID,
|
id: ToggleAgentSessionsSidebar.ID,
|
||||||
title: ToggleAgentSessionsSidebar.TITLE,
|
title: ToggleAgentSessionsSidebar.TITLE,
|
||||||
precondition: ContextKeyExpr.and(
|
precondition: ChatContextKeys.enabled,
|
||||||
ChatContextKeys.enabled,
|
|
||||||
ContextKeyExpr.equals(`config.${ChatConfiguration.ChatViewSessionsEnabled}`, true)
|
|
||||||
),
|
|
||||||
f1: true,
|
f1: true,
|
||||||
category: CHAT_CATEGORY,
|
category: CHAT_CATEGORY,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user