Skip to content

Commit 5783280

Browse files
authored
fix(desktop): restore panel titlebar interactions (pingdotgg#9591)
Co-authored-by: maria-rcks <[email protected]>
1 parent 07891e9 commit 5783280

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,7 @@ function ChatViewContent(props: ChatViewProps) {
18881888
);
18891889
const rightPanelPresent = rightPanelPresence.present;
18901890
const rightPanelControlsInPanel = shouldUseRightPanelSheet && rightPanelPresent && rightPanelOpen;
1891+
const rightPanelControlsAtRoot = rightPanelPresent && !shouldUseRightPanelSheet;
18911892
const renderedRightPanelSurface = rightPanelPresence.value?.activeSurface ?? null;
18921893
const renderedRightPanelSurfaces = rightPanelPresence.value?.surfaces ?? [];
18931894
const previewMiniPlayerVisible = shouldRenderPreviewMiniPlayer(
@@ -7679,7 +7680,7 @@ function ChatViewContent(props: ChatViewProps) {
76797680

76807681
return (
76817682
<div className="relative flex min-h-0 min-w-0 flex-1 overflow-hidden bg-background">
7682-
{!rightPanelControlsInPanel ? panelLayoutControls : null}
7683+
{rightPanelControlsAtRoot ? panelLayoutControls : null}
76837684
<div
76847685
className={cn(
76857686
"flex min-h-0 min-w-0 flex-col overflow-x-hidden",
@@ -7694,6 +7695,13 @@ function ChatViewContent(props: ChatViewProps) {
76947695
reserveNativeControls={reserveTitleBarControlInset && !inlineRightPanelOwnsTitleBar}
76957696
className="relative bg-background"
76967697
>
7698+
{isElectron && rightPanelControlsAtRoot ? (
7699+
<span
7700+
aria-hidden
7701+
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]"
7702+
/>
7703+
) : null}
7704+
{!rightPanelControlsAtRoot && !rightPanelControlsInPanel ? panelLayoutControls : null}
76977705
<ChatHeader
76987706
{...(!supportsPullRequests || activeProjectRepository === null
76997707
? {}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,10 +1002,7 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
10021002
ref={tabListRef}
10031003
hideScrollbars
10041004
scrollFade
1005-
className={cn(
1006-
"min-w-0 flex-1 rounded-none",
1007-
ownsDesktopTitleBar && "[-webkit-app-region:no-drag]",
1008-
)}
1005+
className="min-w-0 flex-1 rounded-none"
10091006
data-right-panel-tab-list
10101007
>
10111008
<div className="flex h-full w-max min-w-full items-center gap-1">
@@ -1031,6 +1028,7 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
10311028
onContextMenu={(event) => void handleTabContextMenu(event, surface)}
10321029
className={cn(
10331030
"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",
1031+
ownsDesktopTitleBar && "[-webkit-app-region:no-drag]",
10341032
active
10351033
? "bg-accent text-foreground"
10361034
: "text-muted-foreground hover:bg-accent/60 hover:text-foreground",
@@ -1235,6 +1233,12 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
12351233
</div>
12361234
) : null}
12371235
{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}
12381242
</div>
12391243
<div className="flex min-h-0 flex-1 flex-col" data-right-panel-surface-content>
12401244
{props.activeSurfaceId === null ? (

0 commit comments

Comments
 (0)