fix(web): align every titlebar control cluster on one shared inset (#6592)
Co-authored-by: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
21a3669cee
commit
038560e580
5 files changed
+31
-10
No files matched your search
@@ -96,8 +96,11 @@ function SidebarControl() {
|
||||
}, [keybindings, toggleSidebar]);
|
||||
|
||||
return (
|
||||
// The right-side layout controls carry mr-px (border compensation inside
|
||||
// the panel), so the trigger mirrors it: both clusters sit one extra pixel
|
||||
// off their edge and the titlebar reads symmetric.
|
||||
<div
|
||||
className="pointer-events-none fixed left-[var(--workspace-controls-left)] top-[var(--workspace-controls-top)] z-50 flex h-[var(--workspace-topbar-height)] items-center"
|
||||
className="pointer-events-none fixed left-[var(--workspace-controls-left)] top-[var(--workspace-controls-top)] z-50 ml-px flex h-[var(--workspace-topbar-height)] items-center"
|
||||
data-sidebar-control=""
|
||||
>
|
||||
<Tooltip>
|
||||
|
||||
@@ -6583,7 +6583,11 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
<RightPanelSheet open onClose={closePreviewPanel}>
|
||||
<RightPanelTabs
|
||||
mode="sheet"
|
||||
layoutControls={panelToggleControls}
|
||||
// Same effective inset as the closed-state titlebar controls
|
||||
// (pr-3 in the tab bar plus this pixel equals the absolute
|
||||
// right inset plus mr-px), so the cluster does not creep when
|
||||
// the sheet opens.
|
||||
layoutControls={<div className="mr-px flex items-center">{panelToggleControls}</div>}
|
||||
surfaces={rightPanelState.surfaces}
|
||||
activeSurfaceId={activeRightPanelSurface?.id ?? null}
|
||||
pendingSurfaceIds={pendingFileSurfaceIds}
|
||||
|
||||
@@ -604,7 +604,9 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
|
||||
<div
|
||||
className={cn(
|
||||
"workspace-topbar gap-1 pl-2",
|
||||
props.mode !== "inline" && "[--workspace-topbar-height:--spacing(11)]",
|
||||
// The sheet overlays from the viewport top, so its tab bar keeps
|
||||
// the titlebar's height: a compact row re-centers the layout
|
||||
// controls a few pixels higher and the cluster jumps on open.
|
||||
props.mode === "inline" && !props.layoutControls ? "pr-28" : "pr-3",
|
||||
ownsDesktopTitleBar && "wco:pr-[calc(var(--workspace-native-controls-inset)+6rem)]",
|
||||
props.mode === "inline" && props.maximized && COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
|
||||
|
||||
@@ -48,7 +48,7 @@ export const PanelLayoutControls = memo(function PanelLayoutControls({
|
||||
size="sm"
|
||||
disabled={!terminalAvailable}
|
||||
>
|
||||
<PanelBottomIcon className="size-3.5" />
|
||||
<PanelBottomIcon className="size-4" />
|
||||
</Toggle>
|
||||
}
|
||||
/>
|
||||
@@ -75,7 +75,7 @@ export const PanelLayoutControls = memo(function PanelLayoutControls({
|
||||
size="sm"
|
||||
disabled={!rightPanelAvailable}
|
||||
>
|
||||
<PanelRightIcon className="size-3.5" />
|
||||
<PanelRightIcon className="size-4" />
|
||||
{liveAgentCount > 0 ? (
|
||||
<span
|
||||
aria-hidden
|
||||
@@ -122,9 +122,9 @@ export const RightPanelMaximizeControl = memo(function RightPanelMaximizeControl
|
||||
size="sm"
|
||||
>
|
||||
{maximized ? (
|
||||
<Minimize2Icon className="size-3.5" />
|
||||
<Minimize2Icon className="size-4" />
|
||||
) : (
|
||||
<Maximize2Icon className="size-3.5" />
|
||||
<Maximize2Icon className="size-4" />
|
||||
)}
|
||||
</Toggle>
|
||||
}
|
||||
|
||||
@@ -1303,7 +1303,13 @@ function PullRequestsRouteView() {
|
||||
/>
|
||||
);
|
||||
const openPanelControls = (
|
||||
<div className="workspace-titlebar-controls right-2 z-50 gap-1 [-webkit-app-region:no-drag] wco:right-[var(--workspace-controls-right)]">
|
||||
<div
|
||||
// The bare workspace-titlebar-controls inset plus mr-px: the same
|
||||
// anchor the thread view's controls and the sidebar trigger use, so
|
||||
// every titlebar cluster in the app sits one shared inset from its
|
||||
// edge.
|
||||
className="workspace-titlebar-controls z-50 mr-px gap-1 [-webkit-app-region:no-drag]"
|
||||
>
|
||||
{panelToggleControls}
|
||||
</div>
|
||||
);
|
||||
@@ -1484,7 +1490,13 @@ function PullRequestsRouteView() {
|
||||
searchInput,
|
||||
filtersMenu,
|
||||
rightPanelControl:
|
||||
!pullRequestsSupported || rightPanelState.isOpen ? null : panelToggleControls,
|
||||
// Footprint reserve while the panel is closed: the toggle itself stays
|
||||
// mounted at the fixed titlebar inset in both states so it cannot move
|
||||
// on toggle, and this spacer keeps refresh from sliding underneath it
|
||||
// (sized per header padding so refresh ends a normal gap short of it).
|
||||
!pullRequestsSupported || rightPanelState.isOpen ? null : (
|
||||
<span aria-hidden className="w-7 shrink-0 sm:w-5" />
|
||||
),
|
||||
rightPanelOpen: rightPanelState.isOpen,
|
||||
listBody,
|
||||
};
|
||||
@@ -1526,7 +1538,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 && rightPanelState.isOpen ? openPanelControls : null}
|
||||
{pullRequestsSupported ? openPanelControls : null}
|
||||
<PullRequestsColumn {...columnProps} />
|
||||
|
||||
{rightPanelState.isOpen && activePullRequestSurface && panelEnvironmentId !== null ? (
|
||||
|
||||
Reference in new issue
Block a user