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): give every pane title bar the same left inset (#104671)

Shy Alter80a56ebeb0be
diff --git a/products/desktop/AGENTS.md b/products/desktop/AGENTS.md
index 6c427e1e865a..20be6fe71cbd 100644
--- a/products/desktop/AGENTS.md
+++ b/products/desktop/AGENTS.md
@@ -338,7 +338,7 @@ New tests must not need it.
- No barrel files (`index.ts`).
- Use Tailwind first. Keep classes sorted. Use inline `style` only for runtime values, library configuration, or CSS variables.
- Empty/placeholder/loading screens (canvas and elsewhere) are a `@posthog/quill` `<Empty>` (`EmptyHeader` → `EmptyMedia variant="icon"` → `EmptyTitle` → `EmptyDescription`, then `EmptyContent` for CTAs). Don't hand-roll the centered Flex + dashed icon box. CTAs are quill `Button`s: primary action `variant="primary"`, secondary `variant="outline"`, `size="default"`. For a link CTA use `render={<Link … />}` (Base UI), not `asChild`.
-- The bar across the top of a pane, a column or a side panel is `ChromeBar` (`packages/ui/src/primitives`), never a hand-written row. It fixes the height at 40px, the border and the colour; the caller supplies the breadcrumb, title or search header inside it and the controls through `actions`. `inset` says how far from the edges the contents sit: `control` when the bar starts with a button, `text` when it starts with a label, `even` for a bar with the same padding both ends. Fifteen copies of this row had drifted into three border colours and four paddings before it existed.
+- The bar across the top of a pane, a column or a side panel is `ChromeBar` (`packages/ui/src/primitives`), never a hand-written row. It fixes the height at 40px, the border and the colour; the caller supplies the breadcrumb, title or search header inside it and the controls through `actions`. `inset` says how far from the edges the contents sit: `control` when the bar starts with a button, `text` when it starts with a label, `even` for a bar with the same padding both ends, `title` for a pane's own title bar. A title bar holds its contents on `PANE_INSET`, the same inset as the body under it, so the title starts on the line of the page it names; title content that starts with a `size="sm"` button adds `LEADING_BUTTON_PULL` to cancel that button's own padding. A title that pads itself instead drifts from every other pane. Fifteen copies of this row had drifted into three border colours and four paddings before it existed.
- Loading indicators are `Spinner` and `LoadingState` from `packages/ui/src/primitives`. `LoadingState` fills a pane or section while its data loads (24px spinner, optional label). `Spinner` sits inline in a button, row or badge; omit `size` inside quill buttons and media slots so it matches the icons beside it, and pick `xs`/`sm`/`md`/`lg` elsewhere. Do not import `Spinner` from `@posthog/quill` or `@radix-ui/themes`, and do not spin phosphor's `CircleNotch` or `SpinnerGap`: Biome rejects those imports. Pass `aria-hidden="true"` when the spinner sits next to visible loading text or inside an element that already announces the loading state, so the label is not read twice. The braille `DotsCircleSpinner` and `DotRingSpinner` mark agent activity (a running tool call, a working task), not data loading.
- Abort controllers before awaiting cleanup that depends on them.
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ChannelBreadcrumb.tsx b/products/desktop/packages/ui/src/features/canvas/components/ChannelBreadcrumb.tsx
index 858731a775e4..d625e0bf7e92 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ChannelBreadcrumb.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ChannelBreadcrumb.tsx
@@ -5,6 +5,7 @@ import {
ContextMenuItem,
ContextMenuSeparator,
ContextMenuTrigger,
+ cn,
Tooltip,
TooltipContent,
TooltipTrigger,
@@ -20,6 +21,7 @@ import {
BreadcrumbSegment,
BreadcrumbSeparator,
} from "@posthog/ui/primitives/Breadcrumb";
+import { LEADING_BUTTON_PULL } from "@posthog/ui/primitives/ChromeBar";
import { toast } from "@posthog/ui/primitives/toast";
import { track } from "@posthog/ui/shell/analytics";
import { Flex } from "@radix-ui/themes";
@@ -111,7 +113,12 @@ export function ChannelBreadcrumb({
);
return (
- <Flex align="center" justify="between" gap="2" className="w-full min-w-0">
+ <Flex
+ align="center"
+ justify="between"
+ gap="2"
+ className={cn("w-full min-w-0", LEADING_BUTTON_PULL)}
+ >
{/* flex-1 so the inline editor can stretch across the row; the trailing
slot still sits at the far end. */}
<Flex align="center" gap="0.5" className="min-w-0 flex-1">
diff --git a/products/desktop/packages/ui/src/features/canvas/components/ShellLayout.tsx b/products/desktop/packages/ui/src/features/canvas/components/ShellLayout.tsx
index 57c73f126dcd..8d0f3bf1f61f 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/ShellLayout.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/ShellLayout.tsx
@@ -408,7 +408,7 @@ export function ShellLayout() {
canvas actions (Edit / New canvas) on the right.
Freeform canvases own their own date control in-app (DateTimePicker). */}
{showToolbar && (
- <ChromeBar inset="control">
+ <ChromeBar inset="title">
{isDashboardDetail && toolbarDashboardId && toolbarChannelId ? (
<CanvasBreadcrumb
channelName={toolbarChannelName}
diff --git a/products/desktop/packages/ui/src/features/canvas/components/SpaceHeaderRow.tsx b/products/desktop/packages/ui/src/features/canvas/components/SpaceHeaderRow.tsx
index c9fa22fab189..a53dfc0aac79 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/SpaceHeaderRow.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/SpaceHeaderRow.tsx
@@ -19,7 +19,7 @@ export function SpaceHeaderRow({ task }: { task?: Task }) {
if (tiled || (!content && !task && !showsActivitySession)) return null;
return (
- <ChromeBar inset="control">
+ <ChromeBar inset="title">
<div className="flex h-full min-w-0 flex-1 items-center justify-between overflow-hidden">
{content}
</div>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/SpacesIndex.tsx b/products/desktop/packages/ui/src/features/canvas/components/SpacesIndex.tsx
index 25f6ad762450..dc704fa1ad35 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/SpacesIndex.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/SpacesIndex.tsx
@@ -199,7 +199,7 @@ export function SpacesIndex() {
useMemo(
() => (
<>
- <div className="flex min-w-0 items-center gap-1.5 pl-5">
+ <div className="flex min-w-0 items-center gap-1.5">
<span className="shrink-0 text-muted-foreground">
<SpacesIcon size={14} />
</span>
diff --git a/products/desktop/packages/ui/src/features/canvas/components/work/SpaceTabbedPage.tsx b/products/desktop/packages/ui/src/features/canvas/components/work/SpaceTabbedPage.tsx
index 2f0bd6d03776..c4a659f4dfc7 100644
--- a/products/desktop/packages/ui/src/features/canvas/components/work/SpaceTabbedPage.tsx
+++ b/products/desktop/packages/ui/src/features/canvas/components/work/SpaceTabbedPage.tsx
@@ -26,6 +26,7 @@ import {
import { useContextLayerFlag } from "@posthog/ui/features/feature-flags/useContextLayerFlag";
import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";
import { useSetHeaderContent } from "@posthog/ui/hooks/useSetHeaderContent";
+import { PANE_INSET } from "@posthog/ui/primitives/ChromeBar";
import { track } from "@posthog/ui/shell/analytics";
import { useNavigate, useRouter } from "@tanstack/react-router";
import { type ReactNode, useEffect, useMemo } from "react";
@@ -78,7 +79,7 @@ function SpaceStar({ channel }: { channel: Channel }) {
);
}
-export const SPACE_TAB_INSET = "px-6";
+export const SPACE_TAB_INSET = PANE_INSET;
export function SpaceTabbedPage({
channelId,
@@ -110,7 +111,7 @@ export function SpaceTabbedPage({
useSetHeaderContent(
useMemo(
() => (
- <div className="flex min-w-0 items-center gap-1.5 pl-5">
+ <div className="flex min-w-0 items-center gap-1.5">
<span className="shrink-0 text-muted-foreground">
{channelGlyph(channel?.name, {
size: 14,
diff --git a/products/desktop/packages/ui/src/features/inbox/components/InboxDetailFrameView.tsx b/products/desktop/packages/ui/src/features/inbox/components/InboxDetailFrameView.tsx
index b4bcc036970c..d33dd298cff3 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/InboxDetailFrameView.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/InboxDetailFrameView.tsx
@@ -128,7 +128,7 @@ export function InboxDetailFrameView({
return (
<div className="@container flex min-h-full flex-col">
{!ownsChrome && (
- <ChromeBar inset="control" actions={actions}>
+ <ChromeBar inset="title" actions={actions}>
{trail}
</ChromeBar>
)}
diff --git a/products/desktop/packages/ui/src/features/inbox/components/ReportBreadcrumbs.tsx b/products/desktop/packages/ui/src/features/inbox/components/ReportBreadcrumbs.tsx
index fd6e1f04575e..68682fd0a7c7 100644
--- a/products/desktop/packages/ui/src/features/inbox/components/ReportBreadcrumbs.tsx
+++ b/products/desktop/packages/ui/src/features/inbox/components/ReportBreadcrumbs.tsx
@@ -1,5 +1,6 @@
import { humanizeReportTitle } from "@posthog/core/inbox/reportPresentation";
import { prettifyScoutSkillName } from "@posthog/core/scouts/scoutPresentation";
+import { cn } from "@posthog/quill";
import type { SignalReport } from "@posthog/shared/types";
import { useChannels } from "@posthog/ui/features/canvas/hooks/useChannels";
import {
@@ -10,6 +11,7 @@ import {
BreadcrumbSegment,
BreadcrumbSeparator,
} from "@posthog/ui/primitives/Breadcrumb";
+import { LEADING_BUTTON_PULL } from "@posthog/ui/primitives/ChromeBar";
import {
type NavigationSource,
resolveNavigationSource,
@@ -41,7 +43,12 @@ export function ReportBreadcrumbs({
);
return (
- <div className="flex min-w-0 items-center gap-0.5 overflow-hidden">
+ <div
+ className={cn(
+ "flex min-w-0 items-center gap-0.5 overflow-hidden",
+ LEADING_BUTTON_PULL,
+ )}
+ >
{crumbs.map((crumb, index) => (
<div
key={`${index}-${crumb.label}`}
diff --git a/products/desktop/packages/ui/src/primitives/ChromeBar.tsx b/products/desktop/packages/ui/src/primitives/ChromeBar.tsx
index 667a9370d950..8dea76457fd4 100644
--- a/products/desktop/packages/ui/src/primitives/ChromeBar.tsx
+++ b/products/desktop/packages/ui/src/primitives/ChromeBar.tsx
@@ -2,12 +2,28 @@ import { cn } from "@posthog/quill";
import type { ReactElement, ReactNode } from "react";
/** A leading button carries its own padding; leading text does not. */
-type ChromeBarInset = "control" | "text" | "even";
+type ChromeBarInset = "control" | "text" | "even" | "title";
+
+/**
+ * How far a pane holds its contents off its left edge. The pane title bar
+ * (`inset="title"`) and the body under it share this one value, so a title
+ * starts on the same line as the page it names.
+ */
+export const PANE_INSET = "px-6";
+
+/**
+ * A leading quill `size="sm"` button carries 8px of its own padding, which
+ * puts its glyph 8px right of the bar's inset. Content that starts with such a
+ * button pulls that padding back, so every title starts on the inset whether
+ * it is a breadcrumb or plain text.
+ */
+export const LEADING_BUTTON_PULL = "-ml-2";
const INSET_CLASS: Record<ChromeBarInset, string> = {
control: "pr-2 pl-1",
text: "pr-2 pl-3",
even: "px-3",
+ title: "pr-2 pl-6",
};
/**
diff --git a/products/desktop/packages/ui/src/shell/ContentHeader.tsx b/products/desktop/packages/ui/src/shell/ContentHeader.tsx
index d19dcc51bc1e..d24c78249bca 100644
--- a/products/desktop/packages/ui/src/shell/ContentHeader.tsx
+++ b/products/desktop/packages/ui/src/shell/ContentHeader.tsx
@@ -40,7 +40,7 @@ export function ContentHeader() {
if (!content && !showTaskSection) return null;
return (
- <ChromeBar inset="control">
+ <ChromeBar inset="title">
{content && (
<div className="flex h-full min-w-0 flex-1 items-center justify-between overflow-hidden">
{content}