Skip to content

feat(insights): show legend on lifecycle chart#60459

Merged
sampennington merged 6 commits into
masterfrom
sam/lifecycle-chart-legend
Jun 1, 2026
Merged

feat(insights): show legend on lifecycle chart#60459
sampennington merged 6 commits into
masterfrom
sam/lifecycle-chart-legend

Conversation

@sampennington
Copy link
Copy Markdown
Contributor

Problem

The new hog-charts based lifecycle chart (behind PRODUCT_ANALYTICS_HOG_CHARTS_LIFECYCLE) didn't render a legend, even when the user enabled "Show legend" in the editor. The legacy Chart.js version rendered the standard top legend with shortened status labels — this PR restores that on the hog-charts path.

Changes

  • TrendsLifecycleChart reads showLegend from trendsDataLogic and wraps the chart in a new <ChartLegend> with New / Returning / Resurrecting / Dormant swatches above the bars when on. Status order, colors and labels match the bars (uses legendItemsFromSeries).
  • New <ChartLegend show items position> convenience in lib/hog-charts — wraps ChartLegendLayout + Legend, returns children unwrapped when show=false or items=[], and bakes the parent-fill flex classes in so adapters in a flex-col parent don't have to.
  • ChartLegendLayout chart slot is now a flex container (flex flex-col) with self-stretch so the inner chart's flex: 1 resolves and the chart fills the cross axis regardless of the align prop — required to make the first real consumer (lifecycle) work in .TrendsInsight. Existing positions (top/bottom/left/right) still pass their tests.

How did you test this code?

I'm an agent. Manually verified the layout in the running dev server (chart fills the slot under the legend; toggling "Show legend" off restores the original full-height chart with no wrapper). Added automated coverage:

  • TrendsLifecycleChart.test.tsx — new cases for showLegend=true (legend rendered with all four status labels) and unset (no legend in DOM).
  • ChartLegend.test.tsx — show=false / empty items / show=true / all four positions.
  • All 29 tests across the legend dir + lifecycle adapter pass.

Did not run a project-wide type check (OOMs locally); CI will pick that up.

Publish to changelog?

🤖 Agent context

Claude Code (Opus 4.7, 1M ctx). Initial pass put the legend on lifecycle and only fixed the ChartLegendLayout chart slot to stretch on the cross axis — the chart then collapsed to zero height because the slot was display: block and the inner chart's flex: 1 had no flex parent to resolve against. Second fix made the slot a flex flex-col container too. After that the call site still had the awkward if (!showLegend) return chart; else wrap in ChartLegendLayout shape, so the second commit extracted <ChartLegend show items position> as a high-level wrapper that hides the layout/orientation plumbing and the parent-fill classes from adapters.

Considered alternatives: a legend prop directly on each chart (rejected — couples legend rendering into every chart wrapper) and inspecting children to derive items from the chart's series (rejected — fragile). Settled on an explicit items prop so consumers control how items are derived/filtered, and the caller can reuse legendItemsFromSeries(series, theme) or build a custom list.

Code-reviewer agent flagged a dataAttr naming footgun (the prop landed on the inner <Legend> while ChartLegendLayout.dataAttr lands on the outer wrapper) — renamed to legendDataAttr in the third commit before any second consumer adopts it. Also trimmed multi-line comments and tightened the "renders children unwrapped" tests to assert exactly one top-level child.

@sampennington sampennington marked this pull request as ready for review May 28, 2026 15:47
@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team May 28, 2026 15:48
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Size Change: +7.22 kB (+0.01%)

Total Size: 80.8 MB

