| ... | @@ -170,7 +170,7 @@ import { ExpandedImageDialog } from "./chat/ExpandedImageDialog"; | ... | @@ -170,7 +170,7 @@ import { ExpandedImageDialog } from "./chat/ExpandedImageDialog"; |
| 170 | import { PullRequestThreadDialog } from "./PullRequestThreadDialog"; | 170 | import { PullRequestThreadDialog } from "./PullRequestThreadDialog"; |
| 171 | import { MessagesTimeline } from "./chat/MessagesTimeline"; | 171 | import { MessagesTimeline } from "./chat/MessagesTimeline"; |
| 172 | import { ChatHeader } from "./chat/ChatHeader"; | 172 | import { ChatHeader } from "./chat/ChatHeader"; |
| 173 | import { PanelLayoutControls } from "./chat/PanelLayoutControls"; | 173 | import { PanelLayoutControls, RightPanelMaximizeControl } from "./chat/PanelLayoutControls"; |
| 174 | import { type ExpandedImagePreview } from "./chat/ExpandedImagePreview"; | 174 | import { type ExpandedImagePreview } from "./chat/ExpandedImagePreview"; |
| 175 | import { NoActiveThreadState } from "./NoActiveThreadState"; | 175 | import { NoActiveThreadState } from "./NoActiveThreadState"; |
| 176 | import { resolveEffectiveEnvMode, resolveEnvironmentOptionLabel } from "./BranchToolbar.logic"; | 176 | import { resolveEffectiveEnvMode, resolveEnvironmentOptionLabel } from "./BranchToolbar.logic"; |
| ... | @@ -1333,9 +1333,8 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -1333,9 +1333,8 @@ function ChatViewContent(props: ChatViewProps) { |
| 1333 | const planSidebarOpen = activeRightPanelKind === "plan"; | 1333 | const planSidebarOpen = activeRightPanelKind === "plan"; |
| 1334 | const previewPanelOpen = activeRightPanelKind === "preview" && isPreviewSupportedInRuntime(); | 1334 | const previewPanelOpen = activeRightPanelKind === "preview" && isPreviewSupportedInRuntime(); |
| 1335 | const rightPanelOpen = rightPanelState.isOpen; | 1335 | const rightPanelOpen = rightPanelState.isOpen; |
| 1336 | const canMaximizeRightPanel = rightPanelOpen && !shouldUsePlanSidebarSheet; | | |
| 1337 | const rightPanelMaximized = | 1336 | const rightPanelMaximized = |
| 1338 | canMaximizeRightPanel && maximizedRightPanelThreadKey === routeThreadKey; | 1337 | rightPanelOpen && !shouldUsePlanSidebarSheet && maximizedRightPanelThreadKey === routeThreadKey; |
| 1339 | const inlineRightPanelOwnsTitleBar = rightPanelOpen && !shouldUsePlanSidebarSheet; | 1338 | const inlineRightPanelOwnsTitleBar = rightPanelOpen && !shouldUsePlanSidebarSheet; |
| 1340 | | 1339 | |
| 1341 | useEffect(() => { | 1340 | useEffect(() => { |
| ... | @@ -3036,23 +3035,25 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -3036,23 +3035,25 @@ function ChatViewContent(props: ChatViewProps) { |
| 3036 | const toggleInteractionMode = useCallback(() => { | 3035 | const toggleInteractionMode = useCallback(() => { |
| 3037 | handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan"); | 3036 | handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan"); |
| 3038 | }, [handleInteractionModeChange, interactionMode]); | 3037 | }, [handleInteractionModeChange, interactionMode]); |
| | 3038 | const dismissPlanSidebarForCurrentTurn = useCallback(() => { |
| | 3039 | planSidebarDismissedForTurnRef.current = |
| | 3040 | activePlan?.turnId ?? sidebarProposedPlan?.turnId ?? "__dismissed__"; |
| | 3041 | }, [activePlan?.turnId, sidebarProposedPlan?.turnId]); |
| 3039 | const togglePlanSidebar = useCallback(() => { | 3042 | const togglePlanSidebar = useCallback(() => { |
| 3040 | if (!activeThreadRef) return; | 3043 | if (!activeThreadRef) return; |
| 3041 | if (planSidebarOpen) { | 3044 | if (planSidebarOpen) { |
| 3042 | planSidebarDismissedForTurnRef.current = | 3045 | dismissPlanSidebarForCurrentTurn(); |
| 3043 | activePlan?.turnId ?? sidebarProposedPlan?.turnId ?? "__dismissed__"; | | |
| 3044 | } else { | 3046 | } else { |
| 3045 | planSidebarDismissedForTurnRef.current = null; | 3047 | planSidebarDismissedForTurnRef.current = null; |
| 3046 | } | 3048 | } |
| 3047 | useRightPanelStore.getState().toggle(activeThreadRef, "plan"); | 3049 | useRightPanelStore.getState().toggle(activeThreadRef, "plan"); |
| 3048 | }, [activePlan?.turnId, activeThreadRef, planSidebarOpen, sidebarProposedPlan?.turnId]); | 3050 | }, [activeThreadRef, dismissPlanSidebarForCurrentTurn, planSidebarOpen]); |
| 3049 | const closePlanSidebar = useCallback(() => { | 3051 | const closePlanSidebar = useCallback(() => { |
| 3050 | if (!activeThreadRef) return; | 3052 | if (!activeThreadRef) return; |
| 3051 | setMaximizedRightPanelThreadKey(null); | 3053 | setMaximizedRightPanelThreadKey(null); |
| 3052 | useRightPanelStore.getState().close(activeThreadRef); | 3054 | useRightPanelStore.getState().close(activeThreadRef); |
| 3053 | planSidebarDismissedForTurnRef.current = | 3055 | dismissPlanSidebarForCurrentTurn(); |
| 3054 | activePlan?.turnId ?? sidebarProposedPlan?.turnId ?? "__dismissed__"; | 3056 | }, [activeThreadRef, dismissPlanSidebarForCurrentTurn]); |
| 3055 | }, [activePlan?.turnId, activeThreadRef, sidebarProposedPlan?.turnId]); | | |
| 3056 | const closePreviewPanel = useCallback(() => { | 3057 | const closePreviewPanel = useCallback(() => { |
| 3057 | if (!activeThreadRef) return; | 3058 | if (!activeThreadRef) return; |
| 3058 | setMaximizedRightPanelThreadKey(null); | 3059 | setMaximizedRightPanelThreadKey(null); |
| ... | @@ -3061,6 +3062,11 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -3061,6 +3062,11 @@ function ChatViewContent(props: ChatViewProps) { |
| 3061 | const activateRightPanelSurface = useCallback( | 3062 | const activateRightPanelSurface = useCallback( |
| 3062 | (surface: RightPanelSurface) => { | 3063 | (surface: RightPanelSurface) => { |
| 3063 | if (!activeThreadRef) return; | 3064 | if (!activeThreadRef) return; |
| | 3065 | if (surface.kind === "plan") { |
| | 3066 | planSidebarDismissedForTurnRef.current = null; |
| | 3067 | } else if (planSidebarOpen) { |
| | 3068 | dismissPlanSidebarForCurrentTurn(); |
| | 3069 | } |
| 3064 | useRightPanelStore.getState().activateSurface(activeThreadRef, surface.id); | 3070 | useRightPanelStore.getState().activateSurface(activeThreadRef, surface.id); |
| 3065 | if (surface.kind === "preview" && surface.resourceId) { | 3071 | if (surface.kind === "preview" && surface.resourceId) { |
| 3066 | usePreviewStateStore.getState().setActiveTab(activeThreadRef, surface.resourceId); | 3072 | usePreviewStateStore.getState().setActiveTab(activeThreadRef, surface.resourceId); |
| ... | @@ -3085,17 +3091,31 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -3085,17 +3091,31 @@ function ChatViewContent(props: ChatViewProps) { |
| 3085 | }); | 3091 | }); |
| 3086 | } | 3092 | } |
| 3087 | }, | 3093 | }, |
| 3088 | [activeThreadRef, diffOpen, environmentId, navigate, onDiffPanelOpen, threadId], | 3094 | [ |
| | 3095 | activeThreadRef, |
| | 3096 | diffOpen, |
| | 3097 | dismissPlanSidebarForCurrentTurn, |
| | 3098 | environmentId, |
| | 3099 | navigate, |
| | 3100 | onDiffPanelOpen, |
| | 3101 | planSidebarOpen, |
| | 3102 | threadId, |
| | 3103 | ], |
| 3089 | ); | 3104 | ); |
| 3090 | const toggleRightPanel = useCallback(() => { | 3105 | const toggleRightPanel = useCallback(() => { |
| 3091 | if (!activeThreadRef) return; | 3106 | if (!activeThreadRef) return; |
| 3092 | if (rightPanelOpen) { | 3107 | if (rightPanelOpen) { |
| 3093 | setMaximizedRightPanelThreadKey(null); | 3108 | if (planSidebarOpen) { |
| | 3109 | closePlanSidebar(); |
| | 3110 | } else { |
| | 3111 | closePreviewPanel(); |
| | 3112 | } |
| | 3113 | return; |
| 3094 | } | 3114 | } |
| 3095 | useRightPanelStore.getState().toggleVisibility(activeThreadRef); | 3115 | useRightPanelStore.getState().toggleVisibility(activeThreadRef); |
| 3096 | }, [activeThreadRef, rightPanelOpen]); | 3116 | }, [activeThreadRef, closePlanSidebar, closePreviewPanel, planSidebarOpen, rightPanelOpen]); |
| 3097 | const toggleRightPanelMaximized = () => { | 3117 | const toggleRightPanelMaximized = () => { |
| 3098 | if (!canMaximizeRightPanel) return; | 3118 | if (!rightPanelOpen || shouldUsePlanSidebarSheet) return; |
| 3099 | setMaximizedRightPanelThreadKey((threadKey) => | 3119 | setMaximizedRightPanelThreadKey((threadKey) => |
| 3100 | threadKey === routeThreadKey ? null : routeThreadKey, | 3120 | threadKey === routeThreadKey ? null : routeThreadKey, |
| 3101 | ); | 3121 | ); |
| ... | @@ -3103,6 +3123,9 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -3103,6 +3123,9 @@ function ChatViewContent(props: ChatViewProps) { |
| 3103 | const cleanupRightPanelSurfaces = useCallback( | 3123 | const cleanupRightPanelSurfaces = useCallback( |
| 3104 | (surfaces: readonly RightPanelSurface[]) => { | 3124 | (surfaces: readonly RightPanelSurface[]) => { |
| 3105 | if (!activeThreadRef) return; | 3125 | if (!activeThreadRef) return; |
| | 3126 | if (surfaces.some((surface) => surface.kind === "plan")) { |
| | 3127 | dismissPlanSidebarForCurrentTurn(); |
| | 3128 | } |
| 3106 | | 3129 | |
| 3107 | const api = readEnvironmentApi(activeThreadRef.environmentId); | 3130 | const api = readEnvironmentApi(activeThreadRef.environmentId); |
| 3108 | for (const surface of surfaces) { | 3131 | for (const surface of surfaces) { |
| ... | @@ -3133,7 +3156,14 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -3133,7 +3156,14 @@ function ChatViewContent(props: ChatViewProps) { |
| 3133 | }); | 3156 | }); |
| 3134 | } | 3157 | } |
| 3135 | }, | 3158 | }, |
| 3136 | [activeThreadRef, diffOpen, environmentId, navigate, threadId], | 3159 | [ |
| | 3160 | activeThreadRef, |
| | 3161 | diffOpen, |
| | 3162 | dismissPlanSidebarForCurrentTurn, |
| | 3163 | environmentId, |
| | 3164 | navigate, |
| | 3165 | threadId, |
| | 3166 | ], |
| 3137 | ); | 3167 | ); |
| 3138 | const syncActivePreviewSurface = useCallback(() => { | 3168 | const syncActivePreviewSurface = useCallback(() => { |
| 3139 | if (!activeThreadRef) return; | 3169 | if (!activeThreadRef) return; |
| ... | @@ -4654,7 +4684,7 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -4654,7 +4684,7 @@ function ChatViewContent(props: ChatViewProps) { |
| 4654 | return <NoActiveThreadState />; | 4684 | return <NoActiveThreadState />; |
| 4655 | } | 4685 | } |
| 4656 | | 4686 | |
| 4657 | const panelLayoutControls = ( | 4687 | const panelToggleControls = ( |
| 4658 | <PanelLayoutControls | 4688 | <PanelLayoutControls |
| 4659 | terminalAvailable={Boolean(activeProject)} | 4689 | terminalAvailable={Boolean(activeProject)} |
| 4660 | terminalOpen={Boolean(terminalUiState.terminalOpen)} | 4690 | terminalOpen={Boolean(terminalUiState.terminalOpen)} |
| ... | @@ -4662,20 +4692,95 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -4662,20 +4692,95 @@ function ChatViewContent(props: ChatViewProps) { |
| 4662 | rightPanelAvailable={Boolean(activeProject)} | 4692 | rightPanelAvailable={Boolean(activeProject)} |
| 4663 | rightPanelOpen={rightPanelOpen} | 4693 | rightPanelOpen={rightPanelOpen} |
| 4664 | rightPanelShortcutLabel={rightPanelToggleShortcutLabel} | 4694 | rightPanelShortcutLabel={rightPanelToggleShortcutLabel} |
| 4665 | rightPanelMaximized={rightPanelMaximized} | | |
| 4666 | canMaximizeRightPanel={canMaximizeRightPanel} | | |
| 4667 | onToggleTerminal={toggleTerminalVisibility} | 4695 | onToggleTerminal={toggleTerminalVisibility} |
| 4668 | onToggleRightPanel={toggleRightPanel} | 4696 | onToggleRightPanel={toggleRightPanel} |
| 4669 | onToggleRightPanelMaximized={toggleRightPanelMaximized} | | |
| 4670 | /> | 4697 | /> |
| 4671 | ); | 4698 | ); |
| | 4699 | const panelLayoutControls = ( |
| | 4700 | <div className="workspace-titlebar-controls z-50 gap-1 [-webkit-app-region:no-drag]"> |
| | 4701 | {rightPanelOpen && !shouldUsePlanSidebarSheet ? ( |
| | 4702 | <RightPanelMaximizeControl |
| | 4703 | maximized={rightPanelMaximized} |
| | 4704 | onToggle={toggleRightPanelMaximized} |
| | 4705 | /> |
| | 4706 | ) : null} |
| | 4707 | {panelToggleControls} |
| | 4708 | </div> |
| | 4709 | ); |
| | 4710 | const rightPanelContent = activeThreadRef ? ( |
| | 4711 | activeRightPanelSurface?.kind === "preview" ? ( |
| | 4712 | <Suspense fallback={null}> |
| | 4713 | <PreviewPanel |
| | 4714 | mode="embedded" |
| | 4715 | threadRef={activeThreadRef} |
| | 4716 | tabId={activeRightPanelSurface.resourceId} |
| | 4717 | configuredUrls={configuredPreviewUrls} |
| | 4718 | visible |
| | 4719 | /> |
| | 4720 | </Suspense> |
| | 4721 | ) : activeRightPanelSurface?.kind === "terminal" ? ( |
| | 4722 | <PersistentThreadTerminalPanel |
| | 4723 | threadRef={activeThreadRef} |
| | 4724 | surface={activeRightPanelSurface} |
| | 4725 | launchContext={activeTerminalLaunchContext ?? null} |
| | 4726 | focusRequestId={terminalFocusRequestId} |
| | 4727 | keybindings={keybindings} |
| | 4728 | onAddTerminalContext={addTerminalContextToDraft} |
| | 4729 | onSplitTerminal={splitPanelTerminal} |
| | 4730 | onSplitTerminalVertical={splitPanelTerminalVertical} |
| | 4731 | onNewTerminal={addTerminalSurface} |
| | 4732 | onActiveTerminalChange={activatePanelTerminal} |
| | 4733 | onCloseTerminal={closePanelTerminal} |
| | 4734 | splitShortcutLabel={splitTerminalShortcutLabel ?? undefined} |
| | 4735 | splitVerticalShortcutLabel={splitTerminalVerticalShortcutLabel ?? undefined} |
| | 4736 | newShortcutLabel={newTerminalShortcutLabel ?? undefined} |
| | 4737 | closeShortcutLabel={closeTerminalShortcutLabel ?? undefined} |
| | 4738 | /> |
| | 4739 | ) : activeRightPanelSurface?.kind === "diff" ? ( |
| | 4740 | <Suspense fallback={null}> |
| | 4741 | <DiffPanel mode="embedded" composerDraftTarget={composerDraftTarget} /> |
| | 4742 | </Suspense> |
| | 4743 | ) : activeRightPanelSurface?.kind === "plan" ? ( |
| | 4744 | <PlanSidebar |
| | 4745 | activePlan={activePlan} |
| | 4746 | activeProposedPlan={sidebarProposedPlan} |
| | 4747 | label={planSidebarLabel} |
| | 4748 | environmentId={environmentId} |
| | 4749 | threadRef={activeThreadRef} |
| | 4750 | markdownCwd={gitCwd ?? undefined} |
| | 4751 | workspaceRoot={activeWorkspaceRoot} |
| | 4752 | timestampFormat={timestampFormat} |
| | 4753 | mode="embedded" |
| | 4754 | /> |
| | 4755 | ) : (activeRightPanelSurface?.kind === "files" || activeRightPanelSurface?.kind === "file") && |
| | 4756 | activeProject && |
| | 4757 | activeWorkspaceRoot ? ( |
| | 4758 | <Suspense fallback={null}> |
| | 4759 | <FilePreviewPanel |
| | 4760 | key={`${activeProject.environmentId}:${activeWorkspaceRoot}`} |
| | 4761 | environmentId={activeProject.environmentId} |
| | 4762 | cwd={activeWorkspaceRoot} |
| | 4763 | projectName={activeProject.name} |
| | 4764 | threadRef={activeThreadRef} |
| | 4765 | composerDraftTarget={composerDraftTarget} |
| | 4766 | keybindings={keybindings} |
| | 4767 | availableEditors={availableEditors} |
| | 4768 | relativePath={ |
| | 4769 | activeRightPanelSurface.kind === "file" ? activeRightPanelSurface.relativePath : null |
| | 4770 | } |
| | 4771 | onOpenFile={openFileSurface} |
| | 4772 | onPendingChange={handleFilePendingChange} |
| | 4773 | /> |
| | 4774 | </Suspense> |
| | 4775 | ) : null |
| | 4776 | ) : null; |
| 4672 | | 4777 | |
| 4673 | return ( | 4778 | return ( |
| 4674 | <div className="relative flex min-h-0 min-w-0 flex-1 overflow-hidden bg-background"> | 4779 | <div className="relative flex min-h-0 min-w-0 flex-1 overflow-hidden bg-background"> |
| 4675 | {isElectron && activeThreadRef ? ( | 4780 | {isElectron && activeThreadRef ? ( |
| 4676 | <PreviewAutomationOwner threadRef={activeThreadRef} visible={previewPanelOpen} /> | 4781 | <PreviewAutomationOwner threadRef={activeThreadRef} visible={previewPanelOpen} /> |
| 4677 | ) : null} | 4782 | ) : null} |
| 4678 | {rightPanelOpen ? panelLayoutControls : null} | 4783 | {rightPanelOpen && !shouldUsePlanSidebarSheet ? panelLayoutControls : null} |
| 4679 | <div | 4784 | <div |
| 4680 | className={cn( | 4785 | className={cn( |
| 4681 | "flex min-h-0 min-w-0 flex-col overflow-hidden", | 4786 | "flex min-h-0 min-w-0 flex-col overflow-hidden", |
| ... | @@ -4944,69 +5049,15 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -4944,69 +5049,15 @@ function ChatViewContent(props: ChatViewProps) { |
| 4944 | diffAvailable={isServerThread && isGitRepo} | 5049 | diffAvailable={isServerThread && isGitRepo} |
| 4945 | filesAvailable={Boolean(activeProject)} | 5050 | filesAvailable={Boolean(activeProject)} |
| 4946 | > | 5051 | > |
| 4947 | {activeRightPanelSurface?.kind === "preview" ? ( | 5052 | {rightPanelContent} |
| 4948 | <Suspense fallback={null}> | | |
| 4949 | <PreviewPanel | | |
| 4950 | mode="embedded" | | |
| 4951 | threadRef={activeThreadRef} | | |
| 4952 | tabId={activeRightPanelSurface.resourceId} | | |
| 4953 | configuredUrls={configuredPreviewUrls} | | |
| 4954 | visible | | |
| 4955 | /> | | |
| 4956 | </Suspense> | | |
| 4957 | ) : activeRightPanelSurface?.kind === "terminal" ? ( | | |
| 4958 | <PersistentThreadTerminalPanel | | |
| 4959 | threadRef={activeThreadRef} | | |
| 4960 | surface={activeRightPanelSurface} | | |
| 4961 | launchContext={activeTerminalLaunchContext ?? null} | | |
| 4962 | focusRequestId={terminalFocusRequestId} | | |
| 4963 | keybindings={keybindings} | | |
| 4964 | onAddTerminalContext={addTerminalContextToDraft} | | |
| 4965 | onSplitTerminal={splitPanelTerminal} | | |
| 4966 | onSplitTerminalVertical={splitPanelTerminalVertical} | | |
| 4967 | onNewTerminal={addTerminalSurface} | | |
| 4968 | onActiveTerminalChange={activatePanelTerminal} | | |
| 4969 | onCloseTerminal={closePanelTerminal} | | |
| 4970 | splitShortcutLabel={splitTerminalShortcutLabel ?? undefined} | | |
| 4971 | splitVerticalShortcutLabel={splitTerminalVerticalShortcutLabel ?? undefined} | | |
| 4972 | newShortcutLabel={newTerminalShortcutLabel ?? undefined} | | |
| 4973 | closeShortcutLabel={closeTerminalShortcutLabel ?? undefined} | | |
| 4974 | /> | | |
| 4975 | ) : activeRightPanelSurface?.kind === "diff" ? ( | | |
| 4976 | <Suspense fallback={null}> | | |
| 4977 | <DiffPanel mode="embedded" composerDraftTarget={composerDraftTarget} /> | | |
| 4978 | </Suspense> | | |
| 4979 | ) : (activeRightPanelSurface?.kind === "files" || | | |
| 4980 | activeRightPanelSurface?.kind === "file") && | | |
| 4981 | activeProject && | | |
| 4982 | activeWorkspaceRoot ? ( | | |
| 4983 | <Suspense fallback={null}> | | |
| 4984 | <FilePreviewPanel | | |
| 4985 | key={`${activeProject.environmentId}:${activeWorkspaceRoot}`} | | |
| 4986 | environmentId={activeProject.environmentId} | | |
| 4987 | cwd={activeWorkspaceRoot} | | |
| 4988 | projectName={activeProject.name} | | |
| 4989 | threadRef={activeThreadRef} | | |
| 4990 | composerDraftTarget={composerDraftTarget} | | |
| 4991 | keybindings={keybindings} | | |
| 4992 | availableEditors={availableEditors} | | |
| 4993 | relativePath={ | | |
| 4994 | activeRightPanelSurface.kind === "file" | | |
| 4995 | ? activeRightPanelSurface.relativePath | | |
| 4996 | : null | | |
| 4997 | } | | |
| 4998 | onOpenFile={openFileSurface} | | |
| 4999 | onPendingChange={handleFilePendingChange} | | |
| 5000 | /> | | |
| 5001 | </Suspense> | | |
| 5002 | ) : null} | | |
| 5003 | </RightPanelTabs> | 5053 | </RightPanelTabs> |
| 5004 | ) : null} | 5054 | ) : null} |
| 5005 | | 5055 | |
| 5006 | {shouldUsePlanSidebarSheet && rightPanelOpen && activeThreadRef ? ( | 5056 | {shouldUsePlanSidebarSheet && rightPanelOpen && activeThreadRef ? ( |
| 5007 | <RightPanelSheet open onClose={closePreviewPanel}> | 5057 | <RightPanelSheet open onClose={planSidebarOpen ? closePlanSidebar : closePreviewPanel}> |
| 5008 | <RightPanelTabs | 5058 | <RightPanelTabs |
| 5009 | mode="sheet" | 5059 | mode="sheet" |
| | 5060 | layoutControls={panelToggleControls} |
| 5010 | surfaces={rightPanelState.surfaces} | 5061 | surfaces={rightPanelState.surfaces} |
| 5011 | activeSurfaceId={activeRightPanelSurface?.id ?? null} | 5062 | activeSurfaceId={activeRightPanelSurface?.id ?? null} |
| 5012 | pendingSurfaceIds={pendingFileSurfaceIds} | 5063 | pendingSurfaceIds={pendingFileSurfaceIds} |
| ... | @@ -5026,75 +5077,7 @@ function ChatViewContent(props: ChatViewProps) { | ... | @@ -5026,75 +5077,7 @@ function ChatViewContent(props: ChatViewProps) { |
| 5026 | diffAvailable={isServerThread && isGitRepo} | 5077 | diffAvailable={isServerThread && isGitRepo} |
| 5027 | filesAvailable={Boolean(activeProject)} | 5078 | filesAvailable={Boolean(activeProject)} |
| 5028 | > | 5079 | > |
| 5029 | {activeRightPanelSurface?.kind === "preview" ? ( | 5080 | {rightPanelContent} |
| 5030 | <Suspense fallback={null}> | | |
| 5031 | <PreviewPanel | | |
| 5032 | mode="embedded" | | |
| 5033 | threadRef={activeThreadRef} | | |
| 5034 | tabId={activeRightPanelSurface.resourceId} | | |
| 5035 | configuredUrls={configuredPreviewUrls} | | |
| 5036 | visible | | |
| 5037 | /> | | |
| 5038 | </Suspense> | | |
| 5039 | ) : activeRightPanelSurface?.kind === "terminal" ? ( | | |
| 5040 | <PersistentThreadTerminalPanel | | |
| 5041 | threadRef={activeThreadRef} | | |
| 5042 | surface={activeRightPanelSurface} | | |
| 5043 | launchContext={activeTerminalLaunchContext ?? null} | | |
| 5044 | focusRequestId={terminalFocusRequestId} | | |
| 5045 | keybindings={keybindings} | | |
| 5046 | onAddTerminalContext={addTerminalContextToDraft} | | |
| 5047 | onSplitTerminal={splitPanelTerminal} | | |
| 5048 | onSplitTerminalVertical={splitPanelTerminalVertical} | | |
| 5049 | onNewTerminal={addTerminalSurface} | | |
| 5050 | onActiveTerminalChange={activatePanelTerminal} | | |
| 5051 | onCloseTerminal={closePanelTerminal} | | |
| 5052 | splitShortcutLabel={splitTerminalShortcutLabel ?? undefined} | | |
| 5053 | splitVerticalShortcutLabel={splitTerminalVerticalShortcutLabel ?? undefined} | | |
| 5054 | newShortcutLabel={newTerminalShortcutLabel ?? undefined} | | |
| 5055 | closeShortcutLabel={closeTerminalShortcutLabel ?? undefined} | | |
| 5056 | /> | | |
| 5057 | ) : activeRightPanelSurface?.kind === "diff" ? ( | | |
| 5058 | <Suspense fallback={null}> | | |
| 5059 | <DiffPanel mode="embedded" composerDraftTarget={composerDraftTarget} /> | | |
| 5060 | </Suspense> | | |
| 5061 | ) : activeRightPanelSurface?.kind === "plan" ? ( | | |
| 5062 | <PlanSidebar | | |
| 5063 | activePlan={activePlan} | | |
| 5064 | activeProposedPlan={sidebarProposedPlan} | | |
| 5065 | label={planSidebarLabel} | | |
| 5066 | environmentId={environmentId} | | |
| 5067 | threadRef={activeThreadRef} | | |
| 5068 | markdownCwd={gitCwd ?? undefined} | | |
| 5069 | workspaceRoot={activeWorkspaceRoot} | | |
| 5070 | timestampFormat={timestampFormat} | | |
| 5071 | mode="embedded" | | |
| 5072 | onClose={closePlanSidebar} | | |
| 5073 | /> | | |
| 5074 | ) : (activeRightPanelSurface?.kind === "files" || | | |
| 5075 | activeRightPanelSurface?.kind === "file") && | | |
| 5076 | activeProject && | | |
| 5077 | activeWorkspaceRoot ? ( | | |
| 5078 | <Suspense fallback={null}> | | |
| 5079 | <FilePreviewPanel | | |
| 5080 | key={`${activeProject.environmentId}:${activeWorkspaceRoot}`} | | |
| 5081 | environmentId={activeProject.environmentId} | | |
| 5082 | cwd={activeWorkspaceRoot} | | |
| 5083 | projectName={activeProject.name} | | |
| 5084 | threadRef={activeThreadRef} | | |
| 5085 | composerDraftTarget={composerDraftTarget} | | |
| 5086 | keybindings={keybindings} | | |
| 5087 | availableEditors={availableEditors} | | |
| 5088 | relativePath={ | | |
| 5089 | activeRightPanelSurface.kind === "file" | | |
| 5090 | ? activeRightPanelSurface.relativePath | | |
| 5091 | : null | | |
| 5092 | } | | |
| 5093 | onOpenFile={openFileSurface} | | |
| 5094 | onPendingChange={handleFilePendingChange} | | |
| 5095 | /> | | |
| 5096 | </Suspense> | | |
| 5097 | ) : null} | | |
| 5098 | </RightPanelTabs> | 5081 | </RightPanelTabs> |
| 5099 | </RightPanelSheet> | 5082 | </RightPanelSheet> |
| 5100 | ) : null} | 5083 | ) : null} |