@@ -706,6 +706,7 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
706
706
this . copyWorkingChangesToWorktree ,
707
707
) ,
708
708
this . host . registerWebviewCommand ( 'gitlens.ai.generateCommitMessage:graph' , this . generateCommitMessage ) ,
709
+ this . host . registerWebviewCommand ( 'gitlens.ai.explainUnpushed:graph' , this . aiExplainUnpushed ) ,
709
710
this . host . registerWebviewCommand ( 'gitlens.ai.explainBranch:graph' , this . explainBranch ) ,
710
711
this . host . registerWebviewCommand ( 'gitlens.ai.explainCommit:graph' , this . explainCommit ) ,
711
712
this . host . registerWebviewCommand ( 'gitlens.ai.explainStash:graph' , this . explainStash ) ,
@@ -3897,6 +3898,25 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
3897
3898
} ) ;
3898
3899
}
3899
3900
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
+ }
3900
3920
@log ( )
3901
3921
private explainBranch ( item ?: GraphItemContext ) {
3902
3922
const ref = this . getGraphItemRef ( item , 'branch' ) ;
0 commit comments