: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(frontend): load the desktop push card logomark lazily (#126958)
Paul D'Ambra7b66dbf86c6f
diff --git a/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushDisplay.tsx b/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushDisplay.tsxindex ddda5a0d4fea..acbbade071f0 100644--- a/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushDisplay.tsx+++ b/frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushDisplay.tsx@@ -1,3 +1,5 @@+import { Suspense } from 'react'+import * as chart from '@posthog/brand/hoggies/png/chart'import * as codeBubble from '@posthog/brand/hoggies/png/code-bubble'import * as cursor from '@posthog/brand/hoggies/png/cursor'@@ -21,16 +23,20 @@ import * as transformer from '@posthog/brand/hoggies/png/transformer'import * as workflows from '@posthog/brand/hoggies/png/workflows'import * as xRay from '@posthog/brand/hoggies/png/x-ray'import { IconGithub } from '@posthog/icons'+import { PostHogErrorBoundary } from '@posthog/react'-import { Logomark } from 'lib/brand'import { pngHoggie } from 'lib/brand/hoggies'import { IconSlack } from 'lib/lemon-ui/icons'+import { lazyWithRetry } from 'lib/utils/retryImport'import { urls } from 'scenes/urls'import { ProductKey } from '~/queries/schema/schema-general'import type { ProductPushDisplay } from './navPanelAdShared'+// The logo geometry is large, and only the PostHog Desktop card shows it. Load it when that card renders.+const Logomark = lazyWithRetry(() => import('lib/brand').then(({ Logomark }) => ({ default: Logomark })))+const HedgehogChart = pngHoggie(chart)const HedgehogCodeBubble = pngHoggie(codeBubble)const HedgehogCursor = pngHoggie(cursor)@@ -231,7 +237,14 @@ export const PRODUCT_PUSH_DISPLAY: Partial<Record<ProductKey, ProductPushDisplayhref: urls.settings('environment-integrations', 'integration-github'),},[ProductKey.POSTHOG_DESKTOP]: {- Icon: <Logomark size="xl" />,+ Icon: (+ // The logo is decorative: if its chunk fails to load, hide it rather than reload the whole app.+ <PostHogErrorBoundary fallback={<></>}>+ <Suspense fallback={null}>+ <Logomark size="xl" />+ </Suspense>+ </PostHogErrorBoundary>+ ),iconUpright: true,accentColor: 'var(--color-accent)',tagline: