mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
Merge pull request #303365 from microsoft/meerkat
Remove sign in dialog experiment
This commit is contained in:
@@ -90,7 +90,6 @@ class SessionsWelcomeOverlay extends Disposable {
|
||||
dialogTitle: this.chatEntitlementService.anonymous ?
|
||||
localize('sessions.startUsingSessions', "Start using Sessions") :
|
||||
localize('sessions.signinRequired', "Sign in to use Sessions"),
|
||||
dialogHideSkip: true
|
||||
});
|
||||
|
||||
if (success) {
|
||||
|
||||
@@ -232,7 +232,7 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
|
||||
});
|
||||
}
|
||||
|
||||
override async run(accessor: ServicesAccessor, mode?: ChatModeKind | string, options?: { forceSignInDialog?: boolean; additionalScopes?: readonly string[]; forceAnonymous?: ChatSetupAnonymous; inputValue?: string; dialogIcon?: ThemeIcon; dialogTitle?: string; dialogHideSkip?: boolean }): Promise<boolean> {
|
||||
override async run(accessor: ServicesAccessor, mode?: ChatModeKind | string, options?: { forceSignInDialog?: boolean; additionalScopes?: readonly string[]; forceAnonymous?: ChatSetupAnonymous; inputValue?: string; dialogIcon?: ThemeIcon; dialogTitle?: string }): Promise<boolean> {
|
||||
const widgetService = accessor.get(IChatWidgetService);
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
const dialogService = accessor.get(IDialogService);
|
||||
@@ -281,7 +281,7 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
|
||||
});
|
||||
}
|
||||
|
||||
override async run(accessor: ServicesAccessor, options?: { dialogIcon?: ThemeIcon; dialogTitle?: string; dialogHideSkip?: boolean }): Promise<unknown> {
|
||||
override async run(accessor: ServicesAccessor, options?: { dialogIcon?: ThemeIcon; dialogTitle?: string }): Promise<unknown> {
|
||||
const commandService = accessor.get(ICommandService);
|
||||
const telemetryService = accessor.get(ITelemetryService);
|
||||
const chatEntitlementService = accessor.get(IChatEntitlementService);
|
||||
|
||||
@@ -32,7 +32,6 @@ import { ChatSetupController } from './chatSetupController.js';
|
||||
import { IChatSetupResult, ChatSetupAnonymous, InstallChatEvent, InstallChatClassification, ChatSetupStrategy, ChatSetupResultValue } from './chatSetup.js';
|
||||
import { IDefaultAccountService } from '../../../../../platform/defaultAccount/common/defaultAccount.js';
|
||||
import { IHostService } from '../../../../services/host/browser/host.js';
|
||||
import { IWorkbenchAssignmentService } from '../../../../services/assignment/common/assignmentService.js';
|
||||
|
||||
const defaultChat = {
|
||||
publicCodeMatchesUrl: product.defaultChatAgent?.publicCodeMatchesUrl ?? '',
|
||||
@@ -51,7 +50,7 @@ export class ChatSetup {
|
||||
let instance = ChatSetup.instance;
|
||||
if (!instance) {
|
||||
instance = ChatSetup.instance = instantiationService.invokeFunction(accessor => {
|
||||
return new ChatSetup(context, controller, accessor.get(ITelemetryService), accessor.get(IWorkbenchLayoutService), accessor.get(IKeybindingService), accessor.get(IChatEntitlementService) as ChatEntitlementService, accessor.get(ILogService), accessor.get(IChatWidgetService), accessor.get(IWorkspaceTrustRequestService), accessor.get(IMarkdownRendererService), accessor.get(IDefaultAccountService), accessor.get(IHostService), accessor.get(IWorkbenchAssignmentService));
|
||||
return new ChatSetup(context, controller, accessor.get(ITelemetryService), accessor.get(IWorkbenchLayoutService), accessor.get(IKeybindingService), accessor.get(IChatEntitlementService) as ChatEntitlementService, accessor.get(ILogService), accessor.get(IChatWidgetService), accessor.get(IWorkspaceTrustRequestService), accessor.get(IMarkdownRendererService), accessor.get(IDefaultAccountService), accessor.get(IHostService));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -75,14 +74,13 @@ export class ChatSetup {
|
||||
@IMarkdownRendererService private readonly markdownRendererService: IMarkdownRendererService,
|
||||
@IDefaultAccountService private readonly defaultAccountService: IDefaultAccountService,
|
||||
@IHostService private readonly hostService: IHostService,
|
||||
@IWorkbenchAssignmentService private readonly experimentService: IWorkbenchAssignmentService,
|
||||
) { }
|
||||
|
||||
skipDialog(): void {
|
||||
this.skipDialogOnce = true;
|
||||
}
|
||||
|
||||
async run(options?: { disableChatViewReveal?: boolean; forceSignInDialog?: boolean; additionalScopes?: readonly string[]; forceAnonymous?: ChatSetupAnonymous; dialogIcon?: ThemeIcon; dialogTitle?: string; dialogHideSkip?: boolean }): Promise<IChatSetupResult> {
|
||||
async run(options?: { disableChatViewReveal?: boolean; forceSignInDialog?: boolean; additionalScopes?: readonly string[]; forceAnonymous?: ChatSetupAnonymous; dialogIcon?: ThemeIcon; dialogTitle?: string }): Promise<IChatSetupResult> {
|
||||
if (this.pendingRun) {
|
||||
return this.pendingRun;
|
||||
}
|
||||
@@ -96,7 +94,7 @@ export class ChatSetup {
|
||||
}
|
||||
}
|
||||
|
||||
private async doRun(options?: { disableChatViewReveal?: boolean; forceSignInDialog?: boolean; additionalScopes?: readonly string[]; forceAnonymous?: ChatSetupAnonymous; dialogIcon?: ThemeIcon; dialogTitle?: string; dialogHideSkip?: boolean }): Promise<IChatSetupResult> {
|
||||
private async doRun(options?: { disableChatViewReveal?: boolean; forceSignInDialog?: boolean; additionalScopes?: readonly string[]; forceAnonymous?: ChatSetupAnonymous; dialogIcon?: ThemeIcon; dialogTitle?: string }): Promise<IChatSetupResult> {
|
||||
this.context.update({ later: false });
|
||||
|
||||
const dialogSkipped = this.skipDialogOnce;
|
||||
@@ -162,11 +160,10 @@ export class ChatSetup {
|
||||
return { success, dialogSkipped };
|
||||
}
|
||||
|
||||
private async showDialog(options?: { forceSignInDialog?: boolean; forceAnonymous?: ChatSetupAnonymous; dialogIcon?: ThemeIcon; dialogTitle?: string; dialogHideSkip?: boolean }): Promise<ChatSetupStrategy> {
|
||||
private async showDialog(options?: { forceSignInDialog?: boolean; forceAnonymous?: ChatSetupAnonymous; dialogIcon?: ThemeIcon; dialogTitle?: string }): Promise<ChatSetupStrategy> {
|
||||
const disposables = new DisposableStore();
|
||||
|
||||
const useCloseButton = options?.dialogHideSkip || await this.experimentService.getTreatment<boolean>('chatSetupDialogCloseButton');
|
||||
const buttons = this.getButtons(options, useCloseButton);
|
||||
const buttons = this.getButtons(options);
|
||||
|
||||
const dialog = disposables.add(new Dialog(
|
||||
this.layoutService.activeContainer,
|
||||
@@ -178,8 +175,8 @@ export class ChatSetup {
|
||||
detail: ' ', // workaround allowing us to render the message in large
|
||||
icon: options?.dialogIcon ?? Codicon.copilotLarge,
|
||||
alignment: DialogContentsAlignment.Vertical,
|
||||
cancelId: useCloseButton ? buttons.length : buttons.length - 1,
|
||||
disableCloseButton: !useCloseButton,
|
||||
cancelId: buttons.length,
|
||||
disableCloseButton: false,
|
||||
renderFooter: footer => footer.appendChild(this.createDialogFooter(disposables, options)),
|
||||
buttonOptions: buttons.map(button => button[2])
|
||||
}, this.keybindingService, this.layoutService, this.hostService)
|
||||
@@ -191,7 +188,7 @@ export class ChatSetup {
|
||||
return buttons[button]?.[1] ?? ChatSetupStrategy.Canceled;
|
||||
}
|
||||
|
||||
private getButtons(options?: { forceSignInDialog?: boolean; forceAnonymous?: ChatSetupAnonymous }, useCloseButton?: boolean): Array<[string, ChatSetupStrategy, { styleButton?: (button: IButton) => void } | undefined]> {
|
||||
private getButtons(options?: { forceSignInDialog?: boolean; forceAnonymous?: ChatSetupAnonymous }): Array<[string, ChatSetupStrategy, { styleButton?: (button: IButton) => void } | undefined]> {
|
||||
type ContinueWithButton = [string, ChatSetupStrategy, { styleButton?: (button: IButton) => void } | undefined];
|
||||
const styleButton = (...classes: string[]) => ({ styleButton: (button: IButton) => button.element.classList.add(...classes) });
|
||||
|
||||
@@ -225,10 +222,6 @@ export class ChatSetup {
|
||||
buttons = [[localize('setupAIButton', "Use AI Features"), ChatSetupStrategy.DefaultSetup, undefined]];
|
||||
}
|
||||
|
||||
if (!useCloseButton) {
|
||||
buttons.push([localize('skipForNow', "Skip for now"), ChatSetupStrategy.Canceled, styleButton('link-button', 'skip-button')]);
|
||||
}
|
||||
|
||||
return buttons;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user