@@ -29,6 +29,7 @@ import { RepositoryChange, RepositoryChangeComparisonMode } from '../../git/mode
2929import { uncommitted } from '../../git/models/revision' ;
3030import type { GitStatus } from '../../git/models/status' ;
3131import type { GitWorktree } from '../../git/models/worktree' ;
32+ import { remotesSupportTitleOnPullRequestCreation } from '../../git/remotes/remoteProvider' ;
3233import { getAssociatedIssuesForBranch } from '../../git/utils/-webview/branch.issue.utils' ;
3334import { getBranchTargetInfo } from '../../git/utils/-webview/branch.utils' ;
3435import { getReferenceFromBranch } from '../../git/utils/-webview/reference.utils' ;
@@ -756,10 +757,15 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
756757 const activeBranch = branches . find (
757758 branch => this . getBranchOverviewType ( branch , worktreesByBranch ) === 'active' ,
758759 ) ! ;
760+ const aiPullRequestCreationAvailable =
761+ ( await repo . git . remotes ( ) . getBestRemotesWithProviders ( ) ) . find ( r =>
762+ remotesSupportTitleOnPullRequestCreation . includes ( r . provider . id ) ,
763+ ) != null ;
759764
760765 const isPro = await this . isSubscriptionPro ( ) ;
761766 const [ activeOverviewBranch ] = getOverviewBranchesCore (
762767 [ activeBranch ] ,
768+ aiPullRequestCreationAvailable ,
763769 branchesAndWorktrees . worktreesByBranch ,
764770 isPro ,
765771 this . container ,
@@ -791,6 +797,10 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
791797
792798 const forceRepo = this . _invalidateOverview === 'repo' ;
793799 const branchesAndWorktrees = await this . getBranchesData ( repo , forceRepo ) ;
800+ const aiPullRequestCreationAvailable =
801+ ( await repo . git . remotes ( ) . getBestRemotesWithProviders ( ) ) . find ( r =>
802+ remotesSupportTitleOnPullRequestCreation . includes ( r . provider . id ) ,
803+ ) != null ;
794804
795805 const recentBranches = branchesAndWorktrees . branches . filter (
796806 branch => this . getBranchOverviewType ( branch , branchesAndWorktrees . worktreesByBranch ) === 'recent' ,
@@ -823,14 +833,21 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
823833 const isPro = await this . isSubscriptionPro ( ) ;
824834 const recentOverviewBranches = getOverviewBranchesCore (
825835 recentBranches ,
836+ aiPullRequestCreationAvailable ,
826837 branchesAndWorktrees . worktreesByBranch ,
827838 isPro ,
828839 this . container ,
829840 ) ;
830841 const staleOverviewBranches =
831842 staleBranches == null
832843 ? undefined
833- : getOverviewBranchesCore ( staleBranches , branchesAndWorktrees . worktreesByBranch , isPro , this . container ) ;
844+ : getOverviewBranchesCore (
845+ staleBranches ,
846+ aiPullRequestCreationAvailable ,
847+ branchesAndWorktrees . worktreesByBranch ,
848+ isPro ,
849+ this . container ,
850+ ) ;
834851
835852 // TODO: revisit invalidation
836853 if ( ! forceRepo ) {
@@ -1460,6 +1477,7 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
14601477
14611478function getOverviewBranchesCore (
14621479 branches : GitBranch [ ] ,
1480+ aiPullRequestCreationAvailable : boolean ,
14631481 worktreesByBranch : Map < string , GitWorktree > ,
14641482 isPro : boolean ,
14651483 container : Container ,
@@ -1518,6 +1536,7 @@ function getOverviewBranchesCore(
15181536 reference : getReferenceFromBranch ( branch ) ,
15191537 repoPath : branch . repoPath ,
15201538 id : branch . id ,
1539+ aiPullRequestCreationAvailable : aiPullRequestCreationAvailable ,
15211540 name : branch . name ,
15221541 opened : isActive ,
15231542 timestamp : timestamp ,
0 commit comments