@@ -141,9 +141,7 @@ import { useAtomValue } from "@effect/atom-react";
141141import { Atom } from "effect/unstable/reactivity" ;
142142import {
143143 Fragment ,
144- lazy ,
145144 type SetStateAction ,
146- Suspense ,
147145 useCallback ,
148146 useEffect ,
149147 useEffectEvent ,
@@ -676,7 +674,6 @@ function useDraftHeroLayoutTransition(
676674
677675const selectAutoShowFloatingPreview = ( settings : { browserAutoShowFloatingPreview : boolean } ) =>
678676 settings . browserAutoShowFloatingPreview ;
679- const FilePreviewPanel = lazy ( ( ) => import ( "./files/FilePreviewPanel" ) ) ;
680677const EMPTY_PENDING_FILE_SURFACE_IDS : ReadonlySet < string > = new Set ( ) ;
681678const TYPE_TO_FOCUS_EDITABLE_SELECTOR = [
682679 "input" ,
@@ -4751,13 +4748,6 @@ export default function ChatView(props: ChatViewProps) {
47514748 ) ;
47524749 if ( ! sessionStillExists ) usePreviewMiniPlayerStore . getState ( ) . close ( activeThreadRef ) ;
47534750 } , [ activePreviewMiniPlayer , activeThreadRef , deviceState . sessions , deviceStateLoaded ] ) ;
4754- const openFileSurface = useCallback (
4755- ( relativePath : string ) => {
4756- if ( ! activeThreadRef || ! activeProject ) return ;
4757- useRightPanelStore . getState ( ) . openFile ( activeThreadRef , relativePath ) ;
4758- } ,
4759- [ activeProject , activeThreadRef ] ,
4760- ) ;
47614751 // The thread's own change request, placed against the project it belongs to. Without a
47624752 // project there is nothing to resolve it against, so the caller falls back to the browser.
47634753 const persistedLinkedThreadPullRequest = isServerThread
@@ -9987,47 +9977,36 @@ export default function ChatView(props: ChatViewProps) {
99879977 renderedRightPanelSurface ?. kind === "file" ) &&
99889978 ( ( activeProject && activeWorkspaceRoot ) ||
99899979 ( renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment ) ) ? (
9990- < Suspense fallback = { null } >
9991- < FilePreviewPanel
9992- key = { `${ activeThread . environmentId } :${
9993- renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment
9994- ? `attachment:${ renderedRightPanelSurface . attachment . id } `
9995- : activeWorkspaceRoot
9996- } `}
9997- environmentId = { activeThread . environmentId }
9998- cwd = { activeWorkspaceRoot ?? "" }
9999- projectName = { activeProject ?. title ?? "" }
10000- threadRef = { activeThreadRef }
10001- composerDraftTarget = { composerDraftTarget }
10002- keybindings = { keybindings }
10003- availableEditors = { availableEditors }
10004- relativePath = {
10005- renderedRightPanelSurface . kind === "file"
10006- ? renderedRightPanelSurface . relativePath
10007- : null
10008- }
10009- { ...( renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment
10010- ? { attachment : renderedRightPanelSurface . attachment }
10011- : { } ) }
10012- revealLine = {
10013- renderedRightPanelSurface . kind === "file"
10014- ? ( renderedRightPanelSurface . revealLine ?? null )
10015- : null
10016- }
10017- revealRequestId = {
10018- renderedRightPanelSurface . kind === "file"
10019- ? renderedRightPanelSurface . revealRequestId
10020- : 0
10021- }
10022- onOpenFile = { openFileSurface }
10023- onPendingChange = { handleFilePendingChange }
10024- selectedFilePending = {
10025- renderedRightPanelSurface . kind === "file" &&
10026- pendingFileSurfaceIds . has ( renderedRightPanelSurface . id )
10027- }
10028- workspaceMutationId = { workspaceMutationId }
10029- />
10030- </ Suspense >
9980+ < RegisteredSidePanel
9981+ key = { `${ activeThread . environmentId } :${
9982+ renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment
9983+ ? `attachment:${ renderedRightPanelSurface . attachment . id } `
9984+ : activeWorkspaceRoot
9985+ } `}
9986+ id = "files"
9987+ cwd = { activeWorkspaceRoot ?? "" }
9988+ projectName = { activeProject ?. title ?? "" }
9989+ availableEditors = { availableEditors }
9990+ relativePath = {
9991+ renderedRightPanelSurface . kind === "file" ? renderedRightPanelSurface . relativePath : null
9992+ }
9993+ { ...( renderedRightPanelSurface . kind === "file" && renderedRightPanelSurface . attachment
9994+ ? { attachment : renderedRightPanelSurface . attachment }
9995+ : { } ) }
9996+ revealLine = {
9997+ renderedRightPanelSurface . kind === "file"
9998+ ? ( renderedRightPanelSurface . revealLine ?? null )
9999+ : null
10000+ }
10001+ revealRequestId = {
10002+ renderedRightPanelSurface . kind === "file" ? renderedRightPanelSurface . revealRequestId : 0
10003+ }
10004+ onPendingChange = { handleFilePendingChange }
10005+ selectedFilePending = {
10006+ renderedRightPanelSurface . kind === "file" &&
10007+ pendingFileSurfaceIds . has ( renderedRightPanelSurface . id )
10008+ }
10009+ />
1003110010 ) : null
1003210011 ) : null ;
1003310012 const panelHost : PanelHost | null = activeThreadRef
@@ -10049,6 +10028,7 @@ export default function ChatView(props: ChatViewProps) {
1004910028 preview : { available : true , onOpen : createBrowserSurface } ,
1005010029 diff : { available : isServerThread && isGitRepo , onOpen : addDiffSurface } ,
1005110030 terminal : { available : activeProject !== null , onOpen : addTerminalSurface } ,
10031+ files : { available : activeProject !== null , onOpen : addFilesSurface } ,
1005210032 device : { available : activeThreadRef !== null , onOpen : addDeviceSurface } ,
1005310033 "pull-request" : { available : pullRequestSurfaceAvailable , onOpen : addPullRequestSurface } ,
1005410034 "pull-requests" : { available : pullRequestsSurfaceAvailable , onOpen : addPullRequestsSurface } ,
@@ -10866,8 +10846,6 @@ export default function ChatView(props: ChatViewProps) {
1086610846 onCopyFilePath = { copyRightPanelFilePath }
1086710847 panels = { sidePanelLaunchers }
1086810848 onAddBrowserInProfile = { createBrowserSurface }
10869- onAddFiles = { addFilesSurface }
10870- filesAvailable = { activeProject !== null }
1087110849 >
1087210850 { rightPanelContent }
1087310851 </ RightPanelTabs >
@@ -10910,8 +10888,6 @@ export default function ChatView(props: ChatViewProps) {
1091010888 onCopyFilePath = { copyRightPanelFilePath }
1091110889 panels = { sidePanelLaunchers }
1091210890 onAddBrowserInProfile = { createBrowserSurface }
10913- onAddFiles = { addFilesSurface }
10914- filesAvailable = { activeProject !== null }
1091510891 >
1091610892 { rightPanelContent }
1091710893 </ RightPanelTabs >
0 commit comments