File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 22export const WEBVIEW_CHANNEL = {
33 GET_HISTORY : 'get-history' ,
44 SHOW_COMMIT_DETAILS : 'show-commit-details' ,
5+ SHOW_CHANGES_PANEL : 'show-changes-panel' ,
56} as const
67
78// vscode to webview channel
Original file line number Diff line number Diff line change @@ -39,6 +39,19 @@ function handleCommitClick(commit: Commit & { date: string }) {
3939 }
4040}
4141
42+ function handleDoubleClick() {
43+ try {
44+ if (window .vscode ) {
45+ window .vscode .postMessage ({
46+ command: WEBVIEW_CHANNEL .SHOW_CHANGES_PANEL ,
47+ })
48+ }
49+ }
50+ catch (error ) {
51+ console .error (' Error sending commit details:' , error )
52+ }
53+ }
54+
4255// Calculate branch positions and paths
4356// const COLUMN_WIDTH = 14
4457// const DOT_SIZE = 6
@@ -107,6 +120,7 @@ onUnmounted(() => {
107120 :key =" commit.hash"
108121 class =" commit-row"
109122 @click =" handleCommitClick(commit)"
123+ @dblclick =" handleDoubleClick"
110124 >
111125 <td class =" hash-col" >
112126 {{ commit.hash.substring(0, 7) }}
Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ export class GitPanelViewProvider implements WebviewViewProvider {
8686 case WEBVIEW_CHANNEL . SHOW_COMMIT_DETAILS :
8787 try {
8888 this . gitChangesProvider . refresh ( message . commitHash )
89- await commands . executeCommand ( 'git.showCommitDetails' , message . commitHash )
9089 }
9190 catch ( error ) {
9291 webviewView . webview . postMessage ( {
@@ -95,6 +94,9 @@ export class GitPanelViewProvider implements WebviewViewProvider {
9594 } )
9695 }
9796 break
97+ case WEBVIEW_CHANNEL . SHOW_CHANGES_PANEL :
98+ await commands . executeCommand ( 'git-panel.changes.focus' )
99+ break
98100
99101 case 'clearHistory' :
100102 this . storageService . clearCommits ( )
You can’t perform that action at this time.
0 commit comments