From b30f4bcf0dd8c23e638e65f6f0c55e24e8d53e81 Mon Sep 17 00:00:00 2001 From: Rickard Date: Mon, 14 Dec 2020 22:50:35 +0100 Subject: [PATCH] Add possibility to disable all welcome screens. Fixes #1049. (#1258) --- README.md | 3 ++- package.json | 10 ++++++++-- src/config.ts | 1 + src/extension.ts | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b19c925..287aafe 100644 --- a/README.md +++ b/README.md @@ -903,7 +903,8 @@ See also [View Settings](#view-settings- 'Jump to the View settings') | `gitlens.insiders` | Specifies whether to enable experimental features | | `gitlens.liveshare.allowGuestAccess` | Specifies whether to allow guest access to GitLens features when using Visual Studio Live Share | | `gitlens.outputLevel` | Specifies how much (if any) output will be sent to the GitLens output channel | -| `gitlens.showWhatsNewAfterUpgrades` | Specifies whether to show What's New after upgrading to new feature releases | +| `gitlens.showWelcomeOrWhatsNew` | Specifies whether to show the Welcome (Quick Setup) experience on first install, or the What's New notification after upgrading to new feature releases | +| `gitlens.showWhatsNewAfterUpgrades` | Specifies whether to show the What's New notification after upgrading to new feature releases | | `gitlens.advanced.abbreviatedShaLength` | Specifies the length of abbreviated commit SHAs (shas) | | `gitlens.advanced.blame.customArguments` | Specifies additional arguments to pass to the `git blame` command | | `gitlens.advanced.blame.delayAfterEdit` | Specifies the time (in milliseconds) to wait before re-blaming an unsaved document after an edit. Use 0 to specify an infinite wait | diff --git a/package.json b/package.json index 182c9ef..737d697 100644 --- a/package.json +++ b/package.json @@ -1463,10 +1463,16 @@ "markdownDescription": "Specifies user-defined remote (code-hosting) services or custom domains for built-in remote services", "scope": "resource" }, + "gitlens.showWelcomeOrWhatsNew": { + "type": "boolean", + "default": true, + "markdownDescription": "Specifies whether to show the Welcome (Quick Setup) experience on first install, or the What's New notification after upgrading to new feature releases", + "scope": "window" + }, "gitlens.showWhatsNewAfterUpgrades": { "type": "boolean", "default": true, - "markdownDescription": "Specifies whether to show What's New after upgrading to new feature releases", + "markdownDescription": "Specifies whether to show the What's New notification after upgrading to new feature releases", "scope": "window" }, "gitlens.sortBranchesBy": { @@ -2600,7 +2606,7 @@ }, { "command": "gitlens.showWelcomePage", - "title": "Welcome", + "title": "Welcome (Quick Setup)", "category": "GitLens" }, { diff --git a/src/config.ts b/src/config.ts index e8d5940..a948a9b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -108,6 +108,7 @@ export interface Config { modes: Record; outputLevel: TraceLevel; remotes: RemotesConfig[] | null; + showWelcomeOrWhatsNew: boolean; showWhatsNewAfterUpgrades: boolean; sortBranchesBy: BranchSorting; sortTagsBy: TagSorting; diff --git a/src/extension.ts b/src/extension.ts index 5dcc1ae..54566c4 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -198,6 +198,8 @@ export function notifyOnUnsupportedGitVersion(version: string) { async function showWelcomeOrWhatsNew(version: string, previousVersion: string | undefined) { if (previousVersion == null) { Logger.log('GitLens first-time install'); + if (!Container.config.showWelcomeOrWhatsNew) return; + await commands.executeCommand(Commands.ShowWelcomePage); return; @@ -207,6 +209,8 @@ async function showWelcomeOrWhatsNew(version: string, previousVersion: string | Logger.log(`GitLens upgraded from v${previousVersion} to v${version}`); } + if (!Container.config.showWelcomeOrWhatsNew) return; + const [major, minor] = version.split('.').map(v => parseInt(v, 10)); const [prevMajor, prevMinor] = previousVersion.split('.').map(v => parseInt(v, 10)); if (