fix(web): restore right panel toggle clicks after closing on desktop (#8016)

This commit is contained in:
Utkarsh Patil authored and GitHub committed 2026-08-23 14:46:12 -04:00
1 parent 9da0fab08e
commit 09df91f729
1 file changed
+22 -4
+22 -4
View File
@@ -1502,6 +1502,13 @@ function PullRequestsRouteView() {
!pullRequestsSupported || rightPanelState.isOpen ? null : (
<span aria-hidden className="w-7 shrink-0 sm:w-5" />
),
titlebarControls:
// While the panel is closed the strip lives inside the header: a no-drag
// descendant beats the header's desktop drag-region, where a floating
// sibling loses (app-region hit-testing ignores z-index). Open, it moves
// back out to the route container, which spans the panel too, so the
// toggle keeps one fixed top-right anchor and never jumps sideways.
pullRequestsSupported && !rightPanelState.isOpen ? openPanelControls : null,
rightPanelOpen: rightPanelState.isOpen,
listBody,
};
@@ -1543,7 +1550,7 @@ function PullRequestsRouteView() {
return (
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
<div className="relative flex min-h-0 flex-1">
{pullRequestsSupported ? openPanelControls : null}
{pullRequestsSupported && rightPanelState.isOpen ? openPanelControls : null}
<PullRequestsColumn {...columnProps} />
{rightPanelState.isOpen && activePullRequestSurface && panelEnvironmentId !== null ? (
@@ -1759,6 +1766,7 @@ function PullRequestsColumn({
searchInput,
filtersMenu,
rightPanelControl,
titlebarControls,
rightPanelOpen,
listBody,
}: {
@@ -1775,6 +1783,7 @@ function PullRequestsColumn({
searchInput: ReactNode;
filtersMenu: ReactNode;
rightPanelControl: ReactNode;
titlebarControls: ReactNode;
rightPanelOpen: boolean;
listBody: ReactNode;
}) {
@@ -1838,9 +1847,18 @@ function PullRequestsColumn({
// content surface that lets it show reads as a different background than every thread.
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background">
{/* A closed right panel leaves this column full-width, so the shared header
reserves native window controls. While the panel is open, the column ends
at the panel and the absolute controls strip owns the top-right corner. */}
<WorkspacePageHeader electron={isElectron} reserveNativeControls={!rightPanelOpen}>
reserves native window controls and hosts the controls strip itself: on
desktop the header is a drag-region, and only a no-drag descendant wins
clicks from it - a floating sibling loses to app-region hit-testing no
matter its z-index. While the panel is open, the strip mounts back at
the route level, whose box spans the panel too, so the toggle keeps one
fixed top-right anchor. */}
<WorkspacePageHeader
electron={isElectron}
reserveNativeControls={!rightPanelOpen}
className="relative bg-background"
>
{titlebarControls}
{condensed ? (
<WorkspaceBreadcrumb ariaLabel="Pull request scope">
{/* The page name remains the foreground anchor in both states; the live filters are