"use client" /** * SiteHeader — breadcrumb / top bar — WCAG 2.1 AA * * ✓ SidebarTrigger wrapped in Tooltip — icon-only button (WCAG 4.1.2, 1.1.1) * ✓
landmark for AT navigation (WCAG 1.3.6) * ✓ Sticky at top — when stuck, the rounded breadcrumb sits on the app bg and a * bottom separator appears to anchor it; transparent at rest so the rounded * corners blend into the inset card. * ✓ Uses Inter (font-sans) — Ivy Presto is reserved for PageHeader

only */ import * as React from "react" import { PageBreadcrumbBack, PageBreadcrumbTrail, type PageBreadcrumbBackProps, type PageBreadcrumbTrailItem, } from "@/components/page-breadcrumb-trail" import { Separator } from "@/components/ui/separator" import { SidebarTrigger } from "@/components/ui/sidebar" import { Kbd, KbdGroup } from "@/components/ui/kbd" import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip" import { useModKeyLabel } from "@/hooks/use-mod-key-label" import { useScrollStuck } from "@/hooks/use-scroll-stuck" import { cn } from "@/lib/utils" import { useSecondaryPanel } from "@/components/sidebar/secondary-panel" export type BreadcrumbItem = PageBreadcrumbTrailItem export type SiteHeaderBackLink = Pick export interface SiteHeaderProps { /** Current page title (last breadcrumb segment in trail mode). */ title?: string /** Full breadcrumb trail — each item can be a link or plain text. Title is appended automatically as the last segment. */ breadcrumbs?: BreadcrumbItem[] /** * Back-icon variant — parent link only (no `title` segment in the header). * Prefer when the page `

` carries the current title (e.g. New question composer). */ back?: SiteHeaderBackLink } export function SiteHeader({ title = "Dashboard", breadcrumbs, back, }: SiteHeaderProps) { const mod = useModKeyLabel() const { focusShellSupersedesPrimarySidebar } = useSecondaryPanel() const isStuck = useScrollStuck() return (
{!focusShellSupersedesPrimarySidebar ? ( <> Toggle sidebar {mod} B ) : null} {back ? ( ) : ( )}
) }