TypeScript
fix(desktop): restore panel titlebar interactions (#9591)
maria57832803eed4
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsxindex 1b9c106fe52..6cd83054b8e 100644--- a/apps/web/src/components/ChatView.tsx+++ b/apps/web/src/components/ChatView.tsx@@ -1888,6 +1888,7 @@ function ChatViewContent(props: ChatViewProps) {);const rightPanelPresent = rightPanelPresence.present;const rightPanelControlsInPanel = shouldUseRightPanelSheet && rightPanelPresent && rightPanelOpen;+ const rightPanelControlsAtRoot = rightPanelPresent && !shouldUseRightPanelSheet;const renderedRightPanelSurface = rightPanelPresence.value?.activeSurface ?? null;const renderedRightPanelSurfaces = rightPanelPresence.value?.surfaces ?? [];const previewMiniPlayerVisible = shouldRenderPreviewMiniPlayer(@@ -7679,7 +7680,7 @@ function ChatViewContent(props: ChatViewProps) {return (<div className="relative flex min-h-0 min-w-0 flex-1 overflow-hidden bg-background">- {!rightPanelControlsInPanel ? panelLayoutControls : null}+ {rightPanelControlsAtRoot ? panelLayoutControls : null}<divclassName={cn("flex min-h-0 min-w-0 flex-col overflow-x-hidden",@@ -7694,6 +7695,13 @@ function ChatViewContent(props: ChatViewProps) {reserveNativeControls={reserveTitleBarControlInset && !inlineRightPanelOwnsTitleBar}className="relative bg-background">+ {isElectron && rightPanelControlsAtRoot ? (+ <span+ aria-hidden+ 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]"+ />+ ) : null}+ {!rightPanelControlsAtRoot && !rightPanelControlsInPanel ? panelLayoutControls : null}<ChatHeader{...(!supportsPullRequests || activeProjectRepository === null? {}diff --git a/apps/web/src/components/RightPanelTabs.tsx b/apps/web/src/components/RightPanelTabs.tsxindex 7f68cd54310..e9dab0c9d2b 100644--- a/apps/web/src/components/RightPanelTabs.tsx+++ b/apps/web/src/components/RightPanelTabs.tsx@@ -1002,10 +1002,7 @@ export function RightPanelTabs(props: RightPanelTabsProps) {ref={tabListRef}hideScrollbarsscrollFade- className={cn(- "min-w-0 flex-1 rounded-none",- ownsDesktopTitleBar && "[-webkit-app-region:no-drag]",- )}+ className="min-w-0 flex-1 rounded-none"data-right-panel-tab-list><div className="flex h-full w-max min-w-full items-center gap-1">@@ -1031,6 +1028,7 @@ export function RightPanelTabs(props: RightPanelTabsProps) {onContextMenu={(event) => void handleTabContextMenu(event, surface)}className={cn("cursor-pointer group/tab flex h-6 max-w-36 shrink-0 items-center gap-0.5 rounded-md pr-2 pl-1.5 text-xs",+ ownsDesktopTitleBar && "[-webkit-app-region:no-drag]",active? "bg-accent text-foreground": "text-muted-foreground hover:bg-accent/60 hover:text-foreground",@@ -1235,6 +1233,12 @@ export function RightPanelTabs(props: RightPanelTabsProps) {</div>) : null}{props.layoutControls}+ {ownsDesktopTitleBar ? (+ <span+ aria-hidden+ 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]"+ />+ ) : null}</div><div className="flex min-h-0 flex-1 flex-col" data-right-panel-surface-content>{props.activeSurfaceId === null ? (