Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/code/src/main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ export function createWindow(): void {
// buttons (40px bar, 24px buttons → centre at y=20; 12px dots → top at 14).
// x mirrors y so the inset from the top and the left match.
trafficLightPosition: { x: 14, y: 14 },
// Exposes the titlebar-area-* CSS env vars so the renderer can
// clear the traffic lights exactly; their size varies by macOS
// version (bigger on Tahoe), so it must not hardcode a width.
titleBarOverlay: true,
}
: process.platform === "win32"
? {
Expand Down
12 changes: 9 additions & 3 deletions packages/ui/src/router/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import { onFeatureFlagsLoaded } from "@posthog/ui/shell/posthogAnalyticsImpl";
import { SpaceSwitcher } from "@posthog/ui/shell/SpaceSwitcher";
import { useShortcutsSheetStore } from "@posthog/ui/shell/shortcutsSheetStore";
import { openUrlInBrowser } from "@posthog/ui/utils/browser";
import { isWindows } from "@posthog/ui/utils/platform";
import { isMac, isWindows } from "@posthog/ui/utils/platform";
import { getPostHogUrl } from "@posthog/ui/utils/urls";
import { Box, Flex } from "@radix-ui/themes";
import { useQueryClient } from "@tanstack/react-query";
Expand Down Expand Up @@ -338,7 +338,9 @@ function RootLayout() {
{/* Full-width title bar: a window-drag region carrying the PostHog
mark. The left section matches the sidebar width so the tab strip
starts flush with the content pane; its padding clears the macOS
stoplights. */}
stoplights via env(titlebar-area-x), the system-reported right
edge of the traffic-light strip (see titleBarOverlay in
window.ts). */}
<Flex
align="center"
className="drag h-10 shrink-0"
Expand All @@ -351,8 +353,12 @@ function RootLayout() {
align="center"
justify="between"
gap="3"
className="shrink-0 pr-2 pl-[78px]"
className="shrink-0 pr-2"
style={{
// Traffic-light size varies by macOS version, so a fixed inset
// over- or under-shoots; the env var fallback covers hosts
// without Window Controls Overlay.
paddingLeft: isMac ? "env(titlebar-area-x, 78px)" : "78px",
width: sidebarOpen ? channelsSidebarWidth : undefined,
// Same curve/duration as ResizableSidebar's SLIDE_EASING so the
// title bar tracks the sidebar edge.
Expand Down
Loading