Skip to content

Commit edec95e

Browse files
committed
Adds whats new image to home view
Updates upgrade notification
1 parent 29ae0b3 commit edec95e

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

images/sponsors/cresus.png

Whitespace-only changes.

src/extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ async function showWelcomeOrWhatsNew(container: Container, version: string, prev
245245
return;
246246
}
247247

248+
if (major !== prevMajor) {
249+
version = String(major);
250+
}
251+
248252
void executeCommand(Commands.ShowHomeView);
249253

250254
if (container.config.showWhatsNewAfterUpgrades) {

src/messages.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { ConfigurationTarget, env, MessageItem, Uri, window } from 'vscode';
22
import { configuration } from './configuration';
3+
import { Commands } from './constants';
34
import { GitCommit } from './git/models';
45
import { Logger } from './logger';
6+
import { executeCommand } from './system/command';
57

68
export const enum SuppressedMessages {
79
CommitHasNoPreviousCommitWarning = 'suppressCommitHasNoPreviousCommitWarning',
@@ -154,17 +156,17 @@ export class Messages {
154156
}
155157

156158
static async showWhatsNewMessage(version: string) {
157-
const whatsnew = { title: "What's New" };
159+
const whatsnew = { title: "See What's New" };
158160
const result = await Messages.showMessage(
159161
'info',
160-
`GitLens has been updated to v${version} — check out what's new!`,
162+
`GitLens ${version} is here — check out what's new!`,
161163
undefined,
162164
null,
163165
whatsnew,
164166
);
165167

166168
if (result === whatsnew) {
167-
await env.openExternal(Uri.parse('https://gitlens.amod.io/#whats-new'));
169+
void (await executeCommand(Commands.ShowWelcomePage));
168170
}
169171
}
170172

src/webviews/apps/home/home.scss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ body {
2323
min-height: 100%;
2424
}
2525

26-
.welcome {
27-
grid-template-rows: repeat(3, min-content);
28-
}
29-
3026
section {
3127
display: flex;
3228
flex-direction: column;
@@ -75,6 +71,8 @@ p {
7571
}
7672

7773
.welcome {
74+
grid-template-rows: repeat(3, min-content);
75+
7876
ul {
7977
list-style: none;
8078
padding: 0;
@@ -86,6 +84,11 @@ p {
8684
}
8785
}
8886

87+
.welcomelink__whatsnew {
88+
max-width: 400px;
89+
margin: 1rem auto 0 auto;
90+
}
91+
8992
.links {
9093
display: grid;
9194
grid-template-columns: repeat(3, auto);

src/webviews/apps/home/partials/welcome.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<template id="welcome">
22
<section class="welcome">
33
<h3>Welcome to GitLens 12</h3>
4+
<a class="welcomelink__whatsnew" title="See What's New" href="command:gitlens.showWelcomePage">
5+
<img class="image--preview" src="#{webroot}/media/gitlens-12-card.webp" alt="What's new" />
6+
</a>
47
<p>
58
GitLens <b>supercharges</b> Git inside VS Code and unlocks the <b>untapped knowledge</b> within each
69
repository. It helps you to <b>visualize code authorship</b> at a glance via Git blame annotations and

0 commit comments

Comments
 (0)