Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(desktop): keep sidebar overlay below nav rail (#88093)

Peter Kirkhamb5efb42a704d
diff --git a/products/desktop/packages/ui/src/features/canvas/components/NavRail.test.tsx b/products/desktop/packages/ui/src/features/canvas/components/NavRail.test.tsx
index ca70aba6443a..896d0c0b357d 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/NavRail.test.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/NavRail.test.tsx
@@ -90,6 +90,12 @@ import { useCurrentChannelStore } from "@posthog/ui/features/canvas/stores/curre
import { useSidebarStore } from "@posthog/ui/features/sidebar/sidebarStore";
import { NavRail } from "./NavRail";
+it("stays above floating sidebar layers", () => {
+ render(<NavRail />);
+
+ expect(screen.getByTestId("nav-rail")).toHaveClass("z-[60]");
+});
+
/**
* Seed where each destination was, as the ACTIVE TAB remembers it. Rail memory
* lives on the tab rather than the window, so a pick in one tab can never
diff --git a/products/desktop/packages/ui/src/features/canvas/components/NavRail.tsx b/products/desktop/packages/ui/src/features/canvas/components/NavRail.tsx
index 92b8495af6e0..6895aaaff2e7 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/NavRail.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/NavRail.tsx
@@ -233,7 +233,8 @@ export function NavRail() {
// state, so isolated providers never share it.
<TooltipProvider delay={400}>
<div
- className="flex h-full shrink-0 flex-col items-center gap-1.5 bg-chrome py-2"
+ data-testid="nav-rail"
+ className="relative z-[60] flex h-full shrink-0 flex-col items-center gap-1.5 bg-chrome py-2"
style={{ width: NAV_RAIL_WIDTH }}
>
{destinations.map((destination) => {
diff --git a/products/desktop/packages/ui/src/router/routes/__root.tsx b/products/desktop/packages/ui/src/router/routes/__root.tsx
index 30badd2a723b..3fce14d6cedb 100644
--- a/products/desktop/packages/ui/src/router/routes/__root.tsx
+++ b/products/desktop/packages/ui/src/router/routes/__root.tsx
@@ -48,6 +48,7 @@ import { useIntegrations } from "@posthog/ui/features/integrations/useIntegratio
import { useLoopDeepLink } from "@posthog/ui/features/loops/hooks/useLoopDeepLink";
import { useScoutDeepLink } from "@posthog/ui/features/scouts/hooks/useScoutDeepLink";
import { useSetupDiscovery } from "@posthog/ui/features/setup/useSetupDiscovery";
+import { NAV_RAIL_WIDTH } from "@posthog/ui/features/sidebar/constants";
import {
beginSidebarPeek,
cancelSidebarPeek,
@@ -442,6 +443,7 @@ function RootLayout() {
{!sidebarOpen && (
<Box
aria-hidden
+ style={{ left: channelsLayout ? NAV_RAIL_WIDTH : 0 }}
// The radix preset replaces Tailwind's palette, so plain
// `bg-black/*` doesn't exist — use the radix black-alpha scale
// (--black-a2 = 10%, --black-a5 = 30%).