@@ -149,9 +149,7 @@ import { useAtomValue } from "@effect/atom-react";
149149import { Atom } from "effect/reactivity" ;
150150import {
151151 Fragment ,
152- lazy ,
153152 type SetStateAction ,
154- Suspense ,
155153 useCallback ,
156154 useEffect ,
157155 useEffectEvent ,
@@ -702,7 +700,6 @@ function useDraftHeroLayoutTransition(
702700
703701const selectAutoShowFloatingPreview = ( settings : { browserAutoShowFloatingPreview : boolean } ) =>
704702 settings . browserAutoShowFloatingPreview ;
705- const FilePreviewPanel = lazy ( ( ) => import ( "./files/FilePreviewPanel" ) ) ;
706703const EMPTY_PENDING_FILE_SURFACE_IDS : ReadonlySet < string > = new Set ( ) ;
707704const TYPE_TO_FOCUS_EDITABLE_SELECTOR = [
708705 "input" ,
@@ -4955,13 +4952,6 @@ export default function ChatView(props: ChatViewProps) {
49554952 ) ;
49564953 if ( ! sessionStillExists ) usePreviewMiniPlayerStore . getState ( ) . close ( activeThreadRef ) ;
49574954 } , [ activePreviewMiniPlayer , activeThreadRef , deviceState . sessions , deviceStateLoaded ] ) ;
4958- const openFileSurface = useCallback (
4959- ( relativePath : string ) => {
4960- if ( ! activeThreadRef || ! activeProject ) return ;
4961- useRightPanelStore . getState ( ) . openFile ( activeThreadRef , relativePath ) ;
4962- } ,
4963- [ activeProject , activeThreadRef ] ,
4964- ) ;
49654955 // The thread's own change request, placed against the project it belongs to. Without a
49664956 // project there is nothing to resolve it against, so the caller falls back to the browser.
49674957 const persistedLinkedThreadPullRequest = isServerThread
@@ -10495,47 +10485,36 @@ export default function ChatView(props: ChatViewProps) {
1049510485 renderedRightPanelSurface ?. kind === "file" ) &&
1049610486 ( ( activeProject && activeWorkspaceRoot ) ||
1049710487 ( renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment ) ) ? (
10498- < Suspense fallback = { null } >
10499- < FilePreviewPanel
10500- key = { `${ activeThread . environmentId } :${
10501- renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment
10502- ? `attachment:${ renderedRightPanelSurface . attachment . id } `
10503- : activeWorkspaceRoot
10504- } `}
10505- environmentId = { activeThread . environmentId }
10506- cwd = { activeWorkspaceRoot ?? "" }
10507- projectName = { activeProject ?. title ?? "" }
10508- threadRef = { activeThreadRef }
10509- composerDraftTarget = { composerDraftTarget }
10510- keybindings = { keybindings }
10511- availableEditors = { availableEditors }
10512- relativePath = {
10513- renderedRightPanelSurface . kind === "file"
10514- ? renderedRightPanelSurface . relativePath
10515- : null
10516- }
10517- { ...( renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment
10518- ? { attachment : renderedRightPanelSurface . attachment }
10519- : { } ) }
10520- revealLine = {
10521- renderedRightPanelSurface . kind === "file"
10522- ? ( renderedRightPanelSurface . revealLine ?? null )
10523- : null
10524- }
10525- revealRequestId = {
10526- renderedRightPanelSurface . kind === "file"
10527- ? renderedRightPanelSurface . revealRequestId
10528- : 0
10529- }
10530- onOpenFile = { openFileSurface }
10531- onPendingChange = { handleFilePendingChange }
10532- selectedFilePending = {
10533- renderedRightPanelSurface . kind === "file" &&
10534- pendingFileSurfaceIds . has ( renderedRightPanelSurface . id )
10535- }
10536- workspaceMutationId = { workspaceMutationId }
10537- />
10538- </ Suspense >
10488+ < RegisteredSidePanel
10489+ key = { `${ activeThread . environmentId } :${
10490+ renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment
10491+ ? `attachment:${ renderedRightPanelSurface . attachment . id } `
10492+ : activeWorkspaceRoot
10493+ } `}
10494+ id = "files"
10495+ cwd = { activeWorkspaceRoot ?? "" }
10496+ projectName = { activeProject ?. title ?? "" }
10497+ availableEditors = { availableEditors }
10498+ relativePath = {
10499+ renderedRightPanelSurface . kind === "file" ? renderedRightPanelSurface . relativePath : null
10500+ }
10501+ { ...( renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment
10502+ ? { attachment : renderedRightPanelSurface . attachment }
10503+ : { } ) }
10504+ revealLine = {
10505+ renderedRightPanelSurface . kind === "file"
10506+ ? ( renderedRightPanelSurface . revealLine ?? null )
10507+ : null
10508+ }
10509+ revealRequestId = {
10510+ renderedRightPanelSurface . kind === "file" ? renderedRightPanelSurface . revealRequestId : 0
10511+ }
10512+ onPendingChange = { handleFilePendingChange }
10513+ selectedFilePending = {
10514+ renderedRightPanelSurface . kind === "file" &&
10515+ pendingFileSurfaceIds . has ( renderedRightPanelSurface . id )
10516+ }
10517+ />
1053910518 ) : null
1054010519 ) : null ;
1054110520 const rightPanelContent = (
@@ -10548,6 +10527,7 @@ export default function ChatView(props: ChatViewProps) {
1054810527 available : activeProject !== null && canOperateTerminal ,
1054910528 onOpen : addTerminalSurface ,
1055010529 } ,
10530+ files : { available : activeProject !== null , onOpen : addFilesSurface } ,
1055110531 device : { available : activeThreadRef !== null , onOpen : addDeviceSurface } ,
1055210532 "pull-request" : { available : pullRequestSurfaceAvailable , onOpen : addPullRequestSurface } ,
1055310533 "pull-requests" : { available : pullRequestsSurfaceAvailable , onOpen : addPullRequestsSurface } ,
@@ -11388,8 +11368,6 @@ export default function ChatView(props: ChatViewProps) {
1138811368 onCopyFilePath = { copyRightPanelFilePath }
1138911369 panels = { sidePanelLaunchers }
1139011370 onAddBrowserInProfile = { createBrowserSurface }
11391- onAddFiles = { addFilesSurface }
11392- filesAvailable = { activeProject !== null }
1139311371 >
1139411372 { rightPanelContent }
1139511373 </ RightPanelTabs >
@@ -11436,8 +11414,6 @@ export default function ChatView(props: ChatViewProps) {
1143611414 onCopyFilePath = { copyRightPanelFilePath }
1143711415 panels = { sidePanelLaunchers }
1143811416 onAddBrowserInProfile = { createBrowserSurface }
11439- onAddFiles = { addFilesSurface }
11440- filesAvailable = { activeProject !== null }
1144111417 >
1144211418 { rightPanelContent }
1144311419 </ RightPanelTabs >
0 commit comments