📦 View Changed
Filename Size Change
frontend/dist-report/exporter/_chunks/chunk 8.43 MB +2.36 kB (+0.03%)
frontend/dist-report/posthog-app/_chunks/chunk 8.63 MB +2.36 kB (+0.03%)
frontend/dist-report/render-query/src/render-query/render-query 27.4 MB +2.5 kB (+0.01%)
ℹ️ View Unchanged
Filename Size Change
frontend/dist-report/decompression-worker/src/scenes/session-recordings/player/snapshot-processing/decompressionWorker 2.85 kB 0 B
frontend/dist-report/exporter/_parent/products/actions/frontend/pages/Action 25 kB 0 B
frontend/dist-report/exporter/_parent/products/actions/frontend/pages/Actions 1.33 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityScene 118 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilitySessionScene 18.3 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityTraceScene 130 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityUsers 872 B 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/clusters/AIObservabilityClusterScene 21.7 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/clusters/AIObservabilityClustersScene 55.1 kB -6 B (-0.01%)
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetScene 21 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene 3.64 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation 59.9 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene 28.2 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/EvaluationTemplates 915 B 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/LLMASessionFeedbackDisplay 5.19 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/playground/AIObservabilityPlaygroundScene 37.8 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/prompts/LLMPromptScene 29.2 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/prompts/LLMPromptsScene 4.83 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/skills/LLMSkillScene 929 B 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/skills/LLMSkillsScene 946 B 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/tags/AIObservabilityTag 27.4 kB 0 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/tags/AIObservabilityTagsScene 7.31 kB 0 B
frontend/dist-report/exporter/_parent/products/business_knowledge/frontend/scenes/BusinessKnowledgeScene 19 kB 0 B
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/Assignee/CyclotronJobInputAssignee 1.67 kB 0 B
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/SlaBusinessHours/CyclotronJobInputBusinessHours 3.06 kB 0 B
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/TicketTags/CyclotronJobInputTicketTags 1.06 kB 0 B
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene 1.82 kB 0 B
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/ticket/SupportTicketScene 33.9 kB 0 B
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/tickets/SupportTicketsScene 1.07 kB 0 B
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/CustomerAnalyticsScene 53.1 kB 0 B
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene 2.65 kB 0 B
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene 2.18 kB 0 B
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene 7.86 kB 0 B
frontend/dist-report/exporter/_parent/products/data_warehouse/DataWarehouseScene 46.8 kB 0 B
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/NewSourceScene/NewSourceScene 1.12 kB 0 B
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SchemaScene/SchemaScene 24.4 kB 0 B
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SourceScene/SourceScene 1.06 kB 0 B
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene 6.31 kB 0 B
frontend/dist-report/exporter/_parent/products/deployments/frontend/Deployment 4.05 kB 0 B
frontend/dist-report/exporter/_parent/products/deployments/frontend/DeploymentProject 5.58 kB 0 B
frontend/dist-report/exporter/_parent/products/deployments/frontend/Deployments 9.31 kB 0 B
frontend/dist-report/exporter/_parent/products/early_access_features/frontend/EarlyAccessFeature 1.02 kB 0 B
frontend/dist-report/exporter/_parent/products/early_access_features/frontend/EarlyAccessFeatures 3.24 kB 0 B
frontend/dist-report/exporter/_parent/products/endpoints/frontend/EndpointScene 40.6 kB 0 B
frontend/dist-report/exporter/_parent/products/endpoints/frontend/EndpointsScene 24.5 kB 0 B
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/ErrorTrackingIssueFingerprintsScene 7.41 kB 0 B
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene 104 kB 0 B
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene 27.1 kB 0 B
frontend/dist-report/exporter/_parent/products/feature_flags/frontend/FeatureFlagTemplatesScene 7.38 kB 0 B
frontend/dist-report/exporter/_parent/products/games/368Hedgehogs/368Hedgehogs 5.61 kB 0 B
frontend/dist-report/exporter/_parent/products/games/FlappyHog/FlappyHog 6.12 kB 0 B
frontend/dist-report/exporter/_parent/products/legal_documents/frontend/scenes/LegalDocumentNewScene 59.7 kB 0 B
frontend/dist-report/exporter/_parent/products/legal_documents/frontend/scenes/LegalDocumentsScene 5.31 kB 0 B
frontend/dist-report/exporter/_parent/products/links/frontend/LinkScene 25.2 kB 0 B
frontend/dist-report/exporter/_parent/products/links/frontend/LinksScene 4.55 kB 0 B
frontend/dist-report/exporter/_parent/products/live_debugger/frontend/LiveDebugger 19.5 kB 0 B
frontend/dist-report/exporter/_parent/products/logs/frontend/LogsScene 17.9 kB 0 B
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene 17.3 kB 0 B
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsSamplingDetailScene/LogsSamplingDetailScene 5.3 kB 0 B
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsSamplingNewScene/LogsSamplingNewScene 2.25 kB 0 B
frontend/dist-report/exporter/_parent/products/managed_migrations/frontend/ManagedMigration 14.9 kB 0 B
frontend/dist-report/exporter/_parent/products/mcp_analytics/frontend/MCPAnalyticsScene 40.5 kB 0 B
frontend/dist-report/exporter/_parent/products/mcp_analytics/frontend/MCPAnalyticsToolDetail 18.5 kB 0 B
frontend/dist-report/exporter/_parent/products/metrics/frontend/MetricsScene 16.2 kB 0 B
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart 3.31 kB 0 B
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart 3.14 kB 0 B
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart 7.36 kB 0 B
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart 4.41 kB +168 B (+3.96%)
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart 4.6 kB 0 B
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart 4.35 kB 0 B
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/observations/ReplayObservation 8.14 kB 0 B
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ReplayScanner 34 kB 0 B
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ReplayScannersScene 11.6 kB 0 B
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ScannerTemplatesScene 4.59 kB 0 B
frontend/dist-report/exporter/_parent/products/revenue_analytics/frontend/RevenueAnalyticsScene 26.5 kB 0 B
frontend/dist-report/exporter/_parent/products/session_summaries/frontend/SessionGroupSummariesTable 5.05 kB 0 B
frontend/dist-report/exporter/_parent/products/session_summaries/frontend/SessionGroupSummaryScene 19.2 kB 0 B
frontend/dist-report/exporter/_parent/products/tasks/frontend/SlackTaskContextScene 8.88 kB 0 B
frontend/dist-report/exporter/_parent/products/tasks/frontend/TaskDetailScene 23.8 kB 0 B
frontend/dist-report/exporter/_parent/products/tasks/frontend/TaskTracker 14.6 kB 0 B
frontend/dist-report/exporter/_parent/products/tracing/frontend/TracingScene 54.4 kB 0 B
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterview 9.32 kB 0 B
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterviewResponse 7.79 kB 0 B
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterviews 6.08 kB 0 B
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewIndexScene 2.56 kB 0 B
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewRunScene 44.7 kB 0 B
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewRunsScene 7.32 kB 0 B
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSettingsScene 11.1 kB 0 B
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotHistoryScene 13.9 kB 0 B
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotOverviewScene 19.6 kB 0 B
frontend/dist-report/exporter/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate 16.6 kB 0 B
frontend/dist-report/exporter/_parent/products/workflows/frontend/Workflows/WorkflowScene 111 kB 0 B
frontend/dist-report/exporter/_parent/products/workflows/frontend/WorkflowsScene 60.2 kB 0 B
frontend/dist-report/exporter/src/exporter/exporter 19.7 kB 0 B
frontend/dist-report/exporter/src/exporter/scenes/ExporterDashboardScene 2.02 kB 0 B
frontend/dist-report/exporter/src/exporter/scenes/ExporterHeatmapScene 19.9 kB 0 B
frontend/dist-report/exporter/src/exporter/scenes/ExporterInsightScene 3.02 kB 0 B
frontend/dist-report/exporter/src/exporter/scenes/ExporterInterviewScene 310 kB 0 B
frontend/dist-report/exporter/src/exporter/scenes/ExporterNotebookScene 2.71 MB 0 B
frontend/dist-report/exporter/src/exporter/scenes/ExporterRecordingScene 1.13 kB 0 B
frontend/dist-report/exporter/src/exporterSharedChunkAnchors 1.19 kB 0 B
frontend/dist-report/exporter/src/lib/components/Cards/TextCard/TextCardMarkdownEditor 11.3 kB 0 B
frontend/dist-report/exporter/src/lib/components/MonacoDiffEditor 471 B 0 B
frontend/dist-report/exporter/src/lib/lemon-ui/LemonMarkdown/MermaidDiagram 2.25 kB 0 B
frontend/dist-report/exporter/src/lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown 842 B 0 B
frontend/dist-report/exporter/src/lib/lemon-ui/Link/Link 359 B 0 B
frontend/dist-report/exporter/src/lib/monaco/CodeEditorInline 832 B 0 B
frontend/dist-report/exporter/src/lib/monaco/vimMode 211 kB 0 B
frontend/dist-report/exporter/src/lib/ui/Button/ButtonPrimitives 422 B 0 B
frontend/dist-report/exporter/src/queries/nodes/WebVitals/WebVitals 7.52 kB 0 B
frontend/dist-report/exporter/src/queries/nodes/WebVitals/WebVitalsPathBreakdown 4.09 kB 0 B
frontend/dist-report/exporter/src/queries/schema 852 kB 0 B
frontend/dist-report/exporter/src/scenes/approvals/changeRequestsLogic 884 B 0 B
frontend/dist-report/exporter/src/scenes/authentication/passkeyLogic 824 B 0 B
frontend/dist-report/exporter/src/scenes/data-pipelines/event-filtering/EventFilterScene 22.2 kB 0 B
frontend/dist-report/exporter/src/scenes/data-pipelines/TransformationsScene 6.54 kB 0 B
frontend/dist-report/exporter/src/scenes/insights/views/BoxPlot/BoxPlot 5.39 kB 0 B
frontend/dist-report/exporter/src/scenes/insights/views/CalendarHeatMap/CalendarHeatMap 8.84 kB 0 B
frontend/dist-report/exporter/src/scenes/insights/views/RegionMap/RegionMap 29.8 kB 0 B
frontend/dist-report/exporter/src/scenes/insights/views/WorldMap/WorldMap 1.04 MB 0 B
frontend/dist-report/exporter/src/scenes/models/ModelsScene 19 kB 0 B
frontend/dist-report/exporter/src/scenes/models/NodeDetailScene 17 kB 0 B
frontend/dist-report/monaco-editor-worker/src/lib/monaco/workers/monacoEditorWorker 288 kB 0 B
frontend/dist-report/monaco-json-worker/src/lib/monaco/workers/monacoJsonWorker 419 kB 0 B
frontend/dist-report/monaco-typescript-worker/src/lib/monaco/workers/monacoTsWorker 7.02 MB 0 B
frontend/dist-report/posthog-app/_parent/products/actions/frontend/pages/Action 25.1 kB 0 B
frontend/dist-report/posthog-app/_parent/products/actions/frontend/pages/Actions 1.4 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityScene 119 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilitySessionScene 18.4 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityTraceScene 130 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityUsers 906 B 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/clusters/AIObservabilityClusterScene 21.7 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/clusters/AIObservabilityClustersScene 55.1 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetScene 21 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene 3.67 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation 59.9 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene 28.2 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/EvaluationTemplates 949 B 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/LLMASessionFeedbackDisplay 5.23 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/playground/AIObservabilityPlaygroundScene 37.8 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/prompts/LLMPromptScene 29.2 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/prompts/LLMPromptsScene 4.86 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/skills/LLMSkillScene 963 B 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/skills/LLMSkillsScene 980 B 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/tags/AIObservabilityTag 27.4 kB 0 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/tags/AIObservabilityTagsScene 7.34 kB 0 B
frontend/dist-report/posthog-app/_parent/products/business_knowledge/frontend/scenes/BusinessKnowledgeScene 19 kB 0 B
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/Assignee/CyclotronJobInputAssignee 1.71 kB 0 B
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/SlaBusinessHours/CyclotronJobInputBusinessHours 3.09 kB 0 B
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/TicketTags/CyclotronJobInputTicketTags 1.09 kB 0 B
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene 1.85 kB 0 B
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/ticket/SupportTicketScene 26.6 kB 0 B
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/tickets/SupportTicketsScene 1.11 kB 0 B
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/CustomerAnalyticsScene 51.9 kB 0 B
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene 2.68 kB 0 B
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene 2.22 kB 0 B
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene 7.9 kB 0 B
frontend/dist-report/posthog-app/_parent/products/data_warehouse/DataWarehouseScene 1.81 kB 0 B
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/NewSourceScene/NewSourceScene 1.18 kB 0 B
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SchemaScene/SchemaScene 24.4 kB 0 B
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SourceScene/SourceScene 1.1 kB 0 B
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene 6.34 kB 0 B
frontend/dist-report/posthog-app/_parent/products/deployments/frontend/Deployment 4.08 kB 0 B
frontend/dist-report/posthog-app/_parent/products/deployments/frontend/DeploymentProject 5.61 kB 0 B
frontend/dist-report/posthog-app/_parent/products/deployments/frontend/Deployments 9.35 kB 0 B
frontend/dist-report/posthog-app/_parent/products/early_access_features/frontend/EarlyAccessFeature 1.2 kB 0 B
frontend/dist-report/posthog-app/_parent/products/early_access_features/frontend/EarlyAccessFeatures 3.28 kB 0 B
frontend/dist-report/posthog-app/_parent/products/endpoints/frontend/EndpointScene 40.7 kB 0 B
frontend/dist-report/posthog-app/_parent/products/endpoints/frontend/EndpointsScene 22.4 kB 0 B
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/ErrorTrackingIssueFingerprintsScene 7.48 kB 0 B
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene 103 kB 0 B
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene 27.2 kB 0 B
frontend/dist-report/posthog-app/_parent/products/feature_flags/frontend/FeatureFlagTemplatesScene 7.42 kB 0 B
frontend/dist-report/posthog-app/_parent/products/games/368Hedgehogs/368Hedgehogs 5.65 kB 0 B
frontend/dist-report/posthog-app/_parent/products/games/FlappyHog/FlappyHog 6.16 kB 0 B
frontend/dist-report/posthog-app/_parent/products/legal_documents/frontend/scenes/LegalDocumentNewScene 59.8 kB 0 B
frontend/dist-report/posthog-app/_parent/products/legal_documents/frontend/scenes/LegalDocumentsScene 5.35 kB 0 B
frontend/dist-report/posthog-app/_parent/products/links/frontend/LinkScene 25.2 kB 0 B
frontend/dist-report/posthog-app/_parent/products/links/frontend/LinksScene 4.58 kB 0 B
frontend/dist-report/posthog-app/_parent/products/live_debugger/frontend/LiveDebugger 19.5 kB 0 B
frontend/dist-report/posthog-app/_parent/products/logs/frontend/LogsScene 17.9 kB 0 B
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene 17.4 kB 0 B
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsSamplingDetailScene/LogsSamplingDetailScene 5.34 kB 0 B
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsSamplingNewScene/LogsSamplingNewScene 2.29 kB 0 B
frontend/dist-report/posthog-app/_parent/products/managed_migrations/frontend/ManagedMigration 14.9 kB 0 B
frontend/dist-report/posthog-app/_parent/products/mcp_analytics/frontend/MCPAnalyticsScene 40.6 kB 0 B
frontend/dist-report/posthog-app/_parent/products/mcp_analytics/frontend/MCPAnalyticsToolDetail 18.6 kB 0 B
frontend/dist-report/posthog-app/_parent/products/metrics/frontend/MetricsScene 16.2 kB 0 B
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart 3.34 kB 0 B
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart 3.18 kB 0 B
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart 7.4 kB 0 B
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart 4.45 kB +174 B (+4.07%)
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart 4.64 kB 0 B
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart 4.38 kB 0 B
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/observations/ReplayObservation 8.18 kB 0 B
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ReplayScanner 34 kB 0 B
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ReplayScannersScene 11.6 kB 0 B
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ScannerTemplatesScene 4.63 kB 0 B
frontend/dist-report/posthog-app/_parent/products/revenue_analytics/frontend/RevenueAnalyticsScene 26.6 kB 0 B
frontend/dist-report/posthog-app/_parent/products/session_summaries/frontend/SessionGroupSummariesTable 5.09 kB 0 B
frontend/dist-report/posthog-app/_parent/products/session_summaries/frontend/SessionGroupSummaryScene 19.3 kB 0 B
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/SlackTaskContextScene 8.91 kB 0 B
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/TaskDetailScene 23.9 kB 0 B
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/TaskTracker 14.7 kB 0 B
frontend/dist-report/posthog-app/_parent/products/tracing/frontend/TracingScene 54.5 kB 0 B
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterview 9.35 kB 0 B
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterviewResponse 7.83 kB 0 B
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterviews 6.12 kB 0 B
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewIndexScene 2.59 kB 0 B
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewRunScene 44.7 kB 0 B
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewRunsScene 7.36 kB 0 B
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSettingsScene 11.1 kB 0 B
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotHistoryScene 13.9 kB 0 B
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotOverviewScene 19.6 kB 0 B
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate 16.7 kB 0 B
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/Workflows/WorkflowScene 104 kB 0 B
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/WorkflowsScene 60.3 kB 0 B
frontend/dist-report/posthog-app/src/index 61.1 kB 0 B
frontend/dist-report/posthog-app/src/layout/panel-layout/ai-first/tabs/NavTabChat 7.19 kB 0 B
frontend/dist-report/posthog-app/src/lib/components/Cards/TextCard/TextCardMarkdownEditor 11.3 kB 0 B
frontend/dist-report/posthog-app/src/lib/components/MonacoDiffEditor 471 B 0 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/LemonMarkdown/MermaidDiagram 2.29 kB 0 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown 876 B 0 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/Link/Link 359 B 0 B
frontend/dist-report/posthog-app/src/lib/monaco/CodeEditorInline 866 B 0 B
frontend/dist-report/posthog-app/src/lib/monaco/vimMode 211 kB 0 B
frontend/dist-report/posthog-app/src/lib/ui/Button/ButtonPrimitives 426 B 0 B
frontend/dist-report/posthog-app/src/queries/nodes/WebVitals/WebVitals 7.55 kB 0 B
frontend/dist-report/posthog-app/src/queries/nodes/WebVitals/WebVitalsPathBreakdown 4.12 kB 0 B
frontend/dist-report/posthog-app/src/queries/schema 852 kB 0 B
frontend/dist-report/posthog-app/src/scenes/activity/explore/EventsScene 3.32 kB 0 B
frontend/dist-report/posthog-app/src/scenes/activity/explore/SessionsScene 4.72 kB 0 B
frontend/dist-report/posthog-app/src/scenes/activity/live/LiveEventsTable 5.62 kB 0 B
frontend/dist-report/posthog-app/src/scenes/agentic/AgenticAuthorize 5.87 kB 0 B
frontend/dist-report/posthog-app/src/scenes/approvals/ApprovalDetail 16.6 kB 0 B
frontend/dist-report/posthog-app/src/scenes/approvals/changeRequestsLogic 918 B 0 B
frontend/dist-report/posthog-app/src/scenes/audit-logs/AdvancedActivityLogsScene 42.1 kB 0 B
frontend/dist-report/posthog-app/src/scenes/AuthenticatedShell 165 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/AccountConnected 3.36 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/AgenticAccountMismatch 2.77 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/CLIAuthorize 11.8 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/CLILive 4.4 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/credential-review/CredentialReview 3.98 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/EmailMFAVerify 3.4 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/InviteSignup 15.4 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/Login 10.2 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/Login2FA 5.11 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/passkeyLogic 858 B 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/PasswordReset 4.74 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/PasswordResetComplete 3.38 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/signup/SignupContainer 28.6 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/signup/verify-email/VerifyEmail 5.16 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/TwoFactorReset 4.41 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/VercelConnect 5.37 kB 0 B
frontend/dist-report/posthog-app/src/scenes/authentication/VercelLinkError 2.64 kB 0 B
frontend/dist-report/posthog-app/src/scenes/billing/AuthorizationStatus 1.1 kB 0 B
frontend/dist-report/posthog-app/src/scenes/billing/Billing 867 B 0 B
frontend/dist-report/posthog-app/src/scenes/billing/BillingSection 21.2 kB 0 B
frontend/dist-report/posthog-app/src/scenes/cohorts/Cohort 28.4 kB 0 B
frontend/dist-report/posthog-app/src/scenes/cohorts/CohortCalculationHistory 6.61 kB 0 B
frontend/dist-report/posthog-app/src/scenes/cohorts/Cohorts 9.81 kB 0 B
frontend/dist-report/posthog-app/src/scenes/coupons/Coupons 1.1 kB 0 B
frontend/dist-report/posthog-app/src/scenes/dashboard/Dashboard 1.68 kB 0 B
frontend/dist-report/posthog-app/src/scenes/dashboard/dashboards/Dashboards 19.9 kB 0 B
frontend/dist-report/posthog-app/src/scenes/dashboard/dashboards/templates/DashboardTemplateCopyScene 6.09 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-management/DataManagementScene 1.02 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-management/definition/DefinitionEdit 17.2 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-management/definition/DefinitionView 24.4 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-management/MaterializedColumns/MaterializedColumns 12 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-management/variables/SqlVariableEditScene 7.63 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-pipelines/batch-exports/BatchExportScene 61 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-pipelines/DataPipelinesNewScene 2.69 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-pipelines/DestinationsScene 3.06 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-pipelines/event-filtering/EventFilterScene 22.3 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-pipelines/legacy-plugins/LegacyPluginScene 21 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-pipelines/TransformationsScene 2.3 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-pipelines/WebScriptsScene 2.92 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-warehouse/DataWarehouseScene 1.75 kB 0 B
frontend/dist-report/posthog-app/src/scenes/data-warehouse/editor/EditorScene 1.52 kB 0 B
frontend/dist-report/posthog-app/src/scenes/debug/DebugScene 20.3 kB 0 B
frontend/dist-report/posthog-app/src/scenes/debug/hog/HogRepl 7.75 kB 0 B
frontend/dist-report/posthog-app/src/scenes/experiments/Experiment 207 kB 0 B
frontend/dist-report/posthog-app/src/scenes/experiments/Experiments 20.9 kB 0 B
frontend/dist-report/posthog-app/src/scenes/experiments/SharedMetrics/SharedMetric 6.45 kB 0 B
frontend/dist-report/posthog-app/src/scenes/experiments/SharedMetrics/SharedMetrics 923 B 0 B
frontend/dist-report/posthog-app/src/scenes/exports/ExportsScene 4.36 kB 0 B
frontend/dist-report/posthog-app/src/scenes/feature-flags/FeatureFlag 144 kB 0 B
frontend/dist-report/posthog-app/src/scenes/feature-flags/FeatureFlags 1.12 kB 0 B
frontend/dist-report/posthog-app/src/scenes/groups/Group 15.6 kB 0 B
frontend/dist-report/posthog-app/src/scenes/groups/Groups 4.29 kB 0 B
frontend/dist-report/posthog-app/src/scenes/groups/GroupsNew 7.73 kB 0 B
frontend/dist-report/posthog-app/src/scenes/health-alerts/HealthAlertsScene 4.17 kB 0 B
frontend/dist-report/posthog-app/src/scenes/health/categoryDetail/HealthCategoryDetailScene 7.64 kB 0 B
frontend/dist-report/posthog-app/src/scenes/health/HealthScene 12.8 kB 0 B
frontend/dist-report/posthog-app/src/scenes/health/pipelineStatus/PipelineStatusScene 11.5 kB 0 B
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapNewScene 5.41 kB 0 B
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapRecordingScene 4.31 kB 0 B
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapScene 6.94 kB 0 B
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmaps/HeatmapsScene 4.27 kB 0 B
frontend/dist-report/posthog-app/src/scenes/hog-functions/HogFunctionScene 59.6 kB 0 B
frontend/dist-report/posthog-app/src/scenes/inbox/InboxScene 63.3 kB 0 B
frontend/dist-report/posthog-app/src/scenes/insights/InsightQuickStart/InsightQuickStart 5.81 kB 0 B
frontend/dist-report/posthog-app/src/scenes/insights/InsightScene 34.8 kB 0 B
frontend/dist-report/posthog-app/src/scenes/insights/views/BoxPlot/BoxPlot 5.43 kB 0 B
frontend/dist-report/posthog-app/src/scenes/insights/views/CalendarHeatMap/CalendarHeatMap 4.87 kB 0 B
frontend/dist-report/posthog-app/src/scenes/insights/views/RegionMap/RegionMap 29.8 kB 0 B
frontend/dist-report/posthog-app/src/scenes/insights/views/WorldMap/WorldMap 5.16 kB 0 B
frontend/dist-report/posthog-app/src/scenes/instance/AsyncMigrations/AsyncMigrations 13.5 kB 0 B
frontend/dist-report/posthog-app/src/scenes/instance/DeadLetterQueue/DeadLetterQueue 5.77 kB 0 B
frontend/dist-report/posthog-app/src/scenes/instance/QueryPerformance/QueryPerformance 9 kB 0 B
frontend/dist-report/posthog-app/src/scenes/instance/SystemStatus/SystemStatus 17.4 kB 0 B
frontend/dist-report/posthog-app/src/scenes/IntegrationsRedirect/IntegrationsRedirect 1.11 kB 0 B
frontend/dist-report/posthog-app/src/scenes/marketing-analytics/MarketingAnalyticsScene 42.1 kB 0 B
frontend/dist-report/posthog-app/src/scenes/max/Max 1.06 kB 0 B
frontend/dist-report/posthog-app/src/scenes/models/ModelsScene 19.1 kB 0 B
frontend/dist-report/posthog-app/src/scenes/models/NodeDetailScene 17.1 kB 0 B
frontend/dist-report/posthog-app/src/scenes/moveToPostHogCloud/MoveToPostHogCloud 4.84 kB 0 B
frontend/dist-report/posthog-app/src/scenes/new-tab/NewTabScene 1.85 kB 0 B
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookCanvasScene 3.92 kB 0 B
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookPanel/NotebookPanel 5.98 kB 0 B
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookScene 9.29 kB 0 B
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebooksScene 7.98 kB 0 B
frontend/dist-report/posthog-app/src/scenes/oauth/OAuthAuthorize 1.01 kB 0 B
frontend/dist-report/posthog-app/src/scenes/onboarding/coupon/OnboardingCouponRedemption 1.58 kB 0 B
frontend/dist-report/posthog-app/src/scenes/onboarding/Onboarding 792 kB 0 B
frontend/dist-report/posthog-app/src/scenes/onboarding/sdks/SdkDoctorScene 10.2 kB 0 B
frontend/dist-report/posthog-app/src/scenes/organization/ConfirmOrganization/ConfirmOrganization 4.91 kB 0 B
frontend/dist-report/posthog-app/src/scenes/organization/Create/Create 1.03 kB 0 B
frontend/dist-report/posthog-app/src/scenes/organization/Deactivated 1.51 kB 0 B
frontend/dist-report/posthog-app/src/scenes/organization/PendingDeletion 2.48 kB 0 B
frontend/dist-report/posthog-app/src/scenes/persons/PersonScene 20.1 kB 0 B
frontend/dist-report/posthog-app/src/scenes/persons/PersonsScene 6.12 kB 0 B
frontend/dist-report/posthog-app/src/scenes/PreflightCheck/PreflightCheck 5.95 kB 0 B
frontend/dist-report/posthog-app/src/scenes/product-tours/ProductTour 275 kB 0 B
frontend/dist-report/posthog-app/src/scenes/product-tours/ProductTours 5.06 kB 0 B
frontend/dist-report/posthog-app/src/scenes/project-homepage/ProjectHomepage 19.1 kB 0 B
frontend/dist-report/posthog-app/src/scenes/project/Create/Create 1.21 kB 0 B
frontend/dist-report/posthog-app/src/scenes/resource-transfer/ResourceTransfer 9.56 kB 0 B
frontend/dist-report/posthog-app/src/scenes/saved-insights/SavedInsights 1.04 kB 0 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/detail/SessionRecordingDetail 2.14 kB 0 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/file-playback/SessionRecordingFilePlaybackScene 4.85 kB 0 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/kiosk/SessionRecordingsKiosk 10.3 kB 0 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/player/snapshot-processing/DecompressionWorkerManager 329 B 0 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/playlist/SessionRecordingsPlaylistScene 5.49 kB 0 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/SessionRecordings 1.15 kB 0 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/settings/SessionRecordingsSettingsScene 2.35 kB 0 B
frontend/dist-report/posthog-app/src/scenes/sessions/SessionProfileScene 15.6 kB 0 B
frontend/dist-report/posthog-app/src/scenes/settings/SettingsScene 3.94 kB 0 B
frontend/dist-report/posthog-app/src/scenes/sites/Site 1.57 kB 0 B
frontend/dist-report/posthog-app/src/scenes/startups/StartupProgram 21.6 kB 0 B
frontend/dist-report/posthog-app/src/scenes/StripeConfirmInstall/StripeConfirmInstall 3.92 kB 0 B
frontend/dist-report/posthog-app/src/scenes/subscriptions/SubscriptionScene 14.4 kB 0 B
frontend/dist-report/posthog-app/src/scenes/subscriptions/SubscriptionsScene 5.23 kB 0 B
frontend/dist-report/posthog-app/src/scenes/surveys/forms/SurveyFormBuilder 1.93 kB 0 B
frontend/dist-report/posthog-app/src/scenes/surveys/Survey 1.39 kB 0 B
frontend/dist-report/posthog-app/src/scenes/surveys/Surveys 26.8 kB 0 B
frontend/dist-report/posthog-app/src/scenes/surveys/wizard/SurveyWizard 72.8 kB 0 B
frontend/dist-report/posthog-app/src/scenes/themes/CustomCssScene 3.94 kB 0 B
frontend/dist-report/posthog-app/src/scenes/toolbar-launch/ToolbarLaunch 2.85 kB 0 B
frontend/dist-report/posthog-app/src/scenes/Unsubscribe/Unsubscribe 2.04 kB 0 B
frontend/dist-report/posthog-app/src/scenes/web-analytics/SessionAttributionExplorer/SessionAttributionExplorerScene 7.01 kB 0 B
frontend/dist-report/posthog-app/src/scenes/web-analytics/WebAnalyticsScene 13.3 kB 0 B
frontend/dist-report/posthog-app/src/scenes/wizard/Wizard 4.83 kB 0 B
frontend/dist-report/posthog-app/src/sharedChunkAnchors 1.19 kB 0 B
frontend/dist-report/toolbar/src/toolbar/toolbar 15.7 MB 0 B

