From 6656043f47671918a6d539c0834a31b1d84bbaf0 Mon Sep 17 00:00:00 2001 From: Bhavya U Date: Wed, 17 Jul 2024 17:06:13 -0700 Subject: [PATCH] Remove code for disabled chat welcome view exp (#222000) * Remove code for disabled chat welcome view exp * Update distro --- package.json | 2 +- src/vs/base/common/product.ts | 7 ---- .../accountsEntitlements.contribution.ts | 35 ++-------------- .../browser/chatParticipantContributions.ts | 41 ------------------- 4 files changed, 5 insertions(+), 80 deletions(-) diff --git a/package.json b/package.json index e26ad20fb06..0135286107a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.92.0", - "distro": "e697db8a89b3ba772d4260e508cc6211fe1f158c", + "distro": "fadcd761fdc7e186428885eb1bd409300b33a5bc", "author": { "name": "Microsoft Corporation" }, diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts index 5cbc677f2c1..e30cf086820 100644 --- a/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts @@ -191,7 +191,6 @@ export interface IProductConfiguration { readonly commonlyUsedSettings?: string[]; readonly aiGeneratedWorkspaceTrust?: IAiGeneratedWorkspaceTrust; readonly gitHubEntitlement?: IGitHubEntitlement; - readonly chatWelcomeView?: IChatWelcomeView; readonly chatParticipantRegistry?: string; } @@ -307,9 +306,3 @@ export interface IGitHubEntitlement { confirmationMessage: string; confirmationAction: string; } - -export interface IChatWelcomeView { - welcomeViewId: string; - welcomeViewTitle: string; - welcomeViewContent: string; -} diff --git a/src/vs/workbench/contrib/accountEntitlements/browser/accountsEntitlements.contribution.ts b/src/vs/workbench/contrib/accountEntitlements/browser/accountsEntitlements.contribution.ts index 8a4be09b66a..f7c3dceac4d 100644 --- a/src/vs/workbench/contrib/accountEntitlements/browser/accountsEntitlements.contribution.ts +++ b/src/vs/workbench/contrib/accountEntitlements/browser/accountsEntitlements.contribution.ts @@ -26,10 +26,8 @@ import { IRequestService, asText } from 'vs/platform/request/common/request'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { isWeb } from 'vs/base/common/platform'; -import { isInternalTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; const accountsBadgeConfigKey = 'workbench.accounts.experimental.showEntitlements'; -const chatWelcomeViewConfigKey = 'workbench.chat.experimental.showWelcomeView'; type EntitlementEnablementClassification = { enabled: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Flag indicating if the entitlement is enabled' }; @@ -47,7 +45,6 @@ class EntitlementsContribution extends Disposable implements IWorkbenchContribut private isInitialized = false; private showAccountsBadgeContextKey = new RawContextKey(accountsBadgeConfigKey, false).bindTo(this.contextService); - private showChatWelcomeViewContextKey = new RawContextKey(chatWelcomeViewConfigKey, false).bindTo(this.contextService); private readonly accountsMenuBadgeDisposable = this._register(new MutableDisposable()); constructor( @@ -98,7 +95,6 @@ class EntitlementsContribution extends Disposable implements IWorkbenchContribut await this.enableEntitlements(e.event.added[0]); } else if (e.providerId === this.productService.gitHubEntitlement!.providerId && e.event.removed?.length) { this.showAccountsBadgeContextKey.set(false); - this.showChatWelcomeViewContextKey.set(false); this.accountsMenuBadgeDisposable.clear(); } })); @@ -156,29 +152,19 @@ class EntitlementsContribution extends Disposable implements IWorkbenchContribut return; } - const isInternal = isInternalTelemetry(this.productService, this.configurationService); const showAccountsBadge = this.configurationService.inspect(accountsBadgeConfigKey).value ?? false; - const showWelcomeView = this.configurationService.inspect(chatWelcomeViewConfigKey).value ?? false; const [enabled, org] = await this.getEntitlementsInfo(session); - if (enabled) { - if (isInternal && showWelcomeView) { - this.showChatWelcomeViewContextKey.set(true); - this.telemetryService.publicLog2<{ enabled: boolean }, EntitlementEnablementClassification>(chatWelcomeViewConfigKey, { enabled: true }); - } - if (showAccountsBadge) { - this.createAccountsBadge(org); - this.showAccountsBadgeContextKey.set(showAccountsBadge); - this.telemetryService.publicLog2<{ enabled: boolean }, EntitlementEnablementClassification>(accountsBadgeConfigKey, { enabled: true }); - } + if (enabled && showAccountsBadge) { + this.createAccountsBadge(org); + this.showAccountsBadgeContextKey.set(showAccountsBadge); + this.telemetryService.publicLog2<{ enabled: boolean }, EntitlementEnablementClassification>(accountsBadgeConfigKey, { enabled: true }); } } private disableEntitlements() { this.storageService.store(accountsBadgeConfigKey, false, StorageScope.APPLICATION, StorageTarget.MACHINE); - this.storageService.store(chatWelcomeViewConfigKey, false, StorageScope.APPLICATION, StorageTarget.MACHINE); this.showAccountsBadgeContextKey.set(false); - this.showChatWelcomeViewContextKey.set(false); this.accountsMenuBadgeDisposable.clear(); } @@ -260,17 +246,4 @@ configurationRegistry.registerConfiguration({ } }); -configurationRegistry.registerConfiguration({ - ...applicationConfigurationNodeBase, - properties: { - 'workbench.chat.experimental.showWelcomeView': { - scope: ConfigurationScope.MACHINE, - type: 'boolean', - default: false, - tags: ['experimental'], - description: localize('workbench.chat.showWelcomeView', "When enabled, the chat panel welcome view will be shown.") - } - } -}); - registerWorkbenchContribution2('workbench.contrib.entitlements', EntitlementsContribution, WorkbenchPhase.BlockRestore); diff --git a/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts b/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts index a1c6d7a732d..bf183f5bf73 100644 --- a/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts +++ b/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts @@ -8,11 +8,9 @@ import * as strings from 'vs/base/common/strings'; import { Codicon } from 'vs/base/common/codicons'; import { Disposable, DisposableMap, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { localize, localize2 } from 'vs/nls'; -import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { ILogService } from 'vs/platform/log/common/log'; -import { IProductService } from 'vs/platform/product/common/productService'; import { Registry } from 'vs/platform/registry/common/platform'; import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; @@ -113,58 +111,19 @@ export class ChatExtensionPointHandler implements IWorkbenchContribution { static readonly ID = 'workbench.contrib.chatExtensionPointHandler'; - private readonly disposables = new DisposableStore(); - private _welcomeViewDescriptor?: IViewDescriptor; private _viewContainer: ViewContainer; private _participantRegistrationDisposables = new DisposableMap(); constructor( @IChatAgentService private readonly _chatAgentService: IChatAgentService, - @IProductService private readonly productService: IProductService, - @IContextKeyService private readonly contextService: IContextKeyService, @ILogService private readonly logService: ILogService, @INotificationService private readonly notificationService: INotificationService, @ICommandService private readonly commandService: ICommandService, ) { this._viewContainer = this.registerViewContainer(); - this.registerListeners(); this.handleAndRegisterChatExtensions(); } - private registerListeners() { - this.contextService.onDidChangeContext(e => { - - if (!this.productService.chatWelcomeView) { - return; - } - - const showWelcomeViewConfigKey = 'workbench.chat.experimental.showWelcomeView'; - const keys = new Set([showWelcomeViewConfigKey]); - if (e.affectsSome(keys)) { - const contextKeyExpr = ContextKeyExpr.equals(showWelcomeViewConfigKey, true); - const viewsRegistry = Registry.as(ViewExtensions.ViewsRegistry); - if (this.contextService.contextMatchesRules(contextKeyExpr)) { - this._welcomeViewDescriptor = { - id: CHAT_VIEW_ID, - name: { original: this.productService.chatWelcomeView.welcomeViewTitle, value: this.productService.chatWelcomeView.welcomeViewTitle }, - containerIcon: this._viewContainer.icon, - ctorDescriptor: new SyncDescriptor(ChatViewPane), - canToggleVisibility: false, - canMoveView: true, - order: 100 - }; - viewsRegistry.registerViews([this._welcomeViewDescriptor], this._viewContainer); - - viewsRegistry.registerViewWelcomeContent(CHAT_VIEW_ID, { - content: this.productService.chatWelcomeView.welcomeViewContent, - }); - } else if (this._welcomeViewDescriptor) { - viewsRegistry.deregisterViews([this._welcomeViewDescriptor], this._viewContainer); - } - } - }, null, this.disposables); - } - private handleAndRegisterChatExtensions(): void { chatParticipantExtensionPoint.setHandler((extensions, delta) => { for (const extension of delta.added) {