From 8716df3f215c2e3bd5896bf407f1e05aa8689cd0 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Fri, 21 Jul 2023 11:42:27 -0700 Subject: [PATCH] Add a "both" option to `chat.experimental.defaultMode` (#188525) This will show the chat in the Activity Bar and the Title Bar. cc @isidorn --- .../actions/quickQuestionActions/quickQuestionAction.ts | 2 +- src/vs/workbench/contrib/chat/browser/chat.contribution.ts | 7 ++++++- .../contrib/chat/browser/chatContributionServiceImpl.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/actions/quickQuestionActions/quickQuestionAction.ts b/src/vs/workbench/contrib/chat/browser/actions/quickQuestionActions/quickQuestionAction.ts index 6f40a200bd5d0..a76eb9f6636f1 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/quickQuestionActions/quickQuestionAction.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/quickQuestionActions/quickQuestionAction.ts @@ -53,7 +53,7 @@ export class AskQuickQuestionAction extends Action2 { menu: { id: MenuId.LayoutControlMenu, group: '0_workbench_toggles', - when: ContextKeyExpr.equals('config.chat.experimental.defaultMode', 'quickQuestion'), + when: ContextKeyExpr.notEquals('config.chat.experimental.defaultMode', 'chatView'), order: 0 } }); diff --git a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts index eda5d692605f6..595defa31c777 100644 --- a/src/vs/workbench/contrib/chat/browser/chat.contribution.ts +++ b/src/vs/workbench/contrib/chat/browser/chat.contribution.ts @@ -81,7 +81,12 @@ configurationRegistry.registerConfiguration({ 'chat.experimental.defaultMode': { type: 'string', tags: ['experimental'], - enum: ['chatView', 'quickQuestion'], + enum: ['chatView', 'quickQuestion', 'both'], + enumDescriptions: [ + nls.localize('interactiveSession.defaultMode.chatView', "Use the chat view as the default mode. Displays the chat icon in the Activity Bar."), + nls.localize('interactiveSession.defaultMode.quickQuestion', "Use the quick question as the default mode. Displays the chat icon in the Title Bar."), + nls.localize('interactiveSession.defaultMode.both', "Displays the chat icon in the Activity Bar and the Title Bar which open their respective chat modes.") + ], description: nls.localize('interactiveSession.defaultMode', "Controls the default mode of the chat experience."), default: 'chatView' }, diff --git a/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.ts b/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.ts index e9d90a2093d71..0176f7c10b652 100644 --- a/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.ts +++ b/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.ts @@ -127,7 +127,7 @@ export class ChatContributionService implements IChatContributionService { ctorDescriptor: new SyncDescriptor(ChatViewPane, [{ providerId: providerDescriptor.id }]), when: ContextKeyExpr.and( ContextKeyExpr.deserialize(providerDescriptor.when), - ContextKeyExpr.equals('config.chat.experimental.defaultMode', 'chatView') + ContextKeyExpr.notEquals('config.chat.experimental.defaultMode', 'quickQuestion') ) }]; Registry.as(ViewExtensions.ViewsRegistry).registerViews(viewDescriptor, viewContainer);