perf(dashboards): keep the saved insights list off insight cards - #110352
Conversation
InsightCard, the insight editor and other surfaces imported insight type metadata through SavedInsights.tsx, which re-exported insightTypesMetadata. That put the whole saved insights scene on the static graph of every scene that renders an insight. Importers now use insightTypesMetadata directly, InsightIcon has its own file, and the re-export is gone. The dashboard loads the add-insight modal, the last eager path to the list, when it opens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: acec8cb2-f000-4747-a659-05b72b42513e
|
😎 Merged successfully - details. |
🤖 CI report✅ Trunk lane — non-backend laneThis PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes.
|
| Function | Location | Complexity | Limit |
|---|---|---|---|
InsightDetailsInternal |
frontend/src/lib/components/Cards/InsightCard/InsightDetails.tsx:727 |
26 | 10 |
DashboardScene |
frontend/src/scenes/dashboard/Dashboard.tsx:104 |
26 | 10 |
SavedInsightsTable |
frontend/src/scenes/saved-insights/SavedInsightsTable.tsx:30 |
19 | 10 |
TopHeading |
frontend/src/lib/components/Cards/InsightCard/TopHeading.tsx:29 |
17 | 10 |
SavedInsights |
frontend/src/scenes/saved-insights/SavedInsights.tsx:59 |
17 | 10 |
SeriesDisplay |
frontend/src/lib/components/Cards/InsightCard/InsightDetails.tsx:209 |
13 | 10 |
✅ Duplication (Python) — clean
New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.
✅ Duplication (TypeScript) — clean
New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.
⚠️ Comment density — 6% of added code lines are comments (6 of 108)
This section warns when comments are more than 3% of the code lines a PR adds, and alerts above 6%. Before agent-assisted PRs, the typical share was about 2%. Only full-line comments count. Docstrings, generated files, snapshots, migrations, and workflow files are left out.
Comments that restate the code, record how the change came about, or narrate the next line add noise for the next reader. Keep the comments that explain a reason the code cannot show, and remove the rest. See .agents/skills/writing-code-comments/SKILL.md for the house rules.
Files with the most added comment lines:
| File | Comment lines | Added lines |
|---|---|---|
frontend/src/scenes/dashboard/Dashboard.tsx |
3 | 30 |
frontend/src/scenes/dashboard/DashboardModalLoading.tsx |
3 | 29 |
This check does not block merging. It updates on every push and clears when the share drops.
✅ Bundle size — 🟢 -333.2 KiB (-0.5%)
Uncompressed size of every built .js bundle, compared against the base branch.
Total: 70.36 MiB · 🟢 -333.2 KiB (-0.5%)
| File | Size | Δ vs base |
|---|---|---|
render-query/src/render-query/render-query.js |
19.75 MiB | 🟢 -487.9 KiB (-2.4%) |
exporter/src/exporter/scenes/ExporterNotebookScene.js |
3.83 MiB | 🔺 +131.1 KiB (+3.5%) |
posthog-app/src/scenes/saved-insights/SavedInsights.js |
91.5 KiB | 🔺 +79.7 KiB (+679.8%) |
posthog-app/src/scenes/dashboard/addInsightToDashboardModal/AddInsightToDashboardModal.js |
8.4 KiB | 🔺 +8.4 KiB (new) |
posthog-app/src/scenes/insights/InsightQuickStart/InsightQuickStart.js |
9.0 KiB | 🟢 -7.4 KiB (-45.3%) |
posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene.js |
10.9 KiB | 🟢 -7.2 KiB (-39.8%) |
posthog-app/_parent/products/posthog_ai/frontend/components/tool/widgets/SearchSessionRecordingsWidget.js |
5.2 KiB | 🟢 -6.9 KiB (-56.9%) |
exporter/src/scenes/dashboard/addInsightToDashboardModal/AddInsightToDashboardModal.js |
6.7 KiB | 🔺 +6.7 KiB (new) |
posthog-app/src/lib/components/ActivityLog/describers.js |
161.9 KiB | 🟢 -5.7 KiB (-3.4%) |
posthog-app/_parent/products/business_knowledge/frontend/scenes/settings/BusinessKnowledgeSettingsScene.js |
12.8 KiB | 🟢 -3.9 KiB (-23.5%) |
posthog-app/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene.js |
12.0 KiB | 🟢 -3.9 KiB (-24.6%) |
posthog-app/src/scenes/settings/SettingsMap.js |
11.9 KiB | 🟢 -3.9 KiB (-24.7%) |
posthog-app/src/scenes/settings/SettingsScene.js |
15.5 KiB | 🟢 -3.9 KiB (-20.2%) |
posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene.js |
14.0 KiB | 🟢 -3.9 KiB (-21.5%) |
posthog-app/_parent/products/error_tracking/frontend/posthogAi/ErrorTrackingWidget.js |
13.1 KiB | 🟢 -3.8 KiB (-22.2%) |
posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.js |
59.2 KiB | 🟢 -3.8 KiB (-6.0%) |
exporter/_parent/products/posthog_ai/frontend/components/tool/widgets/SearchSessionRecordingsWidget.js |
3.1 KiB | 🟢 -1.7 KiB (-35.5%) |
posthog-app/_parent/products/replay_vision/frontend/observations/ObservationRecording.js |
15.7 KiB | 🟢 -1.6 KiB (-9.0%) |
posthog-app/src/scenes/session-recordings/detail/SessionRecordingDetail.js |
16.0 KiB | 🟢 -1.6 KiB (-8.9%) |
posthog-app/src/scenes/session-recordings/file-playback/SessionRecordingFilePlaybackScene.js |
18.6 KiB | 🟢 -1.6 KiB (-7.7%) |
posthog-app/src/scenes/session-recordings/kiosk/SessionRecordingsKiosk.js |
23.9 KiB | 🟢 -1.6 KiB (-6.1%) |
posthog-app/src/scenes/session-recordings/player/modal/SessionPlayerModal.js |
16.5 KiB | 🟢 -1.6 KiB (-8.6%) |
posthog-app/src/scenes/session-recordings/playlist/SessionRecordingsPlaylistScene.js |
20.9 KiB | 🟢 -1.5 KiB (-6.8%) |
posthog-app/src/scenes/sessions/SessionProfileScene.js |
28.8 KiB | 🟢 -1.5 KiB (-5.0%) |
posthog-app/src/scenes/session-recordings/SessionRecordings.js |
15.3 KiB | 🟢 -1.4 KiB (-8.3%) |
posthog-app/src/scenes/session-recordings/settings/SessionRecordingsSettingsScene.js |
16.3 KiB | 🟢 -1.4 KiB (-7.9%) |
posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.js |
91.6 KiB | 🟢 -1.2 KiB (-1.3%) |
posthog-app/_parent/products/metrics/frontend/MetricsScene.js |
96.0 KiB | 🔺 +1.2 KiB (+1.2%) |
posthog-app/_parent/products/logs/frontend/LogsScene.js |
47.8 KiB | 🟢 -1020 B (-2.0%) |
Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report
✅ Eager graph — within budget
How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.
| Root | Eager (shipped) | Δ vs base | Budget |
|---|---|---|---|
entry (logged-out pages, app bootstrap)src/index.tsx |
1.62 MiB · 22 files | 🔺 +1 B (+0.0%) | █████████░ 87.9% of 1.84 MiB |
logged-out boot: index + App + bootApp (preloaded by every page, including /login)src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts |
3.58 MiB · 630 files | 🔺 +1.1 KiB (+0.0%) | █████████░ 88.7% of 4.03 MiB |
authenticated shell (every logged-in page)src/scenes/AuthenticatedShell.tsx |
7.75 MiB · 2,486 files | 🔺 +1.7 KiB (+0.0%) | █████████░ 93.0% of 8.34 MiB |
dashboard scenesrc/scenes/dashboard/Dashboard.tsx |
11.33 MiB · 4,076 files | 🟢 -335.6 KiB (-2.8%) | ████████░░ 84.1% of 13.48 MiB |
project home scenesrc/scenes/project-homepage/ProjectHomepage.tsx |
14.21 MiB · 5,038 files | 🟢 -217.8 KiB (-1.5%) | █████████░ 86.5% of 16.44 MiB |
events scenesrc/scenes/activity/explore/EventsScene.tsx |
10.47 MiB · 3,647 files | 🟢 -434.5 KiB (-3.9%) | ████████░░ 82.8% of 12.64 MiB |
replay detail scenesrc/scenes/session-recordings/detail/SessionRecordingDetail.tsx |
12.25 MiB · 4,158 files | 🟢 -1.52 MiB (-11.0%) | ████████░░ 78.0% of 15.72 MiB |
🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/layout/navigation-3000/navigationLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/scenes/dashboard/dashboardLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/lemon-ui/LemonMarkdown/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/RichContentEditor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/CodeSnippet/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/taxonomy/core-filter-definitions-by-group.json stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
Largest files eagerly shipped from src/index.tsx
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/index.tsx |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 854 B | src/scenes/ChunkLoadErrorBoundary.tsx |
Largest files eagerly shipped from src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
| Size | File |
|---|---|
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 219.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 100.5 KiB | src/lib/api.ts |
| 91.9 KiB | src/products.tsx |
| 69.4 KiB | src/lib/lemon-ui/icons/icons.tsx |
| 40.1 KiB | src/lib/utils/eventUsageLogic.ts |
| 38.7 KiB | ../node_modules/.pnpm/@dnd-kit+core@6.0.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/core/dist/core.esm.js |
| 33.9 KiB | ../node_modules/.pnpm/kea@4.0.0-pre.6_patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5_react@18.3.1/node_modules/kea/lib/index.cjs.js |
| 28.7 KiB | src/scenes/scenes.ts |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.9 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 219.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 109.9 KiB | ../packages/quill/packages/quill/dist/index.js |
| 100.5 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 91.9 KiB | src/products.tsx |
| 90.6 KiB | ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js |
Largest files eagerly shipped from src/scenes/dashboard/Dashboard.tsx
| Size | File |
|---|---|
| 315.5 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js |
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.9 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 219.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 181.8 KiB | src/queries/validators.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 109.9 KiB | ../packages/quill/packages/quill/dist/index.js |
| 100.5 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
Largest files eagerly shipped from src/scenes/project-homepage/ProjectHomepage.tsx
| Size | File |
|---|---|
| 315.5 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js |
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.9 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 219.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 181.8 KiB | src/queries/validators.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 109.9 KiB | ../packages/quill/packages/quill/dist/index.js |
| 100.5 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
Largest files eagerly shipped from src/scenes/activity/explore/EventsScene.tsx
| Size | File |
|---|---|
| 315.5 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js |
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.9 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 219.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 181.8 KiB | src/queries/validators.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 109.9 KiB | ../packages/quill/packages/quill/dist/index.js |
| 100.5 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
Largest files eagerly shipped from src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
| Size | File |
|---|---|
| 315.5 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js |
| 306.2 KiB | ../node_modules/.pnpm/posthog-js@1.435.5_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.9 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 219.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 181.8 KiB | src/queries/validators.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 109.9 KiB | ../packages/quill/packages/quill/dist/index.js |
| 100.5 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Toolbar bundle — eager 2.19 MiB within budget
What the toolbar ships to customer pages, measured from the esbuild output (minified, post-tree-shake). The eager set is the entry plus everything statically imported from it — fetched before any feature runs; deferred chunks load lazily. The eager guardrail is 5.72 MiB. Each output file must also stay below 10 MB, where CloudFront stops compressing it. The module boundary is enforced separately by check-toolbar-graph.
| Metric | Size | Δ vs base | Budget |
|---|---|---|---|
| Eager (shipped) entry + static imports |
2.19 MiB · 19 files | 🔺 +331 B (+0.0%) | ████░░░░░░ 38.3% of 5.72 MiB |
| Deferred (lazy) | 2.10 MiB · 44 files | no change | n/a — loads on demand |
Loader dist/toolbar.js |
1.2 KiB | no change | █░░░░░░░░░ 6.0% of 19.5 KiB |
Largest eagerly-shipped chunks
| Size | File |
|---|---|
| 830.3 KiB | dist/toolbar/toolbar-app-JYLOHLGI.css |
| 657.1 KiB | dist/toolbar/chunk-chunk-6PGJOX6X.js |
| 259.4 KiB | dist/toolbar/chunk-chunk-VJB3SXU4.js |
| 138.2 KiB | dist/toolbar/chunk-chunk-FMTPJS5R.js |
| 131.8 KiB | dist/toolbar/chunk-chunk-FDH2IBXT.js |
| 75.2 KiB | dist/toolbar/toolbar-app-5IKUZTIC.js |
| 69.0 KiB | dist/toolbar/chunk-chunk-TSAL54PB.js |
| 35.6 KiB | dist/toolbar/chunk-chunk-AXBVQLMJ.js |
| 21.0 KiB | dist/toolbar/chunk-chunk-KBIC7JXJ.js |
| 6.8 KiB | dist/toolbar/chunk-chunk-DV7IWQNF.js |
Posted automatically by check-toolbar-size · sizes are toolbar output bytes (shipped, post-tree-shake) from the esbuild metafile
✅ Dist folder size — 🟢 -3.56 MiB (-0.4%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 961.96 MiB · 🟢 -3.56 MiB (-0.4%)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🦔 Hogbox preview · ✅ ready▶ Open the preview
commit |
👀 Auto-assigned reviewersThese soft owners were skipped because they only have minor changes here. Nothing blocks merge, so self-assign if you'd like a look:
Soft owners come from each directory's |
|
FLASH MODE - Faster, but stupid, use regular ReviewHog for a heavy review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fffb236b6b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (11)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: PostHog/posthog/.coderabbit.yaml Review profile: QUIET Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughInsight icons and type metadata now have dedicated import modules, and consumers use those modules instead of importing them from Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The dashboard modal now loads on demand while preserving loading feedback, close behavior, and accessibility; no concrete merge-blocking risk remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The modal retains its dashboard edit and access checks, and closing it during loading uses the existing visibility state. No security regression was established. Remaining uncertainty concerns failure recovery across other dashboard embedding surfaces. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
…nloads The lazy add-insight modal used a null Suspense fallback, so on a cold cache the Add insight click had no visible response and nothing to close until the saved insights list arrived. It now falls back to DashboardModalLoading, a spinner modal wired to the modal's open state and hide action. It waits briefly before it appears, so a cached chunk swaps straight to the real modal. DashboardModalLoading is byte-identical to the copy in the sibling dashboard modals PR, so the two merge cleanly in either order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: acec8cb2-f000-4747-a659-05b72b42513e
|
Risk: No findings This delta adds a mirrored telemetry capture on modal close during chunk loading and an accessible label to the Suspense fallback spinner in the dashboard scene. Both changes handle only internal UI state and hardcoded strings; no security-relevant surface is introduced or altered. Sentinel reviewed |
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
frontend/src/scenes/dashboard/DashboardModalLoading.tsx-26-28 (1)
26-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winGive the loading indicator accessible status text.
The supplied
Spinnerimplementation renders an unlabelled SVG. This modal provides no text that identifies the loading state. Add a status container with accessible text;role="status"provides polite live-region semantics. (w3.org)Proposed fix
- <div className="flex justify-center p-8"> + <div className="flex justify-center p-8" role="status"> + <span className="sr-only">Loading insights</span> <Spinner /> </div>Based on learnings: “loading spinner/indicator elements should include ARIA attributes” describing the loading state.
Source: Learnings
🧹 Nitpick comments (1)
frontend/src/scenes/dashboard/DashboardModalLoading.tsx (1)
17-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMove the delayed visibility state into a Kea logic.
DashboardModalLoadingis a scene component, so the library-component exception does not apply. Movevisibleand the timer lifecycle into a feature-local Kea logic. Preserve the timer cleanup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
Review profile: QUIET
Plan: Enterprise
Run ID: 76b6e5df-427e-4d8d-b202-5e0d2a7e9239
📒 Files selected for processing (3)
frontend/src/scenes/dashboard/Dashboard.tsxfrontend/src/scenes/dashboard/DashboardModalLoading.test.tsxfrontend/src/scenes/dashboard/DashboardModalLoading.tsx
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 3 remain after this review.
|
Note 🤖 Automated comment by QA Swarm — not written by a human Router pass over the full diff, then a second pass over the fix commits. No delegated lenses: danger graded LOW. Verdict: ✅ APPROVE (@ a4954a3)No findings. ReviewHog and Codex asked for loading feedback while the add-insight chunk downloads; fixed in a4954a3 with Checked against the lazy-load checklist from the #110093–#110095 reviews: Automated by QA Swarm — not a human review |
The loading modal showed a bare spinner with no accessible name, so a screen
reader got no loading announcement. It now wraps the spinner in a role="status"
region named from a label prop ("Loading insights" here).
Closing while the chunk loads called the hide action directly, which skipped the
'insight dashboard modal - closed' event that the real modal emits, leaving
close counts short. The fallback now captures that event before hiding, the same
as AddInsightToDashboardModal.handleClose.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Generated-By: PostHog Desktop
Task-Id: acec8cb2-f000-4747-a659-05b72b42513e
A new stamphog review started for this PR — the fresh verdict replaces this approval.
A new stamphog review started for this PR — the fresh verdict replaces this approval.
There was a problem hiding this comment.
Approved.
Mechanical frontend import refactor plus a lazy-loaded modal with a Suspense fallback. It sits outside risky territory, and no importers of the removed re-exports remain.
- Author wrote 3% of the modified lines and has 44 merged PRs in these paths (familiarity MODERATE).
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 139L, 19F substantive, 165L/20F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (165L, 20F, two-areas, perf) |
| stamphog 2.3.1 | .stamphog/policy.yml @ 588615f · reviewed head 588615f |

Problem
InsightCard, the insight editor and other surfaces import type metadata throughSavedInsights.tsx, which re-exportsinsightTypesMetadata.Refs #104853
Related: #110351, #110353, #110354, #110355, #110356
Changes
insightTypesMetadatadirectly,InsightIconhas its own file, and theexport *shim is gone. This is mechanical, and nothing a user sees changes.Together the six PRs cut the dashboard scene from 11.66 to 9.62 MiB (−2.04 MiB), events from 10.89 to 9.23 MiB, replay detail from 13.77 to 12.06 MiB, and project home from 14.43 to 13.89 MiB (minified, linked stylesheet included, same master build). Several modules have more than one importer, so part of the saving appears only once all six land.
On its own this PR removes about 350 KB from the dashboard scene and 420 KB from events. It is also the largest share of the combined saving: without it, about 1.3 MB stays on both.
How did you test this code?
SavedInsights.tsxleaves the dashboard and events graphs.Test rationale: No new test. The change moves imports and one component, and the typecheck covers every importer.
Release status
Automatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Opus 5.5 (
claude-opus-5-5)lazyWithRetryfor every dynamic import, aChunkLoadErrorBoundarywith a fallback inside query and card error boundaries, and loading only on open or expand.gh pr list --state openfound no PR that does this.Created with PostHog Desktop
🤖 Generated with Claude Code