compressed-size-action

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx:195-200
`legendItemsFromSeries(series, theme)` is called inline in the render, creating a new array reference on every render even when `showLegend` is `false`. Both `series` (already `useMemo`'d) and `theme` (`useMemo(() => buildTheme(), [])`) are stable references, so the work is avoidable — and the resulting array is discarded immediately when `ChartLegend` short-circuits on `show=false`.

```suggestion
        <ChartLegend
            show={!!showLegend}
            items={useMemo(() => legendItemsFromSeries(series, theme), [series, theme])}
            position="top"
            legendDataAttr="trend-lifecycle-legend"
        >
```

Reviews (1): Last reviewed commit: "chore(hog-charts): address ChartLegend r..." | Re-trigger Greptile

Comment on lines 195 to 200
<ChartLegend
show={!!showLegend}
items={legendItemsFromSeries(series, theme)}
position="top"
legendDataAttr="trend-lifecycle-legend"
>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 legendItemsFromSeries(series, theme) is called inline in the render, creating a new array reference on every render even when showLegend is false. Both series (already useMemo'd) and theme (useMemo(() => buildTheme(), [])) are stable references, so the work is avoidable — and the resulting array is discarded immediately when ChartLegend short-circuits on show=false.

Suggested change
<ChartLegend
show={!!showLegend}
items={legendItemsFromSeries(series, theme)}
position="top"
legendDataAttr="trend-lifecycle-legend"
>
<ChartLegend
show={!!showLegend}
items={useMemo(() => legendItemsFromSeries(series, theme), [series, theme])}
position="top"
legendDataAttr="trend-lifecycle-legend"
>
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx
Line: 195-200

Comment:
`legendItemsFromSeries(series, theme)` is called inline in the render, creating a new array reference on every render even when `showLegend` is `false`. Both `series` (already `useMemo`'d) and `theme` (`useMemo(() => buildTheme(), [])`) are stable references, so the work is avoidable — and the resulting array is discarded immediately when `ChartLegend` short-circuits on `show=false`.

```suggestion
        <ChartLegend
            show={!!showLegend}
            items={useMemo(() => legendItemsFromSeries(series, theme), [series, theme])}
            position="top"
            legendDataAttr="trend-lifecycle-legend"
        >
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c52e050 — memoized as a legendItems variable so the dependency closure is explicit and the JSX stays tidy.

Copy link
Copy Markdown
Contributor Author

@sampennington sampennington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated review

Verdict: Ship it

One performance nit worth picking up pre-merge — legendItemsFromSeries(series, theme) is called inline on every render in TrendsLifecycleChart.tsx:197 (flagged by code-reviewer, react, hog-charts, and efficiency). A one-line useMemo keeps the items reference stable. Everything else is fast-follow.

Non-anchored findings

  • Story coverage Add an UnstackedWithLegend story so the layout fix (self-stretch + nested flex flex-col) is locked in across both stacked and unstacked variants. [code-reviewer + hog-charts]
  • Test hardening Consider asserting the legend swatch order matches the rendered series order (New, Returning, Resurrecting, Dormant) — the lifecycle transform sorts by status and a regression would silently desync legend from bars. [hog-charts + code-reviewer]

Reviewers: code-reviewer, react, hog-charts, personal, reuse, quality, efficiency. Inline comments above are tagged with the reviewer that raised them and the level of concern.

onError={handleChartError}
<ChartLegend
show={!!showLegend}
items={legendItemsFromSeries(series, theme)}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [code-reviewer+react+hog-charts+efficiency] · Performance

legendItemsFromSeries(series, theme) runs inline on every render and returns a fresh LegendItem[], so <Legend> reconciles even when nothing changed. series (line 74) and theme (line 47) are already memoized, so the fix is one line — extract above the JSX:

const legendItems = useMemo(() => legendItemsFromSeries(series, theme), [series, theme])

Cheap at 4 series but the pattern reads as "forgot the useMemo" — worth fixing pre-merge so it doesn't get cargo-culted by the next adapter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c52e050.

dataAttr="trend-lifecycle-graph"
onError={handleChartError}
<ChartLegend
show={!!showLegend}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [quality] · Nit

!!showLegend works (selector is boolean | null | undefined) but showLegend ?? false reads more directly for a nullable boolean. Either is fine — flagging for consistency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — !! and ?? false both correctly coerce boolean | null | undefined to boolean. The legacy lifecycle adapter also uses !!showLegend (ActionsLineGraph.tsx:74), and !! is the more common idiom in this codebase for nullable-bool gating. Keeping for consistency.

legendDataAttr,
children,
}: ChartLegendProps): React.ReactElement {
if (!show || items.length === 0) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [quality] · Nit

if (!show || items.length === 0) conflates two distinct cases (consumer opted out vs. nothing to show). Either split into two early returns, or name it:

const hasLegend = show && items.length > 0
if (!hasLegend) {
    return <>{children}</>
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — the early return reads as "there's nothing to render in legend form", which is one concept with two sources. Naming it hasLegend adds a line without making the intent clearer. Legend itself does the same items.length === 0 → null check internally; this wrapper just hoists it so we don't render the layout wrapper either. Keeping.

if (!show || items.length === 0) {
return <>{children}</>
}
const orientation = position === 'left' || position === 'right' ? 'vertical' : 'horizontal'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [quality] · Nit

position === 'left' || position === 'right' ? 'vertical' : 'horizontal' duplicates the isRow predicate already inside ChartLegendLayout. Tiny — extract a positionToOrientation(position) helper if it spreads to a third consumer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — one duplication isn't enough to justify a helper, and ChartLegendLayout.isRow is a local const not exported. Will extract when a third consumer needs it.

}
const orientation = position === 'left' || position === 'right' ? 'vertical' : 'horizontal'
// Bakes `flex-1 min-h-0` so consumers in a flex-col parent don't have to remember it.
const wrapperClassName = `flex-1 min-h-0 ${className ?? ''}`.trim()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [reuse+quality] · Suggestion

`flex-1 min-h-0 ${className ?? ''}`.trim() reinvents cn(). The repo already has cn in frontend/src/lib/utils/css-classes.ts (clsx + tailwind-merge) which handles the ?? '' and (more importantly) merges conflicting tailwind utilities if a future consumer passes flex-none:

const wrapperClassName = cn('flex-1 min-h-0', className)

Sibling files (ChartLegendLayout.tsx, Legend.tsx) use the same raw-template pattern — so this is a pre-existing house style inside lib/hog-charts/, not just a new sin. If the dir deliberately avoids cn, ignore this; if not, adopting it here is a good entry point.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't fix — lib/hog-charts/ is a self-contained pure zone (no imports from lib/utils, scenes/, kea, or PostHog-specific code) so the library stays portable and easy to extract. Sibling files (ChartLegendLayout.tsx, Legend.tsx) use the same raw template-literal pattern deliberately. Adopting cn here would be the first crack in that wall. If we want cn-style merging inside hog-charts, the right move is to inline a small clsx equivalent in the lib's utils/, not import from lib/utils.

hiddenKeys?: string[]
className?: string
/** data-attr on the inner `<Legend>`. The outer layout wrapper has no data-attr. */
legendDataAttr?: string
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [hog-charts+quality] · Suggestion

legendDataAttr lands on the inner <Legend>, but ChartLegendLayout.dataAttr lands on the outer wrapper — so this component has no way to tag the outer block. Symmetry would help: forward an optional dataAttr (or wrapperDataAttr) to ChartLegendLayout too, so consumers can anchor on either layer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferring — no consumer needs the outer-wrapper anchor today, and adding both legendDataAttr and wrapperDataAttr makes the API surface lumpy. Will add when a real test/inspection case shows up.

<div data-attr="chart">C</div>
</ChartLegend>
)
// No wrapper div — chart is the only top-level child.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [personal] · Nit

// No wrapper div — chart is the only top-level child. narrates the next assertion (expect(container.children).toHaveLength(1)). Drop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c52e050.

expect(container.textContent).toContain('B')
expect(container.querySelector('[data-attr="chart"]')).not.toBeNull()
expect(container.querySelector('[data-attr="my-legend"]')).not.toBeNull()
// Outer wrapper carries the height-fill class so the chart inherits parent height.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [personal] · Nit

// Outer wrapper carries the height-fill class so the chart inherits parent height. restates what the toContain('flex-1') / toContain('min-h-0') assertions already check. Drop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c52e050.


await screen.findByTestId('trend-lifecycle-graph')
const legend = await screen.findByTestId('trend-lifecycle-legend')
// Lifecycle status names appear capitalized in the legend.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [personal+code-reviewer] · Nit

Comment narrates the next four toMatch calls. Drop the comment, and consider folding the four assertions into a single it.each(['New', 'Returning', 'Resurrecting', 'Dormant'])(...) per repo's parameterized-test convention — would also give individual failures on regression.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c52e050 — went further than parameterizing. Replaced the four presence assertions with a single expect(labels).toEqual(['Dormant', 'Returning', 'Resurrecting', 'New']) so the test now also locks in the legend ↔ rendered-series order (which the hog-charts reviewer also wanted).

@sampennington sampennington added the stamphog Request AI review from stamphog label May 28, 2026
github-actions[bot]
github-actions Bot previously approved these changes May 28, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purely additive frontend UI change that wires an existing showLegend filter flag to a new ChartLegend wrapper component. No backend, data model, API, or security impact. All review comments are either marked addressed or are author won't-fix calls with reasonable justifications.

@posthog
Copy link
Copy Markdown
Contributor

posthog Bot commented May 28, 2026

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

@github-actions github-actions Bot dismissed their stale review May 28, 2026 16:37

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

github-actions[bot]
github-actions Bot previously approved these changes May 28, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure frontend feature addition wiring an existing filter flag to a new well-tested wrapper component. No backend, API, data model, or security impact. All review comments were addressed or intentionally won't-fixed with clear rationale. The ChartLegendLayout export replacement has no external consumers.

@github-actions github-actions Bot dismissed their stale review May 28, 2026 19:39

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

github-actions[bot]
github-actions Bot previously approved these changes May 28, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure frontend feature wiring an existing filter flag to a new well-tested ChartLegend wrapper component. The ChartLegendLayoutChartLegend public export swap has no external consumers. All review comments are resolved or have clear won't-fix rationale.

sampennington and others added 6 commits June 1, 2026 09:43
Wires the hog-charts Legend into TrendsLifecycleChart so toggling "Show
legend" in the editor renders status swatches (New / Returning /
Resurrecting / Dormant) above the chart, matching the legacy Chart.js
behaviour.

Also fixes ChartLegendLayout so the chart slot fills both axes inside the
flex wrapper — it's now a flex container itself (so a nested chart's
`flex: 1` resolves) and uses `self-stretch` so the chart fills the cross
axis regardless of the `align` prop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wraps ChartLegendLayout + Legend into a single component that takes
`show` and `items` props, hiding the layout/orientation plumbing from
adapters. When `show=false` or `items` is empty it returns children
unwrapped, so toggling the legend off doesn't introduce an extra flex
container. Bakes the parent-fill classes (`flex-1 min-h-0`) into the
wrapper so adapters in a flex-col parent don't need to remember them.

Refactors TrendsLifecycleChart to use ChartLegend — drops the manual
`if (!showLegend) return chart` branch and the intermediate `chart`
variable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Rename ChartLegend.dataAttr → legendDataAttr — the prop lands on the
  inner <Legend>, not the wrapper, so the old name was a footgun for the
  next consumer who'd expect it to mirror ChartLegendLayout.dataAttr.
- Trim multi-line comments to single lines per repo style.
- Strengthen the "renders children unwrapped" tests to assert no stray
  wrapper div sneaks in (container.children.length === 1).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Memoize legendItemsFromSeries in TrendsLifecycleChart so the items
  reference stays stable across renders (flagged by Greptile and 4 of
  the /r reviewers).
- Strengthen the legend-present test into an order assertion so the
  legend stays in sync with the rendered series sort
  (dormant → returning → resurrecting → new).
- Add UnstackedWithLegend story so the layout fix is locked in across
  both stacked and unstacked variants.
- Drop three narrative comments that just restated the next line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drops the index.ts export of ChartLegendLayout — ChartLegend is now the
only public way to add a legend to a chart. The Layout* stories in
Legend.stories.tsx switched to ChartLegend too; the old ChartWithLegend
helper used ChartLegendLayout directly and skipped the `flex-1 min-h-0`
baking, so its chart slot collapsed when position=left/right.

ChartLegendLayout.tsx and its test stay in place — they're still used
internally by ChartLegend.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
15 updated
Run: 37a7600a-688c-4820-80bb-ff1e2028176c

Co-authored-by: sampennington <56024559+sampennington@users.noreply.github.com>
@sampennington sampennington force-pushed the sam/lifecycle-chart-legend branch from 62744dc to de46cdf Compare June 1, 2026 08:47
@github-actions github-actions Bot dismissed their stale review June 1, 2026 08:48

New commits pushed (delta classified non_linear_history) — stamphog approval dismissed; re-review running automatically.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure frontend UI addition — no backend, data model, API, or security impact. The ChartLegendLayout public export replacement has no external consumers, legendItems is properly memoized, and the new component is well-tested. All review comments are resolved or have clear won't-fix rationale, and the PR has a human approval.

@sampennington sampennington enabled auto-merge (squash) June 1, 2026 09:01
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

🎭 Playwright report · View test results →

⚠️ 2 flaky tests:

  • Add a new person property (chromium)
  • Save an insight, make changes, discard them, and save a copy (chromium)

These issues are not necessarily caused by your changes.
Annoyed by this comment? Help fix flakies and failures and it'll disappear!

@sampennington sampennington merged commit 8d769c8 into master Jun 1, 2026
164 checks passed
@sampennington sampennington deleted the sam/lifecycle-chart-legend branch June 1, 2026 09:09
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented Jun 1, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-06-01 09:44 UTC Run
prod-us ✅ Deployed 2026-06-01 09:56 UTC Run
prod-eu ✅ Deployed 2026-06-01 09:57 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI review from stamphog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants