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.

perf(wizard): load the run details dialog only when it opens (#119015)

Paul D'Ambrab923ed34a2fc
diff --git a/frontend/bin/check-eager-graph.mjs b/frontend/bin/check-eager-graph.mjs
index cec4dece8c11..7c13fd602d49 100644
--- a/frontend/bin/check-eager-graph.mjs
+++ b/frontend/bin/check-eager-graph.mjs
@@ -104,7 +104,7 @@ const ROOTS = [
label: 'authenticated shell (every logged-in page)',
// 2026-10-11: 7.09 MiB eager output = 6.29 MiB JS (2463 files) + 0.80 MiB stable CSS.
// ~8% headroom so routine churn doesn't trip the warn.
- budgetBytes: 8_015_000,
+ budgetBytes: 7_860_000,
forbidden: [
'node_modules/monaco-editor/',
'src/lib/components/ActivityLog/describers',
@@ -115,6 +115,8 @@ const ROOTS = [
verifyPrefix: 'products/dashboards/frontend/widgets/',
},
'src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts',
+ // The wizard run card opens this drawer on click, and the drawer pulls in quill primitives.
+ 'products/wizard/frontend/runs/WizardRunDetailsDrawer.tsx',
// The zod-en-locale-only plugin in common/esbuilder/utils.mjs keeps every locale except
// `en` out of the build. A hit on another locale means zod moved its locales barrel and
// the plugin no longer matches it.
@@ -155,7 +157,7 @@ const ROOTS = [
'src/scenes/project-homepage/today/TodayHome.tsx',
],
label: 'today home path',
- budgetBytes: 8_270_000,
+ budgetBytes: 8_115_000,
forbidden: [
'src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx',
'src/scenes/project-homepage/today/TodayReportPage.tsx',
diff --git a/products/wizard/frontend/runs/WizardRunSyncProject.tsx b/products/wizard/frontend/runs/WizardRunSyncProject.tsx
index 4490ea5fb553..e9f633ac9cb7 100644
--- a/products/wizard/frontend/runs/WizardRunSyncProject.tsx
+++ b/products/wizard/frontend/runs/WizardRunSyncProject.tsx
@@ -1,10 +1,12 @@
import { useActions, useMountedLogic, useValues } from 'kea'
-import { useState } from 'react'
+import { Suspense, lazy, useState } from 'react'
import { lemonToast } from '@posthog/lemon-ui'
import { useInterval } from 'lib/hooks/useInterval'
import { elapsedSecondsFrom } from 'lib/utils/datetime'
+import { retryImport } from 'lib/utils/retryImport'
+import { ChunkLoadErrorBoundary } from 'scenes/ChunkLoadErrorBoundary'
import { sceneLogic } from 'scenes/sceneLogic'
import type { WizardRunApi } from '../generated/api.schemas'
@@ -12,10 +14,14 @@ import { wizardRunDetailsLogic } from '../wizardRunDetailsLogic'
import type { WizardRunDetailSource } from '../wizardRunDetailsLogic'
import { wizardRunIsActive } from '../wizardRunDisplay'
import { WizardRunSyncCard } from './WizardRunSyncCard'
-import { WizardRunSyncDetailsDialog } from './WizardRunSyncDetailsDialog'
import { wizardRunSyncLogic } from './wizardRunSyncLogic'
import { WizardRunSyncRunPicker } from './WizardRunSyncRunPicker'
+// Every logged-in page renders this component, and the dialog opens only on click.
+const WizardRunSyncDetailsDialog = lazy(() =>
+ retryImport(() => import('./WizardRunSyncDetailsDialog').then((m) => ({ default: m.WizardRunSyncDetailsDialog })))
+)
+
export function WizardRunSyncProject({ projectId }: { projectId: string }): JSX.Element {
const logic = wizardRunSyncLogic({ projectId })
useMountedLogic(logic)
@@ -71,12 +77,16 @@ export function WizardRunSyncProject({ projectId }: { projectId: string }): JSX.
</div>
)}
{dialogRun && (
- <WizardRunSyncDetailsDialog
- run={dialogRun.run}
- tasks={dialogRun.run.id === run?.id ? tasks : []}
- source={dialogRun.source}
- onClose={() => setDialogRun(null)}
- />
+ <ChunkLoadErrorBoundary>
+ <Suspense fallback={null}>
+ <WizardRunSyncDetailsDialog
+ run={dialogRun.run}
+ tasks={dialogRun.run.id === run?.id ? tasks : []}
+ source={dialogRun.source}
+ onClose={() => setDialogRun(null)}
+ />
+ </Suspense>
+ </ChunkLoadErrorBoundary>
)}
</>
)