@@ -286,12 +286,10 @@ import {
286286 pullRequestPanelContext ,
287287 threadPullRequestPanelTarget ,
288288} from "./pullRequest/pullRequestDetail.logic" ;
289- import { PullRequestDetailPanel } from "./pullRequest/PullRequestDetailPanel" ;
290289import { PullRequestDetailGhost } from "./pullRequest/PullRequestGhosts" ;
291290import { PullRequestsUnavailableState } from "./pullRequest/PullRequestsUnavailableState" ;
292291import { RightPanelTabs } from "./RightPanelTabs" ;
293292import { LinkPullRequestDialogHost } from "./pullRequest/LinkPullRequestDialog" ;
294- import { ThreadPullRequestsPanel } from "./pullRequest/ThreadPullRequestsPanel" ;
295293import { useDeviceState } from "~/state/device" ;
296294import { DeviceSetup } from "./device/DeviceSetup" ;
297295import { Dialog } from "./ui/dialog" ;
@@ -714,6 +712,16 @@ const DevicePanel = lazy(() =>
714712 import ( "./device/DevicePanel" ) . then ( ( module ) => ( { default : module . DevicePanel } ) ) ,
715713) ;
716714const FilePreviewPanel = lazy ( ( ) => import ( "./files/FilePreviewPanel" ) ) ;
715+ const PullRequestDetailPanel = lazy ( ( ) =>
716+ import ( "./pullRequest/PullRequestDetailPanel" ) . then ( ( module ) => ( {
717+ default : module . PullRequestDetailPanel ,
718+ } ) ) ,
719+ ) ;
720+ const ThreadPullRequestsPanel = lazy ( ( ) =>
721+ import ( "./pullRequest/ThreadPullRequestsPanel" ) . then ( ( module ) => ( {
722+ default : module . ThreadPullRequestsPanel ,
723+ } ) ) ,
724+ ) ;
717725const EMPTY_PENDING_FILE_SURFACE_IDS : ReadonlySet < string > = new Set ( ) ;
718726const TYPE_TO_FOCUS_EDITABLE_SELECTOR = [
719727 "input" ,
@@ -11189,48 +11197,52 @@ export default function ChatView(props: ChatViewProps) {
1118911197 // is only right for the thread's own pull request, whose branch is already under the
1119011198 // reader's feet. A link the agent wrote can open any other one here, and that one has to be
1119111199 // checkable out like it is anywhere else.
11192- < PullRequestDetailPanel
11193- getShortcutContext = { getShortcutContext }
11194- shortcutsEnabled = {
11195- rightPanelOpen && activeRightPanelSurface ?. id === renderedRightPanelSurface . id
11196- }
11197- key = { `${ renderedRightPanelSurface . host ?? "" } :${ renderedRightPanelSurface . repository } #${ renderedRightPanelSurface . number } ` }
11198- environmentId = { activeThread . environmentId }
11199- onSelectPullRequest = { ( reference ) => {
11200- if ( activeThreadRef )
11201- useRightPanelStore . getState ( ) . openPullRequest ( activeThreadRef , {
11202- projectId : reference . projectId ,
11203- repository : reference . repository ,
11204- number : reference . number ,
11205- ...( reference . host ? { host : reference . host } : { } ) ,
11206- } ) ;
11207- } }
11208- threadRef = { activeThreadRef }
11209- reference = { {
11210- projectId : renderedRightPanelSurface . projectId as ProjectId ,
11211- ...( renderedRightPanelSurface . host ? { host : renderedRightPanelSurface . host } : { } ) ,
11212- repository : renderedRightPanelSurface . repository ,
11213- number : renderedRightPanelSurface . number ,
11214- } }
11215- context = { pullRequestPanelContext (
11216- {
11217- projectId : activeThread . projectId ,
11218- pullRequests : visiblePullRequests ,
11219- linkedPullRequest : linkedThreadPullRequest ,
11220- branchPullRequest :
11221- activeThreadShell ?. branchPullRequest ?? activeThread . branchPullRequest ,
11222- } ,
11223- renderedRightPanelSurface ,
11224- ) }
11225- composerDraftTarget = { composerDraftTarget }
11226- onBack = {
11227- activeThreadRef !== null && pullRequestsSurfaceAvailable && visiblePullRequestCount > 1
11228- ? addPullRequestsSurface
11229- : undefined
11230- }
11231- />
11200+ < Suspense fallback = { < PullRequestDetailGhost /> } >
11201+ < PullRequestDetailPanel
11202+ getShortcutContext = { getShortcutContext }
11203+ shortcutsEnabled = {
11204+ rightPanelOpen && activeRightPanelSurface ?. id === renderedRightPanelSurface . id
11205+ }
11206+ key = { `${ renderedRightPanelSurface . host ?? "" } :${ renderedRightPanelSurface . repository } #${ renderedRightPanelSurface . number } ` }
11207+ environmentId = { activeThread . environmentId }
11208+ onSelectPullRequest = { ( reference ) => {
11209+ if ( activeThreadRef )
11210+ useRightPanelStore . getState ( ) . openPullRequest ( activeThreadRef , {
11211+ projectId : reference . projectId ,
11212+ repository : reference . repository ,
11213+ number : reference . number ,
11214+ ...( reference . host ? { host : reference . host } : { } ) ,
11215+ } ) ;
11216+ } }
11217+ threadRef = { activeThreadRef }
11218+ reference = { {
11219+ projectId : renderedRightPanelSurface . projectId as ProjectId ,
11220+ ...( renderedRightPanelSurface . host ? { host : renderedRightPanelSurface . host } : { } ) ,
11221+ repository : renderedRightPanelSurface . repository ,
11222+ number : renderedRightPanelSurface . number ,
11223+ } }
11224+ context = { pullRequestPanelContext (
11225+ {
11226+ projectId : activeThread . projectId ,
11227+ pullRequests : visiblePullRequests ,
11228+ linkedPullRequest : linkedThreadPullRequest ,
11229+ branchPullRequest :
11230+ activeThreadShell ?. branchPullRequest ?? activeThread . branchPullRequest ,
11231+ } ,
11232+ renderedRightPanelSurface ,
11233+ ) }
11234+ composerDraftTarget = { composerDraftTarget }
11235+ onBack = {
11236+ activeThreadRef !== null && pullRequestsSurfaceAvailable && visiblePullRequestCount > 1
11237+ ? addPullRequestsSurface
11238+ : undefined
11239+ }
11240+ />
11241+ </ Suspense >
1123211242 ) : renderedRightPanelSurface ?. kind === "pull-requests" && activeThreadRef ? (
11233- < ThreadPullRequestsPanel threadRef = { activeThreadRef } />
11243+ < Suspense fallback = { null } >
11244+ < ThreadPullRequestsPanel threadRef = { activeThreadRef } />
11245+ </ Suspense >
1123411246 ) : renderedRightPanelSurface ?. kind === "device" ? (
1123511247 < Suspense fallback = { null } >
1123611248 < DevicePanel
0 commit comments