From edec95e308e289f7cf3d083a18f3bbcca3b339b5 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 28 Feb 2022 11:20:38 -0500 Subject: [PATCH] Adds whats new image to home view Updates upgrade notification --- images/sponsors/cresus.png | 0 src/extension.ts | 4 ++++ src/messages.ts | 8 +++++--- src/webviews/apps/home/home.scss | 11 +++++++---- src/webviews/apps/home/partials/welcome.html | 3 +++ 5 files changed, 19 insertions(+), 7 deletions(-) delete mode 100644 images/sponsors/cresus.png diff --git a/images/sponsors/cresus.png b/images/sponsors/cresus.png deleted file mode 100644 index e69de29..0000000 diff --git a/src/extension.ts b/src/extension.ts index b75027a..2cb2a32 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -245,6 +245,10 @@ async function showWelcomeOrWhatsNew(container: Container, version: string, prev return; } + if (major !== prevMajor) { + version = String(major); + } + void executeCommand(Commands.ShowHomeView); if (container.config.showWhatsNewAfterUpgrades) { diff --git a/src/messages.ts b/src/messages.ts index bf0220b..0d2d906 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,7 +1,9 @@ import { ConfigurationTarget, env, MessageItem, Uri, window } from 'vscode'; import { configuration } from './configuration'; +import { Commands } from './constants'; import { GitCommit } from './git/models'; import { Logger } from './logger'; +import { executeCommand } from './system/command'; export const enum SuppressedMessages { CommitHasNoPreviousCommitWarning = 'suppressCommitHasNoPreviousCommitWarning', @@ -154,17 +156,17 @@ export class Messages { } static async showWhatsNewMessage(version: string) { - const whatsnew = { title: "What's New" }; + const whatsnew = { title: "See What's New" }; const result = await Messages.showMessage( 'info', - `GitLens has been updated to v${version} — check out what's new!`, + `GitLens ${version} is here — check out what's new!`, undefined, null, whatsnew, ); if (result === whatsnew) { - await env.openExternal(Uri.parse('https://gitlens.amod.io/#whats-new')); + void (await executeCommand(Commands.ShowWelcomePage)); } } diff --git a/src/webviews/apps/home/home.scss b/src/webviews/apps/home/home.scss index e81fffa..e1a8371 100644 --- a/src/webviews/apps/home/home.scss +++ b/src/webviews/apps/home/home.scss @@ -23,10 +23,6 @@ body { min-height: 100%; } -.welcome { - grid-template-rows: repeat(3, min-content); -} - section { display: flex; flex-direction: column; @@ -75,6 +71,8 @@ p { } .welcome { + grid-template-rows: repeat(3, min-content); + ul { list-style: none; padding: 0; @@ -86,6 +84,11 @@ p { } } +.welcomelink__whatsnew { + max-width: 400px; + margin: 1rem auto 0 auto; +} + .links { display: grid; grid-template-columns: repeat(3, auto); diff --git a/src/webviews/apps/home/partials/welcome.html b/src/webviews/apps/home/partials/welcome.html index e638ffa..1276da9 100644 --- a/src/webviews/apps/home/partials/welcome.html +++ b/src/webviews/apps/home/partials/welcome.html @@ -1,6 +1,9 @@