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.

426 B
Raw Blame
import { MAX_NAV_PINS, type NavPin } from './navPinStore'
import type { TabKey } from './tabHeaderStore'

export function visibleNavPins(
    pins: readonly NavPin[],
    tab: TabKey,
    flags: Record<NavPin, boolean>
): readonly NavPin[] {
    const visible =
        (tab === 'errors' || tab === 'replay') && !pins.includes(tab) ? [...pins, tab].slice(-MAX_NAV_PINS) : pins
    return visible.filter((pin) => flags[pin])
}