@@ -719,6 +719,7 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
719719 this . copyWorkingChangesToWorktree ,
720720 ) ,
721721 this . host . registerWebviewCommand ( 'gitlens.ai.generateCommitMessage:graph' , this . generateCommitMessage ) ,
722+ this . host . registerWebviewCommand ( 'gitlens.ai.explainUnpushed:graph' , this . aiExplainUnpushed ) ,
722723 this . host . registerWebviewCommand ( 'gitlens.ai.explainBranch:graph' , this . explainBranch ) ,
723724 this . host . registerWebviewCommand ( 'gitlens.ai.explainCommit:graph' , this . explainCommit ) ,
724725 this . host . registerWebviewCommand ( 'gitlens.ai.explainStash:graph' , this . explainStash ) ,
@@ -3990,6 +3991,25 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
39903991 } ) ;
39913992 }
39923993
3994+ @log ( )
3995+ private aiExplainUnpushed ( item ?: GraphItemContext ) {
3996+ if ( isGraphItemRefContext ( item , 'branch' ) ) {
3997+ const { ref } = item . webviewItemValue ;
3998+
3999+ if ( ! ref . upstream ) {
4000+ return Promise . resolve ( ) ;
4001+ }
4002+
4003+ return executeCommand < ExplainBranchCommandArgs > ( 'gitlens.ai.explainBranch' , {
4004+ repoPath : ref . repoPath ,
4005+ ref : ref . ref ,
4006+ baseBranch : ref . upstream . name ,
4007+ source : { source : 'graph' , context : { type : 'branch' } } ,
4008+ } ) ;
4009+ }
4010+
4011+ return Promise . resolve ( ) ;
4012+ }
39934013 @log ( )
39944014 private explainBranch ( item ?: GraphItemContext ) {
39954015 const ref = this . getGraphItemRef ( item , 'branch' ) ;
0 commit comments