Skip to content

Commit 27ab08c

Browse files
committed
Reworks many quickpick menus
1 parent b040337 commit 27ab08c

33 files changed

+615
-439
lines changed

src/commands/diffWithRef.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class DiffWithRefCommand extends ActiveEditorCommand {
3636
if (!gitUri.repoPath) return Messages.showNoRepositoryWarningMessage('Unable to open file compare');
3737

3838
const pick = await new ReferencesQuickPick(gitUri.repoPath).show(
39-
`Compare ${paths.basename(gitUri.fsPath)} with${GlyphChars.Ellipsis}`,
39+
`Compare ${gitUri.getFormattedPath()} with${GlyphChars.Ellipsis}`,
4040
{
4141
allowEnteringRefs: true,
4242
checkmarks: false,

src/commands/diffWithRevision.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand {
6565
const npc = new CommandQuickPickItem(
6666
{
6767
label: '$(arrow-right) Show Next Commits',
68-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows ${log.maxCount} newer commits`
68+
description: `shows ${log.maxCount} newer commits`
6969
},
7070
Commands.DiffWithRevision,
7171
[uri, commandArgs]
@@ -77,7 +77,7 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand {
7777
previousPageCommand = new CommandQuickPickItem(
7878
{
7979
label: '$(arrow-left) Show Previous Commits',
80-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows ${log.maxCount} older commits`
80+
description: `shows ${log.maxCount} older commits`
8181
},
8282
Commands.DiffWithRevision,
8383
[new GitUri(uri, last), commandArgs]
@@ -90,9 +90,7 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand {
9090
const currentCommand = new CommandQuickPickItem(
9191
{
9292
label: `go back ${GlyphChars.ArrowBack}`,
93-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to history of ${
94-
GlyphChars.Space
95-
}$(file-text) ${gitUri.getFormattedPath()}${
93+
description: `to history of ${gitUri.getFormattedPath()}${
9694
args.reference
9795
? ` from ${GlyphChars.Space}${icon}${args.reference.name}`
9896
: gitUri.sha
@@ -115,7 +113,7 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand {
115113
? new CommandQuickPickItem(
116114
{
117115
label: '$(sync) Show All Commits',
118-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} this may take a while`
116+
description: 'this may take a while'
119117
},
120118
Commands.DiffWithRevision,
121119
[uri, commandArgs]
@@ -138,7 +136,7 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand {
138136

139137
if (pick instanceof CommandQuickPickItem) return pick.execute();
140138

141-
const ref = pick.commit.sha;
139+
const ref = pick.item.sha;
142140

143141
const diffArgs: DiffWithCommandArgs = {
144142
repoPath: gitUri.repoPath,

src/commands/openFileRevision.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand {
9696
const npc = new CommandQuickPickItem(
9797
{
9898
label: '$(arrow-right) Show Next Commits',
99-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows ${log.maxCount} newer commits`
99+
description: `shows ${log.maxCount} newer commits`
100100
},
101101
Commands.OpenFileRevision,
102102
[uri, commandArgs]
@@ -108,7 +108,7 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand {
108108
previousPageCommand = new CommandQuickPickItem(
109109
{
110110
label: '$(arrow-left) Show Previous Commits',
111-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows ${log.maxCount} older commits`
111+
description: `shows ${log.maxCount} older commits`
112112
},
113113
Commands.OpenFileRevision,
114114
[new GitUri(uri, last), commandArgs]
@@ -125,9 +125,7 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand {
125125
const currentCommand = new CommandQuickPickItem(
126126
{
127127
label: `go back ${GlyphChars.ArrowBack}`,
128-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to history of ${
129-
GlyphChars.Space
130-
}$(file-text) ${gitUri.getFormattedPath()}${
128+
description: `to history of ${gitUri.getFormattedPath()}${
131129
args.reference
132130
? ` from ${GlyphChars.Space}${icon}${args.reference.name}`
133131
: gitUri.sha
@@ -150,7 +148,7 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand {
150148
? new CommandQuickPickItem(
151149
{
152150
label: '$(sync) Show All Commits',
153-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} this may take a while`
151+
description: 'this may take a while'
154152
},
155153
Commands.OpenFileRevision,
156154
[uri, commandArgs]
@@ -173,7 +171,7 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand {
173171

174172
if (pick instanceof CommandQuickPickItem) return pick.execute();
175173

176-
args.uri = GitUri.toRevisionUri(pick.commit.sha, pick.commit.uri.fsPath, pick.commit.repoPath);
174+
args.uri = GitUri.toRevisionUri(pick.item.sha, pick.item.uri.fsPath, pick.item.repoPath);
177175
}
178176

179177
if (args.line !== undefined && args.line !== 0) {

src/commands/searchCommits.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { GitRepoSearchBy, GitService } from '../git/gitService';
66
import { Logger } from '../logger';
77
import { Messages } from '../messages';
88
import { CommandQuickPickItem, CommitsQuickPick, ShowCommitSearchResultsInViewQuickPickItem } from '../quickpicks';
9-
import { Iterables, Strings } from '../system';
9+
import { Iterables } from '../system';
1010
import { SearchResultsCommitsNode } from '../views/nodes';
1111
import {
1212
ActiveEditorCachedCommand,
@@ -183,7 +183,7 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand {
183183
new CommandQuickPickItem(
184184
{
185185
label: `go back ${GlyphChars.ArrowBack}`,
186-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to commit search`
186+
description: 'to commit search'
187187
},
188188
Commands.SearchCommits,
189189
[uri, originalArgs]
@@ -198,7 +198,7 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand {
198198
? new CommandQuickPickItem(
199199
{
200200
label: '$(sync) Show All Commits',
201-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} this may take a while`
201+
description: 'this may take a while'
202202
},
203203
Commands.SearchCommits,
204204
[uri, { ...args, maxCount: 0, goBackCommand: goBackCommand }]
@@ -215,7 +215,7 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand {
215215

216216
if (pick instanceof CommandQuickPickItem) return pick.execute();
217217

218-
commit = pick.commit;
218+
commit = pick.item;
219219
goBackCommand = undefined;
220220
}
221221
else {
@@ -230,7 +230,7 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand {
230230
new CommandQuickPickItem(
231231
{
232232
label: `go back ${GlyphChars.ArrowBack}`,
233-
description: `${Strings.pad(GlyphChars.Dash, 2, 2)} to search for ${searchLabel}`
233+
description: `to search for ${searchLabel}`
234234
},
235235
Commands.SearchCommits,
236236
[uri, args]

src/commands/showQuickBranchHistory.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { GitLog, GitUri } from '../git/gitService';
66
import { Logger } from '../logger';
77
import { Messages } from '../messages';
88
import { BranchHistoryQuickPick, CommandQuickPickItem, ReferencesQuickPick } from '../quickpicks';
9-
import { Strings } from '../system';
109
import { ActiveEditorCachedCommand, command, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common';
1110
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
1211

@@ -51,7 +50,7 @@ export class ShowQuickBranchHistoryCommand extends ActiveEditorCachedCommand {
5150
goBackCommand = new CommandQuickPickItem(
5251
{
5352
label: `go back ${GlyphChars.ArrowBack}`,
54-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to which repository`
53+
description: 'to which repository'
5554
},
5655
Commands.ShowQuickBranchHistory,
5756
[uri, args]
@@ -103,21 +102,19 @@ export class ShowQuickBranchHistoryCommand extends ActiveEditorCachedCommand {
103102
const currentCommand = new CommandQuickPickItem(
104103
{
105104
label: `go back ${GlyphChars.ArrowBack}`,
106-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to ${GlyphChars.Space}$(git-branch) ${
107-
args.branch
108-
} history`
105+
description: `to history of ${GlyphChars.Space}$(git-branch) ${args.branch}`
109106
},
110107
Commands.ShowQuickBranchHistory,
111108
[uri, { ...args }]
112109
);
113110

114111
const commandArgs: ShowQuickCommitDetailsCommandArgs = {
115-
sha: pick.commit.sha,
116-
commit: pick.commit,
112+
sha: pick.item.sha,
113+
commit: pick.item,
117114
repoLog: args.log,
118115
goBackCommand: currentCommand
119116
};
120-
return commands.executeCommand(Commands.ShowQuickCommitDetails, pick.commit.toGitUri(), commandArgs);
117+
return commands.executeCommand(Commands.ShowQuickCommitDetails, pick.item.toGitUri(), commandArgs);
121118
}
122119
catch (ex) {
123120
Logger.error(ex, 'ShowQuickBranchHistoryCommand');

src/commands/showQuickCommitDetails.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { GitCommit, GitLog, GitLogCommit, GitRepoSearchBy, GitUri } from '../git
66
import { Logger } from '../logger';
77
import { Messages } from '../messages';
88
import { CommandQuickPickItem, CommitQuickPick, CommitWithFileStatusQuickPickItem } from '../quickpicks';
9-
import { Strings } from '../system';
109
import {
1110
ActiveEditorCachedCommand,
1211
command,
@@ -136,7 +135,7 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCachedCommand {
136135
args.goBackCommand = new CommandQuickPickItem(
137136
{
138137
label: `go back ${GlyphChars.ArrowBack}`,
139-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to ${branch.name} history`
138+
description: `to ${branch.name} history`
140139
},
141140
Commands.ShowQuickCurrentBranchHistory,
142141
[args.commit.toGitUri()]
@@ -148,9 +147,7 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCachedCommand {
148147
const currentCommand = new CommandQuickPickItem(
149148
{
150149
label: `go back ${GlyphChars.ArrowBack}`,
151-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to details of ${
152-
GlyphChars.Space
153-
}$(git-commit) ${args.commit.shortSha}`
150+
description: `to details of ${GlyphChars.Space}$(git-commit) ${args.commit.shortSha}`
154151
},
155152
Commands.ShowQuickCommitDetails,
156153
[args.commit.toGitUri(), args]

src/commands/showQuickCommitFileDetails.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
'use strict';
2-
import * as paths from 'path';
32
import { TextEditor, Uri, window } from 'vscode';
43
import { GlyphChars } from '../constants';
54
import { Container } from '../container';
65
import { GitCommit, GitLog, GitLogCommit, GitService, GitUri } from '../git/gitService';
76
import { Logger } from '../logger';
87
import { Messages } from '../messages';
98
import { CommandQuickPickItem, CommitFileQuickPick } from '../quickpicks';
10-
import { Strings } from '../system';
119
import {
1210
ActiveEditorCachedCommand,
1311
command,
@@ -138,9 +136,7 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
138136
args.goBackCommand = new CommandQuickPickItem(
139137
{
140138
label: `go back ${GlyphChars.ArrowBack}`,
141-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to details of ${
142-
GlyphChars.Space
143-
}$(git-commit) ${shortSha}`
139+
description: `to details of ${GlyphChars.Space}$(git-commit) ${shortSha}`
144140
},
145141
Commands.ShowQuickCommitDetails,
146142
[args.commit.toGitUri(), commandArgs]
@@ -151,9 +147,7 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
151147
const currentCommand = new CommandQuickPickItem(
152148
{
153149
label: `go back ${GlyphChars.ArrowBack}`,
154-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to details of ${
155-
GlyphChars.Space
156-
}$(file-text) ${paths.basename(args.commit.fileName)} in ${
150+
description: `to details of ${args.commit.getFormattedPath()} from ${
157151
GlyphChars.Space
158152
}$(git-commit) ${shortSha}`
159153
},

src/commands/showQuickFileHistory.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict';
2-
import * as paths from 'path';
32
import { commands, Range, TextEditor, Uri, window } from 'vscode';
43
import { GlyphChars } from '../constants';
54
import { Container } from '../container';
@@ -89,7 +88,7 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCachedCommand {
8988
const npc = new CommandQuickPickItem(
9089
{
9190
label: '$(arrow-right) Show Next Commits',
92-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows ${args.log.maxCount} newer commits`
91+
description: `shows ${args.log.maxCount} newer commits`
9392
},
9493
Commands.ShowQuickFileHistory,
9594
[gitUri, commandArgs]
@@ -101,9 +100,7 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCachedCommand {
101100
previousPageCommand = new CommandQuickPickItem(
102101
{
103102
label: '$(arrow-left) Show Previous Commits',
104-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows ${
105-
args.log.maxCount
106-
} older commits`
103+
description: `shows ${args.log.maxCount} older commits`
107104
},
108105
Commands.ShowQuickFileHistory,
109106
[new GitUri(uri, last), commandArgs]
@@ -116,9 +113,7 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCachedCommand {
116113
const currentCommand = new CommandQuickPickItem(
117114
{
118115
label: `go back ${GlyphChars.ArrowBack}`,
119-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to history of ${
120-
GlyphChars.Space
121-
}$(file-text) ${paths.basename(gitUri.fsPath)}${
116+
description: `to history of ${gitUri.getFormattedPath()}${
122117
args.reference
123118
? ` from ${GlyphChars.Space}${icon}${args.reference.name}`
124119
: gitUri.sha
@@ -141,7 +136,7 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCachedCommand {
141136
? new CommandQuickPickItem(
142137
{
143138
label: '$(sync) Show All Commits',
144-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} this may take a while`
139+
description: 'this may take a while'
145140
},
146141
Commands.ShowQuickFileHistory,
147142
[uri, { ...args, log: undefined, maxCount: 0 }]
@@ -174,13 +169,13 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCachedCommand {
174169
if (pick instanceof CommandQuickPickItem) return pick.execute();
175170

176171
const commandArgs: ShowQuickCommitFileDetailsCommandArgs = {
177-
commit: pick.commit,
172+
commit: pick.item,
178173
fileLog: args.log,
179-
sha: pick.commit.sha,
174+
sha: pick.item.sha,
180175
goBackCommand: currentCommand
181176
};
182177

183-
return commands.executeCommand(Commands.ShowQuickCommitFileDetails, pick.commit.toGitUri(), commandArgs);
178+
return commands.executeCommand(Commands.ShowQuickCommitFileDetails, pick.item.toGitUri(), commandArgs);
184179
}
185180
catch (ex) {
186181
Logger.error(ex, 'ShowQuickFileHistoryCommand');

src/commands/showQuickStashList.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Container } from '../container';
55
import { Logger } from '../logger';
66
import { Messages } from '../messages';
77
import { CommandQuickPickItem, StashListQuickPick } from '../quickpicks';
8-
import { Strings } from '../system';
98
import { ActiveEditorCachedCommand, command, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common';
109
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
1110

@@ -44,7 +43,7 @@ export class ShowQuickStashListCommand extends ActiveEditorCachedCommand {
4443
const currentCommand = new CommandQuickPickItem(
4544
{
4645
label: `go back ${GlyphChars.ArrowBack}`,
47-
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to stashed changes`
46+
description: 'to stashed changes'
4847
},
4948
Commands.ShowQuickStashList,
5049
[uri, currentCommandArgs]
@@ -62,11 +61,11 @@ export class ShowQuickStashListCommand extends ActiveEditorCachedCommand {
6261
if (pick instanceof CommandQuickPickItem) return pick.execute();
6362

6463
const commandArgs: ShowQuickCommitDetailsCommandArgs = {
65-
commit: pick.commit,
66-
sha: pick.commit.sha,
64+
commit: pick.item,
65+
sha: pick.item.sha,
6766
goBackCommand: currentCommand
6867
};
69-
return commands.executeCommand(Commands.ShowQuickCommitDetails, pick.commit.toGitUri(), commandArgs);
68+
return commands.executeCommand(Commands.ShowQuickCommitDetails, pick.item.toGitUri(), commandArgs);
7069
}
7170
catch (ex) {
7271
Logger.error(ex, 'ShowQuickStashListCommand');

0 commit comments

Comments
 (0)