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): unify hog charts feature flags by insight type (#59782)

Sam Pennington0e21a61999be
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index d68cd973f924..6da725a77441 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -416,11 +416,9 @@ export const FEATURE_FLAGS = {
PRODUCT_ANALYTICS_DASHBOARD_COLORS: 'dashboard-colors', // owner: @thmsobrmlr #team-product-analytics
PRODUCT_ANALYTICS_DASHBOARD_MODAL_SMART_DEFAULTS: 'product-analytics-dashboard-modal-smart-defaults', // owner: @sam #team-product-analytics
PRODUCT_ANALYTICS_HIDE_WEEKENDS: 'product-analytics-hide-weekends', // owner: @kliment-slice #team-irl-events
- PRODUCT_ANALYTICS_HOG_CHARTS: 'product-analytics-hog-charts', // owner: @sampennington #team-product-analytics
- PRODUCT_ANALYTICS_HOG_CHARTS_BAR: 'product-analytics-hog-charts-bar', // owner: @sampennington #team-product-analytics
+ PRODUCT_ANALYTICS_HOG_CHARTS_TRENDS: 'product-analytics-hog-charts-trends', // owner: @sampennington #team-product-analytics
PRODUCT_ANALYTICS_HOG_CHARTS_FUNNEL: 'product-analytics-hog-charts-funnel', // owner: @sampennington #team-product-analytics
- PRODUCT_ANALYTICS_HOG_CHARTS_RETENTION_BAR: 'product-analytics-hog-charts-retention-bar', // owner: @sampennington #team-product-analytics
- PRODUCT_ANALYTICS_HOG_CHARTS_RETENTION_LINE: 'product-analytics-hog-charts-retention-line', // owner: @sampennington #team-product-analytics
+ PRODUCT_ANALYTICS_HOG_CHARTS_RETENTION: 'product-analytics-hog-charts-retention', // owner: @sampennington #team-product-analytics
PRODUCT_ANALYTICS_INSIGHT_HORIZONTAL_CONTROLS: 'insight-horizontal-controls', // owner: #team-product-analytics
PRODUCT_ANALYTICS_PATHS_V2: 'paths-v2', // owner: @thmsobrmlr #team-product-analytics
PRODUCT_ANALYTICS_RETENTION_AGGREGATION: 'retention-aggregation', // owner: @anirudhpillai #team-product-analytics
diff --git a/frontend/src/scenes/insights/Retention.stories.tsx b/frontend/src/scenes/insights/Retention.stories.tsx
index 527758cb5e3c..fa0189ee2a71 100644
--- a/frontend/src/scenes/insights/Retention.stories.tsx
+++ b/frontend/src/scenes/insights/Retention.stories.tsx
@@ -106,7 +106,7 @@ const retentionBarInsight: QueryBasedInsightModel = {
export const RetentionBar: Story = createInsightStory(retentionBarInsight)
RetentionBar.parameters = {
- featureFlags: [FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_RETENTION_BAR],
+ featureFlags: [FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_RETENTION],
testOptions: { waitForSelector: '[data-attr=trend-line-graph] > canvas' },
}
diff --git a/frontend/src/scenes/retention/RetentionGraph.tsx b/frontend/src/scenes/retention/RetentionGraph.tsx
index bb2ec33f861d..a4ad80fec042 100644
--- a/frontend/src/scenes/retention/RetentionGraph.tsx
+++ b/frontend/src/scenes/retention/RetentionGraph.tsx
@@ -50,10 +50,10 @@ export function RetentionGraph({ inSharedMode = false }: RetentionGraphProps): J
const isPercentage = !retentionFilter?.aggregationType || retentionFilter.aggregationType === 'count'
const isBarDisplay = retentionFilter?.display === ChartDisplayType.ActionsBar
- if (isBarDisplay && featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_RETENTION_BAR]) {
- return <RetentionBarChart inSharedMode={inSharedMode} />
- }
- if (!isBarDisplay && featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_RETENTION_LINE]) {
+ if (featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_RETENTION]) {
+ if (isBarDisplay) {
+ return <RetentionBarChart inSharedMode={inSharedMode} />
+ }
return <RetentionLineChart inSharedMode={inSharedMode} />
}
diff --git a/frontend/src/scenes/trends/Trends.tsx b/frontend/src/scenes/trends/Trends.tsx
index 135eac8a837e..c85b394e94a4 100644
--- a/frontend/src/scenes/trends/Trends.tsx
+++ b/frontend/src/scenes/trends/Trends.tsx
@@ -59,8 +59,8 @@ export function TrendInsight({ view, context, embedded, inSharedMode, editMode }
inSharedMode,
}
- const showHogChartsBar =
- featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_BAR] && !isLifecycle && !isStickiness
+ const hogChartsTrendsEnabled =
+ featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_TRENDS] && !isLifecycle && !isStickiness
const renderViz = (): JSX.Element | undefined => {
if (
@@ -69,13 +69,13 @@ export function TrendInsight({ view, context, embedded, inSharedMode, editMode }
display === ChartDisplayType.ActionsLineGraphCumulative ||
display === ChartDisplayType.ActionsAreaGraph
) {
- if (featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS] && !isLifecycle && !isStickiness) {
+ if (hogChartsTrendsEnabled) {
return <TrendsLineChart context={context} inSharedMode={inSharedMode} />
}
return <ActionsLineGraph {...commonProps} />
}
if (display === ChartDisplayType.ActionsBar || display === ChartDisplayType.ActionsUnstackedBar) {
- if (showHogChartsBar) {
+ if (hogChartsTrendsEnabled) {
return <TrendsBarChart context={context} inSharedMode={inSharedMode} />
}
return <ActionsLineGraph {...commonProps} />
@@ -98,7 +98,7 @@ export function TrendInsight({ view, context, embedded, inSharedMode, editMode }
return <ActionsPie {...commonProps} />
}
if (display === ChartDisplayType.ActionsBarValue) {
- if (showHogChartsBar) {
+ if (hogChartsTrendsEnabled) {
return <TrendsBarChart context={context} inSharedMode={inSharedMode} />
}
return <ActionsHorizontalBar {...commonProps} />
diff --git a/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.test.tsx b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.test.tsx
index f0e464c04c47..4c9bfc188836 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.test.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.test.tsx
@@ -25,7 +25,7 @@ afterEach(() => {
cleanup()
})
-const HOG_CHARTS_FLAG = { [FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_BAR]: true }
+const HOG_CHARTS_FLAG = { [FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_TRENDS]: true }
const trendsBar = (extra?: Parameters<typeof buildTrendsQuery>[0]): ReturnType<typeof buildTrendsQuery> =>
buildTrendsQuery({ trendsFilter: { display: ChartDisplayType.ActionsBar }, ...extra })
diff --git a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
index d9ca9055f218..04a6178cd325 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
@@ -33,7 +33,7 @@ afterEach(() => {
cleanup()
})
-const HOG_CHARTS_FLAG = { [FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS]: true }
+const HOG_CHARTS_FLAG = { [FEATURE_FLAGS.PRODUCT_ANALYTICS_HOG_CHARTS_TRENDS]: true }
describe('TrendsLineChart', () => {
describe('tooltips', () => {