Skip to content

Commit

Permalink
Changes quick pick "eye" to open commit details
Browse files Browse the repository at this point in the history
Changes "search" to reveal in the side bar
Adds "Show Details" to commit/commit file quick pick
  • Loading branch information
eamodio committed Aug 27, 2022
1 parent 84dff52 commit 16cdd10
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 192 deletions.
5 changes: 4 additions & 1 deletion src/commands/git/log.ts
Expand Up @@ -191,7 +191,10 @@ export class LogGitCommand extends QuickCommand<State> {

let result: StepResult<ReturnType<typeof getSteps>>;
if (state.openPickInView) {
void GitActions.Commit.showDetailsView(state.reference as GitCommit);
void GitActions.Commit.showDetailsView(state.reference as GitCommit, {
pin: false,
preserveFocus: false,
});
result = StepResult.Break;
} else {
result = yield* getSteps(
Expand Down
5 changes: 4 additions & 1 deletion src/commands/git/search.ts
Expand Up @@ -245,7 +245,10 @@ export class SearchGitCommand extends QuickCommand<State> {

let result: StepResult<ReturnType<typeof getSteps>>;
if (state.openPickInView) {
void GitActions.Commit.showDetailsView(context.commit);
void GitActions.Commit.showDetailsView(context.commit, {
pin: false,
preserveFocus: false,
});
result = StepResult.Break;
} else {
result = yield* getSteps(
Expand Down
18 changes: 14 additions & 4 deletions src/commands/git/stash.ts
Expand Up @@ -364,9 +364,14 @@ export class StashGitCommand extends QuickCommand<State> {
undefined,
{
placeholder: `Confirm ${context.title}`,
additionalButtons: [QuickCommandButtons.RevealInSideBar],
additionalButtons: [QuickCommandButtons.ShowDetailsView, QuickCommandButtons.RevealInSideBar],
onDidClickButton: (quickpick, button) => {
if (button === QuickCommandButtons.RevealInSideBar) {
if (button === QuickCommandButtons.ShowDetailsView) {
void GitActions.Stash.showDetailsView(state.reference, {
pin: false,
preserveFocus: true,
});
} else if (button === QuickCommandButtons.RevealInSideBar) {
void GitActions.Stash.reveal(state.reference, {
select: true,
expand: true,
Expand Down Expand Up @@ -423,9 +428,14 @@ export class StashGitCommand extends QuickCommand<State> {
undefined,
{
placeholder: `Confirm ${context.title}`,
additionalButtons: [QuickCommandButtons.RevealInSideBar],
additionalButtons: [QuickCommandButtons.ShowDetailsView, QuickCommandButtons.RevealInSideBar],
onDidClickButton: (quickpick, button) => {
if (button === QuickCommandButtons.RevealInSideBar) {
if (button === QuickCommandButtons.ShowDetailsView) {
void GitActions.Stash.showDetailsView(state.reference, {
pin: false,
preserveFocus: true,
});
} else if (button === QuickCommandButtons.RevealInSideBar) {
void GitActions.Stash.reveal(state.reference, {
select: true,
expand: true,
Expand Down
8 changes: 4 additions & 4 deletions src/commands/quickCommand.buttons.ts
Expand Up @@ -113,14 +113,14 @@ export namespace QuickCommandButtons {
tooltip: 'Open in New Window',
};

export const RevealInSideBar: QuickInputButton = {
export const ShowDetailsView: QuickInputButton = {
iconPath: new ThemeIcon('eye'),
tooltip: 'Reveal in Side Bar',
tooltip: 'Show Details',
};

export const SearchInSideBar: QuickInputButton = {
export const RevealInSideBar: QuickInputButton = {
iconPath: new ThemeIcon('search'),
tooltip: 'Search in Side Bar',
tooltip: 'Reveal in Side Bar',
};

export const ShowResultsInSideBar: QuickInputButton = {
Expand Down

0 comments on commit 16cdd10

Please sign in to comment.