@@ -706,6 +706,7 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
706706 this . copyWorkingChangesToWorktree ,
707707 ) ,
708708 this . host . registerWebviewCommand ( 'gitlens.ai.generateCommitMessage:graph' , this . generateCommitMessage ) ,
709+ this . host . registerWebviewCommand ( 'gitlens.ai.explainUnpushed:graph' , this . aiExplainUnpushed ) ,
709710 this . host . registerWebviewCommand ( 'gitlens.ai.explainBranch:graph' , this . explainBranch ) ,
710711 this . host . registerWebviewCommand ( 'gitlens.ai.explainCommit:graph' , this . explainCommit ) ,
711712 this . host . registerWebviewCommand ( 'gitlens.ai.explainStash:graph' , this . explainStash ) ,
@@ -3897,6 +3898,25 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
38973898 } ) ;
38983899 }
38993900
3901+ @log ( )
3902+ private aiExplainUnpushed ( item ?: GraphItemContext ) {
3903+ if ( isGraphItemRefContext ( item , 'branch' ) ) {
3904+ const { ref } = item . webviewItemValue ;
3905+
3906+ if ( ! ref . upstream ) {
3907+ return Promise . resolve ( ) ;
3908+ }
3909+
3910+ return executeCommand < ExplainBranchCommandArgs > ( 'gitlens.ai.explainBranch' , {
3911+ repoPath : ref . repoPath ,
3912+ ref : ref . ref ,
3913+ baseBranch : ref . upstream . name ,
3914+ source : { source : 'graph' , context : { type : 'branch' } } ,
3915+ } ) ;
3916+ }
3917+
3918+ return Promise . resolve ( ) ;
3919+ }
39003920 @log ( )
39013921 private explainBranch ( item ?: GraphItemContext ) {
39023922 const ref = this . getGraphItemRef ( item , 'branch' ) ;
0 commit comments