Skip to content

Commit 499d99e

Browse files
committed
Adds a notification when results view is first shown
1 parent 9f40bf0 commit 499d99e

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1616
- Adds *Revert Commit (via Terminal)* command (`gitlens.explorers.terminalRevertCommit`) to revision (commit) nodes in the **GitLens** & **GitLens Results** views
1717
- Adds *Create Tag (via Terminal)...* command (`gitlens.explorers.terminalCreateTag`) to branch and revision (commit) nodes in the **GitLens** & **GitLens Results** views
1818
- Adds *Delete Tag (via Terminal)* command (`gitlens.explorers.terminalDeleteTag`) to tag nodes in the **GitLens** view
19+
- Adds a helpful notification the first time the **GitLens Results** view is shown
1920

2021
### Changed
2122
- Renames *Rebase Commit (via Terminal)* command (`gitlens.terminalRebaseCommit`) to *Rebase to Commit (via Terminal)*

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@
10281028
"suppressGitVersionWarning": false,
10291029
"suppressLineUncommittedWarning": false,
10301030
"suppressNoRepositoryWarning": false,
1031+
"suppressResultsExplorerNotice": false,
10311032
"suppressUpdateNotice": false,
10321033
"suppressWelcomeNotice": false
10331034
},
@@ -1056,6 +1057,10 @@
10561057
"type": "boolean",
10571058
"default": false
10581059
},
1060+
"suppressResultsExplorerNotice": {
1061+
"type": "boolean",
1062+
"default": false
1063+
},
10591064
"suppressUpdateNotice": {
10601065
"type": "boolean",
10611066
"default": false

src/configuration.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export interface IAdvancedConfig {
121121
suppressGitVersionWarning: boolean,
122122
suppressLineUncommittedWarning: boolean,
123123
suppressNoRepositoryWarning: boolean,
124+
suppressResultsExplorerNotice: boolean,
124125
suppressUpdateNotice: boolean,
125126
suppressWelcomeNotice: boolean
126127
};
@@ -506,6 +507,7 @@ const emptyConfig: IConfig = {
506507
suppressGitVersionWarning: false,
507508
suppressLineUncommittedWarning: false,
508509
suppressNoRepositoryWarning: false,
510+
suppressResultsExplorerNotice: false,
509511
suppressUpdateNotice: false,
510512
suppressWelcomeNotice: false
511513
},

src/messages.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export enum SuppressedMessages {
1212
GitVersionWarning = 'suppressGitVersionWarning',
1313
LineUncommittedWarning = 'suppressLineUncommittedWarning',
1414
NoRepositoryWarning = 'suppressNoRepositoryWarning',
15+
ResultsExplorerNotice = 'suppressResultsExplorerNotice',
1516
UpdateNotice = 'suppressUpdateNotice',
1617
WelcomeNotice = 'suppressWelcomeNotice'
1718
}
@@ -39,8 +40,12 @@ export class Messages {
3940
return Messages.showMessage('warn', `${message}. No repository could be found`, SuppressedMessages.NoRepositoryWarning);
4041
}
4142

43+
static showResultExplorerInfoMessage(): Promise<string | undefined> {
44+
return Messages.showMessage('info', `If you can't find your results, click on "GITLENS RESULTS" at the bottom of the Explorer view`, SuppressedMessages.ResultsExplorerNotice, null);
45+
}
46+
4247
static showUnsupportedGitVersionErrorMessage(version: string): Promise<string | undefined> {
43-
return Messages.showMessage('error', `GitLens requires a newer version of Git (>= 2.2.0) than is currently installed (${version}). Please install a more recent version of Git.`, SuppressedMessages.GitVersionWarning);
48+
return Messages.showMessage('error', `GitLens requires a newer version of Git (>= 2.2.0) than is currently installed (${version}). Please install a more recent version of Git`, SuppressedMessages.GitVersionWarning);
4449
}
4550

4651
static async showUpdateMessage(version: string): Promise<string | undefined> {
@@ -54,7 +59,7 @@ export class Messages {
5459

5560
static async showWelcomeMessage(): Promise<string | undefined> {
5661
const viewDocs = 'View Docs';
57-
const result = await Messages.showMessage('info', `Thank you for choosing GitLens! GitLens is powerful, feature rich, and highly configurable, so please be sure to view the docs and tailor it to suit your needs.`, SuppressedMessages.WelcomeNotice, null, viewDocs);
62+
const result = await Messages.showMessage('info', `Thank you for choosing GitLens! GitLens is powerful, feature rich, and highly configurable, so please be sure to view the docs and tailor it to suit your needs`, SuppressedMessages.WelcomeNotice, null, viewDocs);
5863
if (result === viewDocs) {
5964
commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens'));
6065
}

src/views/resultsExplorer.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { RefreshNodeCommandArgs } from './explorerCommands';
88
import { CommitResultsNode, CommitsResultsNode, ComparisionResultsNode, ExplorerNode, MessageNode, RefreshReason, ResourceType } from './explorerNodes';
99
import { clearGravatarCache, GitLog, GitLogCommit } from '../gitService';
1010
import { Logger } from '../logger';
11+
import { Messages } from '../messages';
1112

1213
export * from './explorerNodes';
1314

@@ -115,12 +116,12 @@ export class ResultsExplorer implements TreeDataProvider<ExplorerNode> {
115116

116117
async showComparisonInResults(repoPath: string, ref1: string, ref2: string) {
117118
this.addResults(new ComparisionResultsNode(repoPath, ref1, ref2, this));
118-
setCommandContext(CommandContext.ResultsExplorer, true);
119+
this.showResults();
119120
}
120121

121122
showCommitInResults(commit: GitLogCommit) {
122123
this.addResults(new CommitResultsNode(commit, this));
123-
setCommandContext(CommandContext.ResultsExplorer, true);
124+
this.showResults();
124125
}
125126

126127
showCommitsInResults(results: GitLog, resultsLabel: string | { label: string, resultsType?: { singular: string, plural: string } }) {
@@ -143,6 +144,11 @@ export class ResultsExplorer implements TreeDataProvider<ExplorerNode> {
143144
};
144145

145146
this.addResults(new CommitsResultsNode(results.repoPath, labelFn, Functions.seeded(query, results), this, ResourceType.SearchResults));
147+
this.showResults();
148+
}
149+
150+
private showResults() {
151+
Messages.showResultExplorerInfoMessage();
146152
setCommandContext(CommandContext.ResultsExplorer, true);
147153
}
148154

0 commit comments

Comments
 (0)