chat setup - restore copilot menu on extension install (#237348)
parent
aaa576acca
commit
4e2ba23aed
|
@ -16,6 +16,7 @@ import { IDefaultChatAgent } from '../../../../../base/common/product.js';
|
||||||
import { IViewDescriptorService } from '../../../../common/views.js';
|
import { IViewDescriptorService } from '../../../../common/views.js';
|
||||||
import { IWorkbenchLayoutService } from '../../../../services/layout/browser/layoutService.js';
|
import { IWorkbenchLayoutService } from '../../../../services/layout/browser/layoutService.js';
|
||||||
import { ensureSideBarChatViewSize } from '../chat.js';
|
import { ensureSideBarChatViewSize } from '../chat.js';
|
||||||
|
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';
|
||||||
|
|
||||||
|
|
||||||
export class ChatGettingStartedContribution extends Disposable implements IWorkbenchContribution {
|
export class ChatGettingStartedContribution extends Disposable implements IWorkbenchContribution {
|
||||||
|
@ -32,6 +33,7 @@ export class ChatGettingStartedContribution extends Disposable implements IWorkb
|
||||||
@IStorageService private readonly storageService: IStorageService,
|
@IStorageService private readonly storageService: IStorageService,
|
||||||
@IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService,
|
@IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService,
|
||||||
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
|
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
|
||||||
|
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
@ -60,14 +62,25 @@ export class ChatGettingStartedContribution extends Disposable implements IWorkb
|
||||||
if (ExtensionIdentifier.equals(defaultChatAgent.extensionId, ext.value)) {
|
if (ExtensionIdentifier.equals(defaultChatAgent.extensionId, ext.value)) {
|
||||||
const extensionStatus = this.extensionService.getExtensionsStatus();
|
const extensionStatus = this.extensionService.getExtensionsStatus();
|
||||||
if (extensionStatus[ext.value].activationTimes && this.recentlyInstalled) {
|
if (extensionStatus[ext.value].activationTimes && this.recentlyInstalled) {
|
||||||
await this.commandService.executeCommand(CHAT_OPEN_ACTION_ID);
|
this.onDidInstallChat();
|
||||||
ensureSideBarChatViewSize(400, this.viewDescriptorService, this.layoutService);
|
|
||||||
this.storageService.store(ChatGettingStartedContribution.hideWelcomeView, true, StorageScope.APPLICATION, StorageTarget.MACHINE);
|
|
||||||
this.recentlyInstalled = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async onDidInstallChat() {
|
||||||
|
|
||||||
|
// Enable chat command center if previously disabled
|
||||||
|
this.configurationService.updateValue('chat.commandCenter.enabled', true);
|
||||||
|
|
||||||
|
// Open and configure chat view
|
||||||
|
await this.commandService.executeCommand(CHAT_OPEN_ACTION_ID);
|
||||||
|
ensureSideBarChatViewSize(400, this.viewDescriptorService, this.layoutService);
|
||||||
|
|
||||||
|
// Only do this once
|
||||||
|
this.storageService.store(ChatGettingStartedContribution.hideWelcomeView, true, StorageScope.APPLICATION, StorageTarget.MACHINE);
|
||||||
|
this.recentlyInstalled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue