Skip to content

Commit 9bf5ea5

Browse files
authored
Update getting started exp (microsoft#252752)
1 parent ce4da75 commit 9bf5ea5

File tree

3 files changed

+16
-166
lines changed

3 files changed

+16
-166
lines changed

src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import { AccessibilityVerbositySettingId } from '../../accessibility/browser/acc
7373
import { AccessibleViewAction } from '../../accessibility/browser/accessibleViewActions.js';
7474
import { KeybindingLabel } from '../../../../base/browser/ui/keybindingLabel/keybindingLabel.js';
7575
import { ScrollbarVisibility } from '../../../../base/common/scrollable.js';
76-
import { IGettingStartedExperimentService } from './gettingStartedExpService.js';
76+
import { startupExpContext, StartupExperimentGroup } from '../../../services/coreExperimentation/common/coreExperimentationService.js';
7777

7878
const SLIDE_TRANSITION_TIME_MS = 250;
7979
const configurationKey = 'workbench.startupEditor';
@@ -193,7 +193,6 @@ export class GettingStartedPage extends EditorPane {
193193
@IWebviewService private readonly webviewService: IWebviewService,
194194
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
195195
@IAccessibilityService private readonly accessibilityService: IAccessibilityService,
196-
@IGettingStartedExperimentService private readonly gettingStartedExperimentService: IGettingStartedExperimentService,
197196
) {
198197

199198
super(GettingStartedPage.ID, group, telemetryService, themeService, storageService);
@@ -960,10 +959,11 @@ export class GettingStartedPage extends EditorPane {
960959
const firstSessionDateString = this.storageService.get(firstSessionDateStorageKey, StorageScope.APPLICATION) || new Date().toUTCString();
961960
const daysSinceFirstSession = ((+new Date()) - (+new Date(firstSessionDateString))) / 1000 / 60 / 60 / 24;
962961
const fistContentBehaviour = daysSinceFirstSession < 1 ? 'openToFirstCategory' : 'index';
962+
const startupExpValue = startupExpContext.getValue(this.contextService);
963963

964-
if (fistContentBehaviour === 'openToFirstCategory') {
965-
const exp = this.gettingStartedExperimentService.getCurrentExperiment();
966-
const first = exp?.walkthroughId ? this.gettingStartedService.getWalkthrough(exp.walkthroughId) : this.gettingStartedCategories.filter(c => !c.when || this.contextService.contextMatchesRules(c.when))[0];
964+
if (fistContentBehaviour === 'openToFirstCategory' && ((startupExpValue === '' || startupExpValue === StartupExperimentGroup.Control))) {
965+
startupExpContext.bindTo(this.contextService).reset();
966+
const first = this.gettingStartedCategories.filter(c => !c.when || this.contextService.contextMatchesRules(c.when))[0];
967967
if (first) {
968968
this.hasScrolledToFirstCategory = true;
969969
this.currentWalkthrough = first;

src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExpService.ts

Lines changed: 0 additions & 160 deletions
This file was deleted.

src/vs/workbench/contrib/welcomeGettingStarted/browser/startupPage.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import { localize } from '../../../../nls.js';
2929
import { IEditorResolverService, RegisteredEditorPriority } from '../../../services/editor/common/editorResolverService.js';
3030
import { TerminalCommandId } from '../../terminal/common/terminal.js';
3131
import { ILogService } from '../../../../platform/log/common/log.js';
32+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
33+
import { startupExpContext, StartupExperimentGroup } from '../../../services/coreExperimentation/common/coreExperimentationService.js';
3234

3335
export const restoreWalkthroughsConfigurationKey = 'workbench.welcomePage.restorableWalkthroughs';
3436
export type RestoreWalkthroughsConfigurationValue = { folder: string; category?: string; step?: string };
@@ -92,7 +94,8 @@ export class StartupPageRunnerContribution extends Disposable implements IWorkbe
9294
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
9395
@IStorageService private readonly storageService: IStorageService,
9496
@ILogService private readonly logService: ILogService,
95-
@INotificationService private readonly notificationService: INotificationService
97+
@INotificationService private readonly notificationService: INotificationService,
98+
@IContextKeyService private readonly contextKeyService: IContextKeyService
9699
) {
97100
super();
98101
this.run().then(undefined, onUnexpectedError);
@@ -136,6 +139,13 @@ export class StartupPageRunnerContribution extends Disposable implements IWorkbe
136139
if (startupEditorSetting.value === 'readme') {
137140
await this.openReadme();
138141
} else if (startupEditorSetting.value === 'welcomePage' || startupEditorSetting.value === 'welcomePageInEmptyWorkbench') {
142+
if (this.storageService.isNew(StorageScope.APPLICATION)) {
143+
const startupExpValue = startupExpContext.getValue(this.contextKeyService);
144+
if (startupExpValue === StartupExperimentGroup.MaximizedChat || startupExpValue === StartupExperimentGroup.SplitEmptyEditorChat) {
145+
startupExpContext.bindTo(this.contextKeyService).reset();
146+
return;
147+
}
148+
}
139149
await this.openGettingStarted(true);
140150
} else if (startupEditorSetting.value === 'terminal') {
141151
this.commandService.executeCommand(TerminalCommandId.CreateTerminalEditor);

0 commit comments

Comments
 (0)