@@ -266,7 +266,10 @@ import {
266266 selectThreadPreviewMiniPlayer ,
267267 usePreviewMiniPlayerStore ,
268268} from "../previewMiniPlayerStore" ;
269- import { pullRequestPanelContext } from "./pullRequest/pullRequestDetail.logic" ;
269+ import {
270+ pullRequestPanelContext ,
271+ threadPullRequestPanelTarget ,
272+ } from "./pullRequest/pullRequestDetail.logic" ;
270273import { PullRequestDetailPanel } from "./pullRequest/PullRequestDetailPanel" ;
271274import { PullRequestDetailGhost } from "./pullRequest/PullRequestGhosts" ;
272275import { PullRequestsUnavailableState } from "./pullRequest/PullRequestsUnavailableState" ;
@@ -6776,12 +6779,20 @@ export default function ChatView(props: ChatViewProps) {
67766779 } ,
67776780 ) ;
67786781 } , [ activeThreadReferenceCopyTarget ] ) ;
6782+ const pullRequestPanelTarget = activeThread
6783+ ? threadPullRequestPanelTarget ( {
6784+ projectId : activeThread . projectId ,
6785+ pullRequests : visiblePullRequests ,
6786+ linkedPullRequest : linkedThreadPullRequest ,
6787+ branchPullRequest : activeThreadShell ?. branchPullRequest ?? activeThread . branchPullRequest ,
6788+ } )
6789+ : null ;
67796790 const addPullRequestSurface = useCallback ( ( ) => {
6780- if ( ! supportsPullRequests || activeThreadRef === null || linkedThreadPullRequest === null )
6791+ if ( ! supportsPullRequests || activeThreadRef === null || pullRequestPanelTarget === null )
67816792 return ;
6782- useRightPanelStore . getState ( ) . openPullRequest ( activeThreadRef , linkedThreadPullRequest ) ;
6783- } , [ activeThreadRef , linkedThreadPullRequest , supportsPullRequests ] ) ;
6784- const pullRequestSurfaceAvailable = supportsPullRequests && linkedThreadPullRequest !== null ;
6793+ useRightPanelStore . getState ( ) . openPullRequest ( activeThreadRef , pullRequestPanelTarget ) ;
6794+ } , [ activeThreadRef , pullRequestPanelTarget , supportsPullRequests ] ) ;
6795+ const pullRequestSurfaceAvailable = supportsPullRequests && pullRequestPanelTarget !== null ;
67856796 const supportsSettlement = serverConfig ?. environment . capabilities . threadSettlement === true ;
67866797 const supportsSnooze = serverConfig ?. environment . capabilities . threadSnooze === true ;
67876798 const supportsPinning = serverConfig ?. environment . capabilities . threadPinning === true ;
@@ -10535,6 +10546,8 @@ export default function ChatView(props: ChatViewProps) {
1053510546 projectId : activeThread . projectId ,
1053610547 pullRequests : visiblePullRequests ,
1053710548 linkedPullRequest : linkedThreadPullRequest ,
10549+ branchPullRequest :
10550+ activeThreadShell ?. branchPullRequest ?? activeThread . branchPullRequest ,
1053810551 } ,
1053910552 renderedRightPanelSurface ,
1054010553 ) }
0 commit comments