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.

778 B
Raw Blame
import { useOnMountEffect } from 'lib/hooks/useOnMountEffect'
import { lazyWithRetry } from 'lib/utils/retryImport'
import { sidePanelMaxLogic } from 'scenes/max/maxLogic'

// Lazy so the side panel registry doesn't pull Max's thread graph (Query, message widgets)
// into the shell chunk. SidePanel already wraps panel content in a Suspense boundary.
const MaxInstance = lazyWithRetry(() => import('scenes/max/Max').then((m) => ({ default: m.MaxInstance })))

export function SidePanelMax({ header }: { header?: JSX.Element | null }): JSX.Element | null {
    // Closing the panel unmounts this tree, so hold the chat logic to keep the open chat and draft.
    useOnMountEffect(() => {
        sidePanelMaxLogic()
    })

    return <MaxInstance sidePanel header={header} />
}