Skip to content

Commit 7a9714e

Browse files
committed
fix(desktop): keep panel controls stationary
1 parent c7bc773 commit 7a9714e

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,8 @@ function ChatViewContent(props: ChatViewProps) {
18841884
panelAnimationDurationMs,
18851885
);
18861886
const rightPanelPresent = rightPanelPresence.present;
1887-
const rightPanelControlsInPanel = rightPanelPresent && rightPanelOpen;
1887+
const rightPanelControlsInPanel = shouldUseRightPanelSheet && rightPanelPresent && rightPanelOpen;
1888+
const rightPanelControlsAtRoot = rightPanelPresent && !shouldUseRightPanelSheet;
18881889
const renderedRightPanelSurface = rightPanelPresence.value?.activeSurface ?? null;
18891890
const renderedRightPanelSurfaces = rightPanelPresence.value?.surfaces ?? [];
18901891
const previewMiniPlayerVisible = shouldRenderPreviewMiniPlayer(
@@ -7526,15 +7527,6 @@ function ChatViewContent(props: ChatViewProps) {
75267527
<div className="pointer-events-auto flex h-full items-center">{panelToggleControls}</div>
75277528
</div>
75287529
);
7529-
const inlineRightPanelControls = (
7530-
<div className="mr-px flex h-full items-center gap-1 [-webkit-app-region:no-drag]">
7531-
<RightPanelMaximizeControl
7532-
maximized={rightPanelMaximized}
7533-
onToggle={toggleRightPanelMaximized}
7534-
/>
7535-
{panelToggleControls}
7536-
</div>
7537-
);
75387530
const rightPanelContent = activeThreadRef ? (
75397531
renderedRightPanelSurface?.kind === "preview" ? (
75407532
<Suspense fallback={null}>
@@ -7681,6 +7673,7 @@ function ChatViewContent(props: ChatViewProps) {
76817673

76827674
return (
76837675
<div className="relative flex min-h-0 min-w-0 flex-1 overflow-hidden bg-background">
7676+
{rightPanelControlsAtRoot ? panelLayoutControls : null}
76847677
<div
76857678
className={cn(
76867679
"flex min-h-0 min-w-0 flex-col overflow-x-hidden",
@@ -7695,7 +7688,13 @@ function ChatViewContent(props: ChatViewProps) {
76957688
reserveNativeControls={reserveTitleBarControlInset && !inlineRightPanelOwnsTitleBar}
76967689
className="relative bg-background"
76977690
>
7698-
{!rightPanelControlsInPanel ? panelLayoutControls : null}
7691+
{isElectron && rightPanelControlsAtRoot ? (
7692+
<span
7693+
aria-hidden
7694+
className="pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] h-[var(--workspace-topbar-height)] w-28 [-webkit-app-region:no-drag]"
7695+
/>
7696+
) : null}
7697+
{!rightPanelControlsAtRoot && !rightPanelControlsInPanel ? panelLayoutControls : null}
76997698
<ChatHeader
77007699
{...(!supportsPullRequests || activeProjectRepository === null
77017700
? {}
@@ -8126,7 +8125,6 @@ function ChatViewContent(props: ChatViewProps) {
81268125
mode="inline"
81278126
open={rightPanelOpen}
81288127
maximized={rightPanelMaximized}
8129-
layoutControls={rightPanelOpen ? inlineRightPanelControls : null}
81308128
surfaces={renderedRightPanelSurfaces}
81318129
environmentId={activeThreadRef.environmentId}
81328130
activeSurfaceId={renderedRightPanelSurface?.id ?? null}

‎apps/web/src/components/RightPanelTabs.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,12 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
12331233
</div>
12341234
) : null}
12351235
{props.layoutControls}
1236+
{ownsDesktopTitleBar ? (
1237+
<span
1238+
aria-hidden
1239+
className="pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] h-[var(--workspace-topbar-height)] w-28 [-webkit-app-region:no-drag]"
1240+
/>
1241+
) : null}
12361242
</div>
12371243
<div className="flex min-h-0 flex-1 flex-col" data-right-panel-surface-content>
12381244
{props.activeSurfaceId === null ? (

0 commit comments

Comments
 (0)