diff --git a/package.json b/package.json index 0cbc758..cf19410 100644 --- a/package.json +++ b/package.json @@ -2120,6 +2120,12 @@ "markdownDescription": "Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Tags_ view. Only applies when `#gitlens.views.tags.files.layout#` is set to `auto`", "scope": "window" }, + "gitlens.views.updates.enabled": { + "type": "boolean", + "default": true, + "markdownDescription": "Specifies whether to show the _Updates_ view", + "scope": "window" + }, "gitlens.views.welcome.enabled": { "type": "boolean", "default": true, @@ -2531,6 +2537,12 @@ "category": "GitLens" }, { + "command": "gitlens.closeUpdatesView", + "title": "Close", + "category": "GitLens", + "icon": "$(close)" + }, + { "command": "gitlens.closeWelcomeView", "title": "Close", "category": "GitLens", @@ -4334,6 +4346,10 @@ "when": "gitlens:enabled" }, { + "command": "gitlens.closeUpdatesView", + "when": "false" + }, + { "command": "gitlens.closeWelcomeView", "when": "false" }, @@ -5812,6 +5828,11 @@ ], "view/title": [ { + "command": "gitlens.closeUpdatesView", + "when": "view == gitlens.views.updates", + "group": "navigation@1" + }, + { "command": "gitlens.closeWelcomeView", "when": "view == gitlens.views.welcome", "group": "navigation@1" @@ -6394,7 +6415,7 @@ }, { "command": "gitlens.supportGitLens", - "when": "view =~ /^gitlens\\.views\\.(?!welcome)/", + "when": "view =~ /^gitlens\\.views\\.(?!(welcome|updates))/", "group": "9_gitlens@-1" } ], @@ -7706,11 +7727,42 @@ { "view": "gitlens.views.welcome", "contents": "Once you are satisfied, feel free to [close this view](command:gitlens.closeWelcomeView \"Closes the Welcome view\")." + }, + { + "view": "gitlens.views.updates", + "contents": "[What's New in GitLens 11](https://gitlens.amod.io/#whats-new \"Opens the What's New page on the GitLens website\")\n\n[Sponsor GitLens ❤](command:gitlens.supportGitLens)\n\nSee the [release notes](https://github.com/eamodio/vscode-gitlens/blob/master/CHANGELOG.md \"Opens the Release Notes\") for the full set of changes." + }, + { + "view": "gitlens.views.updates", + "contents": "VIEW CHANGES (🧀 has been moved)" + }, + { + "view": "gitlens.views.updates", + "contents": "All [GitLens views](command:gitlens.showSettingsPage%23views) have been moved to the Source Control side bar, by default. You can easily switch between different side bar layouts for GitLens views to best match your workflow, via the [GitLens: Set Views Layout](command:gitlens.setViewsLayout \"Changes the GitLens Views Layout\") command from the Command Palette." + }, + { + "view": "gitlens.views.updates", + "contents": "The [Repositories](command:gitlens.showSettingsPage%23repositories-view) view has been superseded by many new views: [Commits](command:gitlens.showSettingsPage%23commits-view), [Branches](command:gitlens.showSettingsPage%23branches-view), [Remotes](command:gitlens.showSettingsPage%23remotes-view), [Stashes](command:gitlens.showSettingsPage%23stashes-view), [Tags](command:gitlens.showSettingsPage%23tags-view), and [Contributors](command:gitlens.showSettingsPage%23contributors-view). Although, if you want to continue using the Repositories view, you can [click here](command:gitlens.showRepositoriesView) to re-enable it." + }, + { + "view": "gitlens.views.updates", + "contents": "The Line History view has been integrated directly into the [File History](command:gitlens.showSettingsPage%23file-history-view) view." + }, + { + "view": "gitlens.views.updates", + "contents": "The Search Commits and Compare Commits views have been combined into a more powerful and user-friendly [Search & Compare](command:gitlens.showSettingsPage%23search-compare-view) view." } ], "views": { "gitlens": [ { + "id": "gitlens.views.updates", + "name": "What's New in GitLens 11", + "when": "config.gitlens.views.updates.enabled", + "contextualTitle": "GitLens", + "icon": "images/gitlens-activitybar.svg" + }, + { "id": "gitlens.views.welcome", "name": "Welcome", "when": "config.gitlens.views.welcome.enabled", diff --git a/src/commands/closeView.ts b/src/commands/closeView.ts index 1d75f27..f31420a 100644 --- a/src/commands/closeView.ts +++ b/src/commands/closeView.ts @@ -5,7 +5,7 @@ import { command, Command, CommandContext, Commands } from './common'; @command() export class CloseViewCommand extends Command { constructor() { - super(Commands.CloseWelcomeView); + super([Commands.CloseWelcomeView, Commands.CloseUpdatesView]); } protected preExecute(context: CommandContext) { @@ -17,6 +17,9 @@ export class CloseViewCommand extends Command { case Commands.CloseWelcomeView: void (await configuration.updateEffective('views', 'welcome', 'enabled', false)); break; + case Commands.CloseUpdatesView: + void (await configuration.updateEffective('views', 'updates', 'enabled', false)); + break; } } } diff --git a/src/commands/common.ts b/src/commands/common.ts index 1aede9c..6deea8d 100644 --- a/src/commands/common.ts +++ b/src/commands/common.ts @@ -29,6 +29,7 @@ export enum Commands { BrowseRepoAtRevisionInNewWindow = 'gitlens.browseRepoAtRevisionInNewWindow', ClearFileAnnotations = 'gitlens.clearFileAnnotations', CloseUnchangedFiles = 'gitlens.closeUnchangedFiles', + CloseUpdatesView = 'gitlens.closeUpdatesView', CloseWelcomeView = 'gitlens.closeWelcomeView', ComputingFileAnnotations = 'gitlens.computingFileAnnotations', ConnectRemoteProvider = 'gitlens.connectRemoteProvider', diff --git a/src/config.ts b/src/config.ts index 3f9115c..4840102 100644 --- a/src/config.ts +++ b/src/config.ts @@ -439,6 +439,7 @@ interface ViewsConfigs { searchAndCompare: SearchAndCompareViewConfig; stashes: StashesViewConfig; tags: TagsViewConfig; + updates: UpdatesViewConfig; welcome: WelcomeViewConfig; } @@ -555,6 +556,10 @@ export interface TagsViewConfig { files: ViewsFilesConfig; } +export interface UpdatesViewConfig { + enabled: boolean; +} + export interface WelcomeViewConfig { enabled: boolean; } diff --git a/src/extension.ts b/src/extension.ts index 64fb2e3..c89c6e2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -177,12 +177,18 @@ async function showWelcomeOrWhatsNew(version: string, previousVersion: string | return; } - if (Container.config.showWhatsNewAfterUpgrades && major !== prevMajor) { - await Messages.showWhatsNewMessage(version); - } + if (major !== prevMajor) { + if (Container.config.showWhatsNewAfterUpgrades && Container.config.views.welcome.enabled) { + await commands.executeCommand(Commands.ShowWelcomeView); + } + + // if (Container.config.showWhatsNewAfterUpgrades) { + // await Messages.showWhatsNewMessage(version); + // } - // Show a views upgrade notification - if (major !== prevMajor && major === 11) { - await Messages.showViewsUpgradeMessage(); + // // Show a views upgrade notification + // if (major === 11) { + // await Messages.showViewsUpgradeMessage(); + // } } }