Skip to content
TypeScript

fix(web): keep right panel controls clickable (#9517)

maria0a0b6be96833
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index ece0a77ea62..4ba53f47b6a 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -1865,8 +1865,7 @@ function ChatViewContent(props: ChatViewProps) {
panelAnimationDurationMs,
);
const rightPanelPresent = rightPanelPresence.present;
- const rightPanelControlsInPanel =
- rightPanelPresent && (!shouldUseRightPanelSheet || rightPanelOpen);
+ const rightPanelControlsInPanel = rightPanelPresent && rightPanelOpen;
const renderedRightPanelSurface = rightPanelPresence.value?.activeSurface ?? null;
const renderedRightPanelSurfaces = rightPanelPresence.value?.surfaces ?? [];
const previewMiniPlayerVisible = shouldRenderPreviewMiniPlayer(
@@ -7451,6 +7450,15 @@ function ChatViewContent(props: ChatViewProps) {
<div className="pointer-events-auto flex h-full items-center">{panelToggleControls}</div>
</div>
);
+ const inlineRightPanelControls = (
+ <div className="mr-px flex h-full items-center gap-1 [-webkit-app-region:no-drag]">
+ <RightPanelMaximizeControl
+ maximized={rightPanelMaximized}
+ onToggle={toggleRightPanelMaximized}
+ />
+ {panelToggleControls}
+ </div>
+ );
const rightPanelContent = activeThreadRef ? (
renderedRightPanelSurface?.kind === "preview" ? (
<Suspense fallback={null}>
@@ -7611,7 +7619,7 @@ function ChatViewContent(props: ChatViewProps) {
reserveNativeControls={reserveTitleBarControlInset && !inlineRightPanelOwnsTitleBar}
className="relative bg-background"
>
- {!shouldUseRightPanelSheet || !rightPanelControlsInPanel ? panelLayoutControls : null}
+ {!rightPanelControlsInPanel ? panelLayoutControls : null}
<ChatHeader
{...(!supportsPullRequests || activeProjectRepository === null
? {}
@@ -8039,6 +8047,7 @@ function ChatViewContent(props: ChatViewProps) {
mode="inline"
open={rightPanelOpen}
maximized={rightPanelMaximized}
+ layoutControls={rightPanelOpen ? inlineRightPanelControls : null}
surfaces={renderedRightPanelSurfaces}
environmentId={activeThreadRef.environmentId}
activeSurfaceId={renderedRightPanelSurface?.id ?? null}
diff --git a/apps/web/src/components/RightPanelTabs.tsx b/apps/web/src/components/RightPanelTabs.tsx
index 8f1fff8dc72..7f68cd54310 100644
--- a/apps/web/src/components/RightPanelTabs.tsx
+++ b/apps/web/src/components/RightPanelTabs.tsx
@@ -990,7 +990,10 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
// controls a few pixels higher and the cluster jumps on open.
props.mode === "inline" && !props.layoutControls ? "pr-28" : "pr-3",
ownsDesktopTitleBar && "drag-region",
- ownsDesktopTitleBar && "wco:pr-[calc(var(--workspace-native-controls-inset)+6rem)]",
+ ownsDesktopTitleBar &&
+ (props.layoutControls
+ ? "wco:pr-[var(--workspace-native-controls-inset)]"
+ : "wco:pr-[calc(var(--workspace-native-controls-inset)+6rem)]"),
props.mode === "inline" && props.maximized && COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
)}
data-right-panel-tabbar