diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts index a1e985b3692c4..099178088e572 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts @@ -1603,10 +1603,14 @@ export class GettingStartedInputSerializer implements IEditorSerializer { } public deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): GettingStartedInput { - try { - const { selectedCategory, selectedStep } = JSON.parse(serializedEditorInput); - return new GettingStartedInput({ selectedCategory, selectedStep }); - } catch { } - return new GettingStartedInput({}); + + return instantiationService.invokeFunction(accessor => { + try { + const { selectedCategory, selectedStep } = JSON.parse(serializedEditorInput); + return new GettingStartedInput({ selectedCategory, selectedStep }, accessor.get(IWalkthroughsService)); + } catch { } + return new GettingStartedInput({}, accessor.get(IWalkthroughsService)); + + }); } } diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.ts index 54cdc003bd858..d12ba57d71381 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.ts @@ -10,6 +10,7 @@ import { URI } from '../../../../base/common/uri.js'; import { Schemas } from '../../../../base/common/network.js'; import { IUntypedEditorInput } from '../../../common/editor.js'; import { IEditorOptions } from '../../../../platform/editor/common/editor.js'; +import { IWalkthroughsService } from './gettingStartedService.js'; export const gettingStartedInputTypeId = 'workbench.editors.gettingStartedInput'; @@ -21,6 +22,10 @@ export class GettingStartedInput extends EditorInput { static readonly ID = gettingStartedInputTypeId; static readonly RESOURCE = URI.from({ scheme: Schemas.walkThrough, authority: 'vscode_getting_started_page' }); + private _selectedCategory: string | undefined; + private _selectedStep: string | undefined; + private _showTelemetryNotice: boolean; + private _showWelcome: boolean; override get typeId(): string { return GettingStartedInput.ID; @@ -56,21 +61,50 @@ export class GettingStartedInput extends EditorInput { } constructor( - options: GettingStartedEditorOptions + options: GettingStartedEditorOptions, + @IWalkthroughsService private readonly walkthroughService: IWalkthroughsService ) { super(); - this.selectedCategory = options.selectedCategory; - this.selectedStep = options.selectedStep; - this.showTelemetryNotice = !!options.showTelemetryNotice; - this.showWelcome = options.showWelcome ?? true; + this._selectedCategory = options.selectedCategory; + this._selectedStep = options.selectedStep; + this._showTelemetryNotice = !!options.showTelemetryNotice; + this._showWelcome = options.showWelcome ?? true; } override getName() { - return localize('getStarted', "Welcome"); + return this.selectedCategory ? this.walkthroughService.getWalkthrough(this.selectedCategory).walkthroughPageTitle : localize('getStarted', "Welcome"); } - selectedCategory: string | undefined; - selectedStep: string | undefined; - showTelemetryNotice: boolean; - showWelcome: boolean; + get selectedCategory() { + return this._selectedCategory; + } + + set selectedCategory(selectedCategory: string | undefined) { + this._selectedCategory = selectedCategory; + this._onDidChangeLabel.fire(); + } + + get selectedStep() { + return this._selectedStep; + } + + set selectedStep(selectedStep: string | undefined) { + this._selectedStep = selectedStep; + } + + get showTelemetryNotice(): boolean { + return this._showTelemetryNotice; + } + + set showTelemetryNotice(value: boolean) { + this._showTelemetryNotice = value; + } + + get showWelcome(): boolean { + return this._showWelcome; + } + + set showWelcome(value: boolean) { + this._showWelcome = value; + } } diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts index a3d6f047f65b9..17800f4abb44a 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts @@ -59,6 +59,7 @@ export interface IWalkthrough { icon: | { type: 'icon'; icon: ThemeIcon } | { type: 'image'; path: string }; + walkthroughPageTitle: string; } export type IWalkthroughLoose = Omit & { steps: (Omit & { description: string })[] }; @@ -390,6 +391,7 @@ export class WalkthroughsService extends Disposable implements IWalkthroughsServ isFeatured, source: extension.displayName ?? extension.name, order: 0, + walkthroughPageTitle: extension.displayName ?? extension.name, steps, icon: { type: 'image', diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts b/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts index 0f8c49a9225c1..9628466daaa4e 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts @@ -79,6 +79,7 @@ export type BuiltinGettingStartedCategory = { when?: string; content: | { type: 'steps'; steps: BuiltinGettingStartedStep[] }; + walkthroughPageTitle: string; }; export type BuiltinGettingStartedStartEntry = { @@ -216,6 +217,7 @@ export const walkthroughs: GettingStartedWalkthroughContent = [ isFeatured: true, icon: setupIcon, when: '!isWeb', + walkthroughPageTitle: localize('gettingStarted.setup.walkthroughPageTitle', 'Setup VS Code'), next: 'Beginner', content: { type: 'steps', @@ -317,6 +319,7 @@ export const walkthroughs: GettingStartedWalkthroughContent = [ icon: setupIcon, when: 'isWeb', next: 'Beginner', + walkthroughPageTitle: localize('gettingStarted.setupWeb.walkthroughPageTitle', 'Setup VS Code Web'), content: { type: 'steps', steps: [ @@ -402,6 +405,7 @@ export const walkthroughs: GettingStartedWalkthroughContent = [ icon: setupIcon, when: CONTEXT_ACCESSIBILITY_MODE_ENABLED.key, next: 'Setup', + walkthroughPageTitle: localize('gettingStarted.setupAccessibility.walkthroughPageTitle', 'Setup VS Code Accessibility'), content: { type: 'steps', steps: [ @@ -498,6 +502,7 @@ export const walkthroughs: GettingStartedWalkthroughContent = [ title: localize('gettingStarted.beginner.title', "Learn the Fundamentals"), icon: beginnerIcon, description: localize('gettingStarted.beginner.description', "Get an overview of the most essential features"), + walkthroughPageTitle: localize('gettingStarted.beginner.walkthroughPageTitle', 'Essential Features'), content: { type: 'steps', steps: [ @@ -604,6 +609,7 @@ export const walkthroughs: GettingStartedWalkthroughContent = [ icon: setupIcon, isFeatured: false, when: `config.${NotebookSetting.openGettingStarted} && userHasOpenedNotebook`, + walkthroughPageTitle: localize('gettingStarted.notebook.walkthroughPageTitle', 'Notebooks'), content: { type: 'steps', steps: [