Skip to content

Commit d80bb0d

Browse files
authored
fix: save walkthroughPageTitle in GettingStartedInput (microsoft#232169)
1 parent 5f01465 commit d80bb0d

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ export class GettingStartedPage extends EditorPane {
907907
this.hasScrolledToFirstCategory = true;
908908
this.currentWalkthrough = first;
909909
this.editorInput.selectedCategory = this.currentWalkthrough?.id;
910+
this.editorInput.walkthroughPageTitle = this.currentWalkthrough.walkthroughPageTitle;
910911
this.buildCategorySlide(this.editorInput.selectedCategory, undefined);
911912
this.setSlide('details', true /* firstLaunch */);
912913
return;
@@ -1181,6 +1182,7 @@ export class GettingStartedPage extends EditorPane {
11811182
reset(this.stepsContent);
11821183
this.editorInput.selectedCategory = categoryID;
11831184
this.editorInput.selectedStep = stepId;
1185+
this.editorInput.walkthroughPageTitle = ourCategory.walkthroughPageTitle;
11841186
this.currentWalkthrough = ourCategory;
11851187
this.buildCategorySlide(categoryID, stepId);
11861188
this.setSlide('details');
@@ -1530,6 +1532,7 @@ export class GettingStartedPage extends EditorPane {
15301532
this.editorInput.selectedCategory = undefined;
15311533
this.editorInput.selectedStep = undefined;
15321534
this.editorInput.showTelemetryNotice = false;
1535+
this.editorInput.walkthroughPageTitle = undefined;
15331536

15341537
if (this.gettingStartedCategories.length !== this.gettingStartedList?.itemCount) {
15351538
// extensions may have changed in the time since we last displayed the walkthrough list
@@ -1612,9 +1615,9 @@ export class GettingStartedInputSerializer implements IEditorSerializer {
16121615
return instantiationService.invokeFunction(accessor => {
16131616
try {
16141617
const { selectedCategory, selectedStep } = JSON.parse(serializedEditorInput);
1615-
return new GettingStartedInput({ selectedCategory, selectedStep }, accessor.get(IWalkthroughsService));
1618+
return new GettingStartedInput({ selectedCategory, selectedStep });
16161619
} catch { }
1617-
return new GettingStartedInput({}, accessor.get(IWalkthroughsService));
1620+
return new GettingStartedInput({});
16181621

16191622
});
16201623
}

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ import { URI } from '../../../../base/common/uri.js';
1010
import { Schemas } from '../../../../base/common/network.js';
1111
import { IUntypedEditorInput } from '../../../common/editor.js';
1212
import { IEditorOptions } from '../../../../platform/editor/common/editor.js';
13-
import { IWalkthroughsService } from './gettingStartedService.js';
1413

1514
export const gettingStartedInputTypeId = 'workbench.editors.gettingStartedInput';
1615

1716
export interface GettingStartedEditorOptions extends IEditorOptions {
18-
selectedCategory?: string; selectedStep?: string; showTelemetryNotice?: boolean; showWelcome?: boolean;
17+
selectedCategory?: string;
18+
selectedStep?: string;
19+
showTelemetryNotice?: boolean;
20+
showWelcome?: boolean;
21+
walkthroughPageTitle?: string;
1922
}
2023

2124
export class GettingStartedInput extends EditorInput {
@@ -26,6 +29,7 @@ export class GettingStartedInput extends EditorInput {
2629
private _selectedStep: string | undefined;
2730
private _showTelemetryNotice: boolean;
2831
private _showWelcome: boolean;
32+
private _walkthroughPageTitle: string | undefined;
2933

3034
override get typeId(): string {
3135
return GettingStartedInput.ID;
@@ -61,18 +65,17 @@ export class GettingStartedInput extends EditorInput {
6165
}
6266

6367
constructor(
64-
options: GettingStartedEditorOptions,
65-
@IWalkthroughsService private readonly walkthroughService: IWalkthroughsService
66-
) {
68+
options: GettingStartedEditorOptions) {
6769
super();
6870
this._selectedCategory = options.selectedCategory;
6971
this._selectedStep = options.selectedStep;
7072
this._showTelemetryNotice = !!options.showTelemetryNotice;
7173
this._showWelcome = options.showWelcome ?? true;
74+
this._walkthroughPageTitle = options.walkthroughPageTitle;
7275
}
7376

7477
override getName() {
75-
return this.selectedCategory ? localize('walkthroughPageTitle', 'Walkthrough: ') + this.walkthroughService.getWalkthrough(this.selectedCategory).walkthroughPageTitle : localize('getStarted', "Welcome");
78+
return this.walkthroughPageTitle ? localize('walkthroughPageTitle', 'Walkthrough: ') + this.walkthroughPageTitle : localize('getStarted', "Welcome");
7679
}
7780

7881
get selectedCategory() {
@@ -107,4 +110,12 @@ export class GettingStartedInput extends EditorInput {
107110
set showWelcome(value: boolean) {
108111
this._showWelcome = value;
109112
}
113+
114+
get walkthroughPageTitle(): string | undefined {
115+
return this._walkthroughPageTitle;
116+
}
117+
118+
set walkthroughPageTitle(value: string | undefined) {
119+
this._walkthroughPageTitle = value;
120+
}
110121
}

0 commit comments

Comments
 (0)