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.

chore(insights): move retention bar/line charts into product_analytics (#59781)

Sam Penningtonc7e716fae7ab
diff --git a/frontend/src/scenes/retention/RetentionGraph.tsx b/frontend/src/scenes/retention/RetentionGraph.tsx
index f73beab71a5a..bb2ec33f861d 100644
--- a/frontend/src/scenes/retention/RetentionGraph.tsx
+++ b/frontend/src/scenes/retention/RetentionGraph.tsx
@@ -8,12 +8,13 @@ import { insightLogic } from 'scenes/insights/insightLogic'
import { TrendsFilter } from '~/queries/schema/schema-general'
import { ChartDisplayType, GraphDataset, GraphType } from '~/types'
+import { RetentionBarChart } from 'products/product_analytics/frontend/insights/retention/RetentionBarChart/RetentionBarChart'
+import { RetentionLineChart } from 'products/product_analytics/frontend/insights/retention/RetentionLineChart/RetentionLineChart'
+
import { InsightEmptyState } from '../insights/EmptyStates'
import { LineGraph } from '../insights/views/LineGraph/LineGraph'
import { retentionGraphLogic } from './retentionGraphLogic'
import { retentionModalLogic } from './retentionModalLogic'
-import { RetentionBarChart } from './viz/retention-bar-chart/RetentionBarChart'
-import { RetentionLineChart } from './viz/retention-line-chart/RetentionLineChart'
interface RetentionGraphProps {
inSharedMode?: boolean
diff --git a/frontend/src/scenes/retention/viz/retention-bar-chart/RetentionBarChart.tsx b/products/product_analytics/frontend/insights/retention/RetentionBarChart/RetentionBarChart.tsx
similarity index 97%
rename from frontend/src/scenes/retention/viz/retention-bar-chart/RetentionBarChart.tsx
rename to products/product_analytics/frontend/insights/retention/RetentionBarChart/RetentionBarChart.tsx
index 74b66331dea1..5529e258d62a 100644
--- a/frontend/src/scenes/retention/viz/retention-bar-chart/RetentionBarChart.tsx
+++ b/products/product_analytics/frontend/insights/retention/RetentionBarChart/RetentionBarChart.tsx
@@ -7,14 +7,14 @@ import { TimeSeriesBarChart } from 'lib/hog-charts'
import type { PointClickData, TooltipConfig, TooltipContext } from 'lib/hog-charts'
import { insightLogic } from 'scenes/insights/insightLogic'
import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
+import { retentionGraphLogic } from 'scenes/retention/retentionGraphLogic'
+import { retentionModalLogic } from 'scenes/retention/retentionModalLogic'
import { themeLogic } from '~/layout/navigation-3000/themeLogic'
import { groupsModel } from '~/models/groupsModel'
import type { GoalLine } from '~/queries/schema/schema-general'
import type { GroupTypeIndex, LabelGroupType } from '~/types'
-import { retentionGraphLogic } from '../../retentionGraphLogic'
-import { retentionModalLogic } from '../../retentionModalLogic'
import {
buildRetentionBarChartConfig,
buildRetentionSeries,
diff --git a/frontend/src/scenes/retention/viz/retention-line-chart/RetentionLineChart.tsx b/products/product_analytics/frontend/insights/retention/RetentionLineChart/RetentionLineChart.tsx
similarity index 97%
rename from frontend/src/scenes/retention/viz/retention-line-chart/RetentionLineChart.tsx
rename to products/product_analytics/frontend/insights/retention/RetentionLineChart/RetentionLineChart.tsx
index c12fd036b8e2..7f2ac9ad189d 100644
--- a/frontend/src/scenes/retention/viz/retention-line-chart/RetentionLineChart.tsx
+++ b/products/product_analytics/frontend/insights/retention/RetentionLineChart/RetentionLineChart.tsx
@@ -7,14 +7,14 @@ import { TimeSeriesLineChart } from 'lib/hog-charts'
import type { PointClickData, TooltipConfig, TooltipContext } from 'lib/hog-charts'
import { insightLogic } from 'scenes/insights/insightLogic'
import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
+import { retentionGraphLogic } from 'scenes/retention/retentionGraphLogic'
+import { retentionModalLogic } from 'scenes/retention/retentionModalLogic'
import { themeLogic } from '~/layout/navigation-3000/themeLogic'
import { groupsModel } from '~/models/groupsModel'
import type { GoalLine } from '~/queries/schema/schema-general'
import type { GroupTypeIndex, LabelGroupType } from '~/types'
-import { retentionGraphLogic } from '../../retentionGraphLogic'
-import { retentionModalLogic } from '../../retentionModalLogic'
import {
buildRetentionLineChartConfig,
buildRetentionSeries,
diff --git a/frontend/src/scenes/retention/viz/shared/RetentionTooltip.tsx b/products/product_analytics/frontend/insights/retention/shared/RetentionTooltip.tsx
similarity index 100%
rename from frontend/src/scenes/retention/viz/shared/RetentionTooltip.tsx
rename to products/product_analytics/frontend/insights/retention/shared/RetentionTooltip.tsx
diff --git a/frontend/src/scenes/retention/viz/shared/retentionChartTransforms.test.ts b/products/product_analytics/frontend/insights/retention/shared/retentionChartTransforms.test.ts
similarity index 100%
rename from frontend/src/scenes/retention/viz/shared/retentionChartTransforms.test.ts
rename to products/product_analytics/frontend/insights/retention/shared/retentionChartTransforms.test.ts
diff --git a/frontend/src/scenes/retention/viz/shared/retentionChartTransforms.ts b/products/product_analytics/frontend/insights/retention/shared/retentionChartTransforms.ts
similarity index 98%
rename from frontend/src/scenes/retention/viz/shared/retentionChartTransforms.ts
rename to products/product_analytics/frontend/insights/retention/shared/retentionChartTransforms.ts
index ee7c5e393d08..25382a6648dd 100644
--- a/frontend/src/scenes/retention/viz/shared/retentionChartTransforms.ts
+++ b/products/product_analytics/frontend/insights/retention/shared/retentionChartTransforms.ts
@@ -6,13 +6,12 @@ import type {
TooltipConfig,
TrendLineConfig,
} from 'lib/hog-charts'
+import type { RetentionTrendPayload } from 'scenes/retention/types'
import type { GoalLine as SchemaGoalLine } from '~/queries/schema/schema-general'
import { schemaGoalLinesToConfigs } from 'products/product_analytics/frontend/insights/trends/shared/goalLinesAdapter'
-import type { RetentionTrendPayload } from '../../types'
-
// `retentionGraphLogic.trendSeries` spreads `cohortRetention` onto each entry, so the
// runtime shape includes a cohort `label` field that the declared type doesn't list.
export type RetentionTrendSeriesEntry = RetentionTrendPayload & { label?: string }