From d10f2e60328ebe6cbe51e1e3b213913b867680fe Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Thu, 11 Feb 2021 12:34:03 -0800 Subject: [PATCH] Fix #116412: Use getting started page as default startupEditor. --- .../welcome/gettingStarted/browser/gettingStarted.ts | 8 ++++++-- .../welcome/page/browser/welcomePage.contribution.ts | 2 +- .../welcome/walkThrough/browser/walkThroughPart.ts | 1 + test/automation/src/application.ts | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts b/src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts index bed7ba568fb..f7c6019924c 100644 --- a/src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts +++ b/src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts @@ -270,7 +270,11 @@ export class GettingStartedPage extends EditorPane { ); const gettingStartedPage = - $('.gettingStarted', { role: 'document' }, + $('.gettingStarted.welcomePageFocusElement', { + role: 'document', + tabIndex: '0', + 'aria-label': localize('gettingStartedLabel', "Getting Started. Overview of how to get up to speed with your editor.") + }, $('.gettingStartedSlideCategory.gettingStartedSlide.categories'), tasksSlide ); @@ -344,7 +348,6 @@ export class GettingStartedPage extends EditorPane { this.setSlide('details'); this.buildCategorySlide(this.editorInput.selectedCategory, this.editorInput.selectedTask); } else { - this.focusFirstUncompletedCategory(); this.setSlide('categories'); } } @@ -521,6 +524,7 @@ export class GettingStartedPage extends EditorPane { slideManager.classList.add('showCategories'); this.container.querySelector('.gettingStartedSlideDetails')!.querySelectorAll('button').forEach(button => button.disabled = true); this.container.querySelector('.gettingStartedSlideCategory')!.querySelectorAll('button').forEach(button => button.disabled = false); + (this.container.querySelector('.welcomePageFocusElement') as HTMLElement)?.focus(); } else { slideManager.classList.add('showDetails'); slideManager.classList.remove('showCategories'); diff --git a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts index d49c5f3c91d..e65b6f5b462 100644 --- a/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts +++ b/src/vs/workbench/contrib/welcome/page/browser/welcomePage.contribution.ts @@ -30,7 +30,7 @@ Registry.as(ConfigurationExtensions.Configuration) localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePageInEmptyWorkbench' }, "Open the Welcome page when opening an empty workbench."), localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.gettingStarted' }, "Open the Getting Started page.")] ], - 'default': 'welcomePage', + 'default': 'gettingStarted', 'description': localize('workbench.startupEditor', "Controls which editor is shown at startup, if none are restored from the previous session.") }, } diff --git a/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts b/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts index 5422d519840..5f06b8c2b02 100644 --- a/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts +++ b/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts @@ -92,6 +92,7 @@ export class WalkThroughPart extends EditorPane { createEditor(container: HTMLElement): void { this.content = document.createElement('div'); + this.content.classList.add('welcomePageFocusElement'); this.content.tabIndex = 0; this.content.style.outlineStyle = 'none'; diff --git a/test/automation/src/application.ts b/test/automation/src/application.ts index 0440d68d4e5..066b8f63fde 100644 --- a/test/automation/src/application.ts +++ b/test/automation/src/application.ts @@ -73,7 +73,7 @@ export class Application { await this.code.waitForElement('.explorer-folders-view'); if (expectWalkthroughPart) { - await this.code.waitForActiveElement(`.editor-instance[data-editor-id="workbench.editor.walkThroughPart"] > div > div[tabIndex="0"]`); + await this.code.waitForActiveElement(`.editor-instance > div > div.welcomePageFocusElement[tabIndex="0"]`); } }