Skip to content

Commit d312fbc

Browse files
authored
Walkthrough Guide is not opened, Welcome tab is opened instead (no extensions) (fix microsoft#271542) (microsoft#273423)
1 parent c514ae6 commit d312fbc

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,7 @@ registerAction2(class extends Action2 {
6161
const commandService = accessor.get(ICommandService);
6262

6363
const toSide = typeof optionsOrToSide === 'object' ? optionsOrToSide.toSide : optionsOrToSide;
64-
let inactive = typeof optionsOrToSide === 'object' ? optionsOrToSide.inactive : false;
65-
6664
const activeEditor = editorService.activeEditor;
67-
// If there's already a walkthrough open, open new walkthroughs in the background
68-
if (!inactive && !toSide && activeEditor instanceof GettingStartedInput) {
69-
inactive = true;
70-
}
7165

7266
if (walkthroughID) {
7367
const selectedCategory = typeof walkthroughID === 'string' ? walkthroughID : walkthroughID.category;
@@ -88,10 +82,10 @@ registerAction2(class extends Action2 {
8882
let options: GettingStartedEditorOptions;
8983
if (selectedCategory) {
9084
// Otherwise open the walkthrough editor with the selected category and step
91-
options = { selectedCategory: selectedCategory, selectedStep: selectedStep, showWelcome: false, preserveFocus: toSide ?? false, inactive };
85+
options = { selectedCategory, selectedStep, showWelcome: false, preserveFocus: toSide ?? false };
9286
} else {
9387
// Open Welcome page
94-
options = { selectedCategory: selectedCategory, selectedStep: selectedStep, showWelcome: true, preserveFocus: toSide ?? false, inactive };
88+
options = { selectedCategory, selectedStep, showWelcome: true, preserveFocus: toSide ?? false };
9589
}
9690
editorService.openEditor({
9791
resource: GettingStartedInput.RESOURCE,
@@ -101,7 +95,7 @@ registerAction2(class extends Action2 {
10195
} else {
10296
editorService.openEditor({
10397
resource: GettingStartedInput.RESOURCE,
104-
options: { preserveFocus: toSide ?? false, inactive }
98+
options: { preserveFocus: toSide ?? false }
10599
}, toSide ? SIDE_GROUP : undefined);
106100
}
107101
}

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

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import { IAccessibilityService } from '../../../../platform/accessibility/common
3434
import { ICommandService } from '../../../../platform/commands/common/commands.js';
3535
import { ConfigurationTarget, IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
3636
import { ContextKeyExpr, ContextKeyExpression, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
37-
import { IEditorOptions } from '../../../../platform/editor/common/editor.js';
3837
import { IFileService } from '../../../../platform/files/common/files.js';
3938
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
4039
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
@@ -121,7 +120,6 @@ export class GettingStartedPage extends EditorPane {
121120

122121
public static readonly ID = 'gettingStartedPage';
123122

124-
private editorInput!: GettingStartedInput;
125123
private inProgressScroll = Promise.resolve();
126124

127125
private readonly dispatchListeners: DisposableStore = new DisposableStore();
@@ -165,6 +163,10 @@ export class GettingStartedPage extends EditorPane {
165163
private readonly categoriesSlideDisposables: DisposableStore;
166164
private showFeaturedWalkthrough = true;
167165

166+
get editorInput(): GettingStartedInput {
167+
return this._input as GettingStartedInput;
168+
}
169+
168170
constructor(
169171
group: IEditorGroup,
170172
@ICommandService private readonly commandService: ICommandService,
@@ -340,11 +342,28 @@ export class GettingStartedPage extends EditorPane {
340342
};
341343
}
342344

343-
override async setInput(newInput: GettingStartedInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken) {
344-
this.container.classList.remove('animatable');
345-
this.editorInput = newInput;
346-
this.editorInput.showTelemetryNotice = (options as GettingStartedEditorOptions)?.showTelemetryNotice ?? true;
345+
override async setInput(newInput: GettingStartedInput, options: GettingStartedEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken) {
347346
await super.setInput(newInput, options, context, token);
347+
await this.applyInput(options);
348+
}
349+
350+
override async setOptions(options: GettingStartedEditorOptions | undefined): Promise<void> {
351+
super.setOptions(options);
352+
353+
if (
354+
this.editorInput.selectedCategory !== options?.selectedCategory ||
355+
this.editorInput.selectedStep !== options?.selectedStep
356+
) {
357+
await this.applyInput(options);
358+
}
359+
}
360+
361+
private async applyInput(options: GettingStartedEditorOptions | undefined): Promise<void> {
362+
this.editorInput.showTelemetryNotice = options?.showTelemetryNotice ?? true;
363+
this.editorInput.selectedCategory = options?.selectedCategory;
364+
this.editorInput.selectedStep = options?.selectedStep;
365+
366+
this.container.classList.remove('animatable');
348367
await this.buildCategoriesSlide();
349368
if (this.shouldAnimate()) {
350369
setTimeout(() => this.container.classList.add('animatable'), 0);

0 commit comments

Comments
 (0)