@@ -993,6 +993,8 @@ export class GlBranchCard extends GlBranchCardBase {
993993 protected getBranchActions ( ) : TemplateResult [ ] {
994994 const actions = [ ] ;
995995
996+ const aiEnabled = this . _homeState . orgSettings . ai && this . _homeState . aiEnabled ;
997+
996998 if ( this . branch . worktree ) {
997999 actions . push (
9981000 html `< action-item
@@ -1002,29 +1004,31 @@ export class GlBranchCard extends GlBranchCardBase {
10021004 > </ action-item > ` ,
10031005 ) ;
10041006
1005- const hasWip =
1006- this . wip ?. workingTreeState != null
1007- ? this . wip . workingTreeState . added +
1008- this . wip . workingTreeState . changed +
1009- this . wip . workingTreeState . deleted >
1010- 0
1011- : false ;
1012- if ( hasWip ) {
1013- actions . push (
1014- html `< action-item
1015- label ="Explain Working Changes (Preview) "
1016- icon ="sparkle "
1017- href =${ this . createCommandLink ( 'gitlens.ai.explainWip:home' ) }
1018- > </ action-item > ` ,
1019- ) ;
1020- } else {
1021- actions . push (
1022- html `< action-item
1023- label ="Explain Branch (Preview) "
1024- icon ="sparkle "
1025- href =${ this . createCommandLink ( 'gitlens.ai.explainBranch:home' ) }
1026- > </ action-item > ` ,
1027- ) ;
1007+ if ( aiEnabled ) {
1008+ const hasWip =
1009+ this . wip ?. workingTreeState != null
1010+ ? this . wip . workingTreeState . added +
1011+ this . wip . workingTreeState . changed +
1012+ this . wip . workingTreeState . deleted >
1013+ 0
1014+ : false ;
1015+ if ( hasWip ) {
1016+ actions . push (
1017+ html `< action-item
1018+ label ="Explain Working Changes (Preview) "
1019+ icon ="sparkle "
1020+ href =${ this . createCommandLink ( 'gitlens.ai.explainWip:home' ) }
1021+ > </ action-item > ` ,
1022+ ) ;
1023+ } else {
1024+ actions . push (
1025+ html `< action-item
1026+ label ="Explain Branch (Preview) "
1027+ icon ="sparkle "
1028+ href =${ this . createCommandLink ( 'gitlens.ai.explainBranch:home' ) }
1029+ > </ action-item > ` ,
1030+ ) ;
1031+ }
10281032 }
10291033 } else {
10301034 actions . push (
@@ -1034,13 +1038,16 @@ export class GlBranchCard extends GlBranchCardBase {
10341038 href =${ this . createCommandLink ( 'gitlens.home.switchToBranch' ) }
10351039 > </ action-item > ` ,
10361040 ) ;
1037- actions . push (
1038- html `< action-item
1039- label ="Explain Branch (Preview) "
1040- icon ="sparkle "
1041- href =${ this . createCommandLink ( 'gitlens.ai.explainBranch:home' ) }
1042- > </ action-item > ` ,
1043- ) ;
1041+
1042+ if ( aiEnabled ) {
1043+ actions . push (
1044+ html `< action-item
1045+ label ="Explain Branch (Preview) "
1046+ icon ="sparkle "
1047+ href =${ this . createCommandLink ( 'gitlens.ai.explainBranch:home' ) }
1048+ > </ action-item > ` ,
1049+ ) ;
1050+ }
10441051 }
10451052
10461053 // branch actions
0 commit comments