diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index e69de418cd3ee..6b324d41bdc49 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -1124,7 +1124,8 @@ export default function ChatView(props: ChatViewProps) {
const rightPanelPresent = rightPanelPresence.present;
const rightPanelControlsInPanel =
shouldUsePlanSidebarSheet && rightPanelPresent && rightPanelOpen;
- const rightPanelControlsAtRoot = rightPanelPresent && !shouldUsePlanSidebarSheet;
+ // One mount point for open and closed, so the toggles are not remounted.
+ const rightPanelControlsAtRoot = !rightPanelControlsInPanel;
const renderedRightPanelSurface = rightPanelPresence.value?.activeSurface ?? null;
const renderedRightPanelSurfaces = rightPanelPresence.value?.surfaces ?? [];
const previewMiniPlayerVisible = shouldRenderPreviewMiniPlayer(
@@ -3371,7 +3372,6 @@ export default function ChatView(props: ChatViewProps) {
state={deviceState}
/>
)}
- {rightPanelControlsAtRoot && !embedded ? panelLayoutControls : null}
- {isElectron && rightPanelControlsAtRoot ? (
-
- ) : null}
- {!rightPanelControlsAtRoot && !rightPanelControlsInPanel ? panelLayoutControls : null}
{inlineRightPanelOwnsTitleBar ? threadPanelHeaderControl : null}
) : null}
+ {/* Electron caption hit-testing gives later no-drag regions precedence. */}
+ {rightPanelControlsAtRoot && !embedded ? panelLayoutControls : null}
+
}>
-
-
-
+ {terminalOpen ? (
+
+ ) : (
+
+ )}
+
{terminalAvailable
@@ -121,18 +128,22 @@ export const PanelLayoutControls = memo(function PanelLayoutControls({
{showRightPanelControl ? (
}>
-
-
-
+ {rightPanelOpen ? (
+
+ ) : (
+
+ )}
+
{rightPanelAvailable
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 05541d3970d1a..9de152c81f5c8 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -1479,22 +1479,26 @@ html[data-theme-id] [data-chat-header] [data-toolbar-control] {
color: var(--contrast-toolbar-control-foreground);
}
-/* The panel layout toggles stay ghost: they render both inside the header and
- in the titlebar strip, so filling them would make them change appearance as
- the panel opens. They only take the themed foreground; hover and pressed
- keep the base ghost accent. The tooltip trigger's data-slot wins over the
- toggle's when the trigger renders the toggle, so match both. */
+/* The panel layout controls stay ghost: some render inside the header and
+ others in the titlebar strip, so filling them would make them disagree. They
+ only take the themed foreground; hover and pressed keep the base ghost
+ accent. The tooltip trigger's data-slot wins over the control's when the
+ trigger renders it, so match both. */
html[data-theme-id] [data-panel-layout-controls] [data-slot="toggle"],
+html[data-theme-id] [data-panel-layout-controls] [data-slot="button"],
html[data-theme-id] [data-panel-layout-controls] [data-slot="tooltip-trigger"],
html[data-theme-id] [data-workspace-titlebar-controls] [data-slot="toggle"],
+html[data-theme-id] [data-workspace-titlebar-controls] [data-slot="button"],
html[data-theme-id] [data-workspace-titlebar-controls] [data-slot="tooltip-trigger"] {
--control-icon-color: var(--contrast-toolbar-foreground);
color: var(--contrast-toolbar-foreground);
}
html[data-theme-id] [data-panel-layout-controls] [data-slot="toggle"]:disabled,
+html[data-theme-id] [data-panel-layout-controls] [data-slot="button"]:disabled,
html[data-theme-id] [data-panel-layout-controls] [data-slot="tooltip-trigger"]:disabled,
html[data-theme-id] [data-workspace-titlebar-controls] [data-slot="toggle"]:disabled,
+html[data-theme-id] [data-workspace-titlebar-controls] [data-slot="button"]:disabled,
html[data-theme-id] [data-workspace-titlebar-controls] [data-slot="tooltip-trigger"]:disabled {
--control-icon-color: color-mix(
in oklab,