@@ -212,7 +212,6 @@ import { settleAndAdvance } from "../settleAndAdvance";
212212import { subscribeSnapShotComposerFocus } from "../lib/desktopSnapShot" ;
213213import { useMediaQuery } from "../hooks/useMediaQuery" ;
214214import { FileMetadataThreadProvider } from "../hooks/FileMetadataThreadProvider" ;
215- import { usePreviewPanelInlineSize } from "../hooks/usePreviewPanelInlineSize" ;
216215import {
217216 RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY ,
218217 type ThreadPanelPresentation ,
@@ -247,7 +246,6 @@ import {
247246 usePreviewMiniPlayerStore ,
248247} from "../previewMiniPlayerStore" ;
249248import { threadPullRequestPanelTarget } from "./pullRequest/pullRequestDetail.logic" ;
250- import { RightPanelTabs } from "./RightPanelTabs" ;
251249import { LinkPullRequestDialogHost } from "./pullRequest/LinkPullRequestDialog" ;
252250import { useDeviceState } from "~/state/device" ;
253251import { BranchToolbar , type BranchToolbarHandle } from "./BranchToolbar" ;
@@ -509,7 +507,6 @@ import {
509507 retryAttachmentUpload ,
510508 startAttachmentUpload ,
511509} from "../lib/attachmentUploadQueue" ;
512- import { RightPanelSheet } from "./RightPanelSheet" ;
513510import { previewEnvironment } from "../state/preview" ;
514511import { clampFileAttachmentUploadBytes } from "@t3tools/client-runtime/state/attachments" ;
515512import { appAtomRegistry } from "../rpc/atomRegistry" ;
@@ -544,6 +541,7 @@ import {
544541import { observeResize } from "~/lib/observeResize" ;
545542import { ThreadVisitWatermark } from "./chat/ThreadVisitWatermark" ;
546543import { ChatTerminalDrawers } from "./chat/ChatTerminalDrawers" ;
544+ import { ChatRightPanel } from "./chat/ChatRightPanel" ;
547545import { useDraftHeroLayoutTransition } from "./chat/useDraftHeroLayoutTransition" ;
548546import { useLocalDispatchState } from "./chat/useLocalDispatchState" ;
549547import {
@@ -1209,10 +1207,6 @@ export default function ChatView(props: ChatViewProps) {
12091207 activeThreadRef ?. environmentId ?? null ,
12101208 ) ;
12111209 const browserAvailable = isPreviewSupportedInRuntime ( ) || activeEnvironmentServerBrowser ;
1212- const previewPanelInlineSize = usePreviewPanelInlineSize ( undefined , {
1213- container : workspaceLayoutElement ,
1214- widthStorageKey : `t3code:preview-panel-width:${ activeThreadKey } ` ,
1215- } ) ;
12161210 const activeThreadShell = serverThread ;
12171211 const timelineThreadError =
12181212 serverRuntime ?. status === "failed" &&
@@ -8405,14 +8399,22 @@ export default function ChatView(props: ChatViewProps) {
84058399 />
84068400 </ div >
84078401
8408- { rightPanelPresent && ! shouldUsePlanSidebarSheet && activeThreadRef ? (
8409- < RightPanelTabs
8410- mode = "inline"
8402+ { rightPanelPresent && activeThreadRef ? (
8403+ < ChatRightPanel
8404+ sheet = { shouldUsePlanSidebarSheet }
8405+ workspaceLayoutElement = { workspaceLayoutElement }
8406+ widthStorageKey = { `t3code:preview-panel-width:${ activeThreadKey } ` }
8407+ sheetAnimationDurationMs = { panelAnimationsActive ? panelAnimationDurationMs : 0 }
8408+ onCloseSheet = { closePreviewPanelStable }
84118409 open = { rightPanelOpen }
84128410 keybindings = { keybindings }
84138411 getShortcutContext = { getShortcutContextStable }
84148412 maximized = { rightPanelMaximized }
8415- inlineSize = { previewPanelInlineSize }
8413+ layoutControls = {
8414+ rightPanelOpen ? (
8415+ < div className = "mr-px flex items-center" > { panelToggleControls } </ div >
8416+ ) : null
8417+ }
84168418 surfaces = { renderedRightPanelSurfaces }
84178419 environmentId = { activeThreadRef . environmentId }
84188420 activeSurfaceId = { renderedRightPanelSurface ?. id ?? null }
@@ -8449,63 +8451,7 @@ export default function ChatView(props: ChatViewProps) {
84498451 deviceAvailable = { activeThreadRef !== null }
84508452 >
84518453 { rightPanelContent }
8452- </ RightPanelTabs >
8453- ) : null }
8454- { rightPanelPresent && shouldUsePlanSidebarSheet && activeThreadRef ? (
8455- < RightPanelSheet
8456- animationDurationMs = { panelAnimationsActive ? panelAnimationDurationMs : 0 }
8457- open = { rightPanelOpen }
8458- onClose = { closePreviewPanelStable }
8459- >
8460- < RightPanelTabs
8461- mode = "sheet"
8462- open = { rightPanelOpen }
8463- keybindings = { keybindings }
8464- getShortcutContext = { getShortcutContextStable }
8465- inlineSize = { previewPanelInlineSize }
8466- layoutControls = {
8467- rightPanelOpen ? (
8468- < div className = "mr-px flex items-center" > { panelToggleControls } </ div >
8469- ) : null
8470- }
8471- surfaces = { renderedRightPanelSurfaces }
8472- environmentId = { activeThreadRef . environmentId }
8473- activeSurfaceId = { renderedRightPanelSurface ?. id ?? null }
8474- pendingSurfaceIds = { pendingFileSurfaceIds }
8475- previewSessions = { activePreviewState . sessions }
8476- desktopByTabId = { activePreviewState . desktopByTabId }
8477- previewRuntimeTabId = { resolvePreviewRuntimeTabId }
8478- terminalLabelsById = { activeTerminalLabelsById }
8479- onActivate = { activateRightPanelSurfaceStable }
8480- onCloseSurface = { closeRightPanelSurfaceStable }
8481- onRenameDevice = { ( surfaceId , title ) => {
8482- if ( activeThreadRef )
8483- useRightPanelStore . getState ( ) . renameDevice ( activeThreadRef , surfaceId , title ) ;
8484- } }
8485- onCloseOtherSurfaces = { closeOtherRightPanelSurfacesStable }
8486- onCloseSurfacesToRight = { closeRightPanelSurfacesToRightStable }
8487- onCloseAllSurfaces = { closeAllRightPanelSurfacesStable }
8488- onMoveSurface = { moveRightPanelSurfaceStable }
8489- onCopyFilePath = { copyRightPanelFilePathStable }
8490- onAddBrowser = { ( ) => createBrowserSurface ( ) }
8491- onAddBrowserInProfile = { createBrowserSurfaceStable }
8492- onAddTerminal = { addTerminalSurfaceStable }
8493- onAddDiff = { addDiffSurfaceStable }
8494- onAddFiles = { addFilesSurfaceStable }
8495- onAddPullRequest = { addPullRequestSurfaceStable }
8496- onAddPullRequests = { addPullRequestsSurfaceStable }
8497- onAddDevice = { addDeviceSurfaceStable }
8498- browserAvailable = { canOperatePreview && browserAvailable }
8499- terminalAvailable = { activeProject !== null && canOperateTerminal }
8500- diffAvailable = { isServerThread && isGitRepo }
8501- filesAvailable = { activeProject !== null }
8502- pullRequestAvailable = { pullRequestSurfaceAvailable }
8503- pullRequestsAvailable = { pullRequestsSurfaceAvailable }
8504- deviceAvailable = { activeThreadRef !== null }
8505- >
8506- { rightPanelContent }
8507- </ RightPanelTabs >
8508- </ RightPanelSheet >
8454+ </ ChatRightPanel >
85098455 ) : null }
85108456
85118457 < RevertConfirmHost threadKey = { routeThreadKey } onConfirm = { onConfirmRevertStable } />
0 commit comments