diff --git a/package.json b/package.json index 8dcf784..9811810 100644 --- a/package.json +++ b/package.json @@ -6345,6 +6345,12 @@ "icon": "$(copy)" }, { + "command": "gitlens.graph.showInDetailsView", + "title": "Open Details", + "category": "GitLens", + "icon": "$(eye)" + }, + { "command": "gitlens.graph.openCommitOnRemote", "title": "Open Commit on Remote", "category": "GitLens", @@ -8309,6 +8315,10 @@ "when": "false" }, { + "command": "gitlens.graph.showInDetailsView", + "when": "false" + }, + { "command": "gitlens.graph.openCommitOnRemote", "when": "false" }, @@ -10937,6 +10947,11 @@ "group": "1_gitlens_actions_1@2" }, { + "command": "gitlens.graph.showInDetailsView", + "when": "webviewItem =~ /gitlens:(commit|stash)\\b/", + "group": "3_gitlens_explore@0" + }, + { "command": "gitlens.graph.openCommitOnRemote", "when": "gitlens:hasRemotes && webviewItem =~ /gitlens:commit\\b/", "group": "3_gitlens_explore@2", diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index 6e173e0..05a9677 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -22,6 +22,7 @@ import type { CopyShaToClipboardCommandArgs, OpenBranchOnRemoteCommandArgs, OpenCommitOnRemoteCommandArgs, + ShowCommitsInViewCommandArgs, } from '../../../commands'; import { parseCommandContext } from '../../../commands/base'; import { GitActions } from '../../../commands/gitCommands.actions'; @@ -294,6 +295,7 @@ export class GraphWebview extends WebviewBase { registerCommand('gitlens.graph.cherryPick', this.cherryPick, this), registerCommand('gitlens.graph.copyRemoteCommitUrl', item => this.openCommitOnRemote(item, true), this), + registerCommand('gitlens.graph.showInDetailsView', this.openInDetailsView, this), registerCommand('gitlens.graph.openCommitOnRemote', this.openCommitOnRemote, this), registerCommand('gitlens.graph.rebaseOntoCommit', this.rebase, this), registerCommand('gitlens.graph.resetCommit', this.resetCommit, this), @@ -940,9 +942,7 @@ export class GraphWebview extends WebviewBase { return this.container.storage.getWorkspace('graph:columns'); } - private getColumnSettings( - columns: Record | undefined, - ): GraphColumnsSettings { + private getColumnSettings(columns: Record | undefined): GraphColumnsSettings { const columnsSettings: GraphColumnsSettings = { ...defaultGraphColumnsSettings, }; @@ -1303,6 +1303,19 @@ export class GraphWebview extends WebviewBase { } @debug() + private openInDetailsView(item: GraphItemContext) { + if (isGraphItemRefContext(item, 'revision')) { + const { ref } = item.webviewItemValue; + return executeCommand(Commands.ShowInDetailsView, { + repoPath: ref.repoPath, + refs: [ref.ref], + }); + } + + return Promise.resolve(); + } + + @debug() private openCommitOnRemote(item: GraphItemContext, clipboard?: boolean) { if (isGraphItemRefContext(item, 'revision')) { const { ref } = item.webviewItemValue;