@@ -169,7 +169,7 @@ import { ExpandedImageDialog } from "./chat/ExpandedImageDialog";
169169import { PullRequestThreadDialog } from "./PullRequestThreadDialog" ;
170170import { MessagesTimeline } from "./chat/MessagesTimeline" ;
171171import { ChatHeader } from "./chat/ChatHeader" ;
172- import { PanelLayoutControls } from "./chat/PanelLayoutControls" ;
172+ import { PanelLayoutControls , RightPanelMaximizeControl } from "./chat/PanelLayoutControls" ;
173173import { type ExpandedImagePreview } from "./chat/ExpandedImagePreview" ;
174174import { NoActiveThreadState } from "./NoActiveThreadState" ;
175175import { resolveEffectiveEnvMode , resolveEnvironmentOptionLabel } from "./BranchToolbar.logic" ;
@@ -1331,9 +1331,8 @@ function ChatViewContent(props: ChatViewProps) {
13311331 const planSidebarOpen = activeRightPanelKind === "plan" ;
13321332 const previewPanelOpen = activeRightPanelKind === "preview" && isPreviewSupportedInRuntime ( ) ;
13331333 const rightPanelOpen = rightPanelState . isOpen ;
1334- const canMaximizeRightPanel = rightPanelOpen && ! shouldUsePlanSidebarSheet ;
13351334 const rightPanelMaximized =
1336- canMaximizeRightPanel && maximizedRightPanelThreadKey === routeThreadKey ;
1335+ rightPanelOpen && ! shouldUsePlanSidebarSheet && maximizedRightPanelThreadKey === routeThreadKey ;
13371336 const inlineRightPanelOwnsTitleBar = rightPanelOpen && ! shouldUsePlanSidebarSheet ;
13381337
13391338 useEffect ( ( ) => {
@@ -3114,7 +3113,7 @@ function ChatViewContent(props: ChatViewProps) {
31143113 useRightPanelStore . getState ( ) . toggleVisibility ( activeThreadRef ) ;
31153114 } , [ activeThreadRef , closePlanSidebar , closePreviewPanel , planSidebarOpen , rightPanelOpen ] ) ;
31163115 const toggleRightPanelMaximized = ( ) => {
3117- if ( ! canMaximizeRightPanel ) return ;
3116+ if ( ! rightPanelOpen || shouldUsePlanSidebarSheet ) return ;
31183117 setMaximizedRightPanelThreadKey ( ( threadKey ) =>
31193118 threadKey === routeThreadKey ? null : routeThreadKey ,
31203119 ) ;
@@ -4589,36 +4588,28 @@ function ChatViewContent(props: ChatViewProps) {
45894588 return < NoActiveThreadState /> ;
45904589 }
45914590
4592- const panelLayoutControls = (
4591+ const panelToggleControls = (
45934592 < PanelLayoutControls
45944593 terminalAvailable = { Boolean ( activeProject ) }
45954594 terminalOpen = { Boolean ( terminalUiState . terminalOpen ) }
45964595 terminalShortcutLabel = { terminalToggleShortcutLabel }
45974596 rightPanelAvailable = { Boolean ( activeProject ) }
45984597 rightPanelOpen = { rightPanelOpen }
45994598 rightPanelShortcutLabel = { rightPanelToggleShortcutLabel }
4600- rightPanelMaximized = { rightPanelMaximized }
4601- canMaximizeRightPanel = { canMaximizeRightPanel }
46024599 onToggleTerminal = { toggleTerminalVisibility }
46034600 onToggleRightPanel = { toggleRightPanel }
4604- onToggleRightPanelMaximized = { toggleRightPanelMaximized }
46054601 />
46064602 ) ;
4607- const sheetPanelLayoutControls = (
4608- < PanelLayoutControls
4609- placement = "panel-header"
4610- terminalAvailable = { Boolean ( activeProject ) }
4611- terminalOpen = { Boolean ( terminalUiState . terminalOpen ) }
4612- terminalShortcutLabel = { terminalToggleShortcutLabel }
4613- rightPanelAvailable = { Boolean ( activeProject ) }
4614- rightPanelOpen = { rightPanelOpen }
4615- rightPanelShortcutLabel = { rightPanelToggleShortcutLabel }
4616- rightPanelMaximized = { rightPanelMaximized }
4617- canMaximizeRightPanel = { canMaximizeRightPanel }
4618- onToggleTerminal = { toggleTerminalVisibility }
4619- onToggleRightPanel = { toggleRightPanel }
4620- onToggleRightPanelMaximized = { toggleRightPanelMaximized }
4621- />
4603+ const panelLayoutControls = (
4604+ < div className = "workspace-titlebar-controls z-50 gap-1 [-webkit-app-region:no-drag]" >
4605+ { rightPanelOpen && ! shouldUsePlanSidebarSheet ? (
4606+ < RightPanelMaximizeControl
4607+ maximized = { rightPanelMaximized }
4608+ onToggle = { toggleRightPanelMaximized }
4609+ />
4610+ ) : null }
4611+ { panelToggleControls }
4612+ </ div >
46224613 ) ;
46234614 const rightPanelContent = activeThreadRef ? (
46244615 activeRightPanelSurface ?. kind === "preview" ? (
@@ -4689,7 +4680,7 @@ function ChatViewContent(props: ChatViewProps) {
46894680 { isElectron && activeThreadRef ? (
46904681 < PreviewAutomationOwner threadRef = { activeThreadRef } visible = { previewPanelOpen } />
46914682 ) : null }
4692- { rightPanelOpen ? panelLayoutControls : null }
4683+ { rightPanelOpen && ! shouldUsePlanSidebarSheet ? panelLayoutControls : null }
46934684 < div
46944685 className = { cn (
46954686 "flex min-h-0 min-w-0 flex-col overflow-hidden" ,
@@ -4962,7 +4953,7 @@ function ChatViewContent(props: ChatViewProps) {
49624953 < RightPanelSheet open onClose = { planSidebarOpen ? closePlanSidebar : closePreviewPanel } >
49634954 < RightPanelTabs
49644955 mode = "sheet"
4965- headerControls = { sheetPanelLayoutControls }
4956+ layoutControls = { panelToggleControls }
49664957 surfaces = { rightPanelState . surfaces }
49674958 activeSurfaceId = { activeRightPanelSurface ?. id ?? null }
49684959 pendingSurfaceIds = { pendingFileSurfaceIds }
0 commit comments