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.

fix(insights): drop the drill-down explanation from formula trend tooltips (#78530)

Sam Penningtone729b48ec4bf
diff --git a/products/product_analytics/frontend/insights/shared/InsightSeriesTooltip.tsx b/products/product_analytics/frontend/insights/shared/InsightSeriesTooltip.tsx
index b34ebf8eedc8..7a104a13db79 100644
--- a/products/product_analytics/frontend/insights/shared/InsightSeriesTooltip.tsx
+++ b/products/product_analytics/frontend/insights/shared/InsightSeriesTooltip.tsx
@@ -57,7 +57,7 @@ export interface InsightSeriesTooltipProps<Meta extends InsightSeriesMetaBase> {
sortedByValue?: boolean
/** Hide rows whose value is exactly 0 (e.g. absent lifecycle statuses). */
hideZeroRows?: boolean
- /** Override the default "click to view X" footer — e.g. to explain why drill-down is unavailable. */
+ /** Override the default "click to view X" footer, for charts whose click goes somewhere other than persons. */
footerOverride?: React.ReactNode
}
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 57da4ede1b26..9e39a02601ec 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
@@ -658,12 +658,12 @@ describe('TrendsLineChart', () => {
},
})
- it('explains why drill-down is unavailable instead of opening the persons modal', async () => {
+ it('offers no click affordance and does not open the persons modal', async () => {
renderInsight({ query: multiSeriesFormulaQuery })
await chart.hoverTooltip(2)
- expect(chart.getTooltip()?.textContent).toContain("Drill-down isn't available for formula insights")
+ expect(chart.getTooltip()?.textContent).not.toContain('Click to view')
await chart.clickTooltipRow('Pageview')
expect(personsModal.get()).not.toBeInTheDocument()
})
@@ -677,9 +677,7 @@ describe('TrendsLineChart', () => {
})
await chart.hoverTooltip(2)
- expect(chart.getTooltip()?.textContent).toContain(
- "Drill-down isn't available for formula insights. Click to view the insight."
- )
+ expect(chart.getTooltip()?.textContent).toContain('Click to view the insight')
await chart.clickTooltipRow('Pageview')
diff --git a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
index c16e53f81c52..e56c46c75555 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
@@ -137,8 +137,7 @@ export function TrendsLineChart({
const canHandleClick = !!context?.onDataPointClick || !!hasPersonsModal
// The persons modal is intentionally unavailable for multi-series formulas (there's no
- // single series of actors behind a computed ratio), so surface that instead of leaving
- // the chart looking interactive with no explanation. On dashboard/card tiles a click
+ // single series of actors behind a computed ratio). On dashboard/card tiles a click
// instead opens the underlying insight, since there's nowhere else for the click to go.
const isFormulaDrillDownDisabled = !canHandleClick && isMultiSeriesFormula(formula)
const canNavigateToInsight = embedded && !inSharedMode && isFormulaDrillDownDisabled && !!insight.short_id
@@ -151,11 +150,8 @@ export function TrendsLineChart({
router.actions.push(urls.insightView(insight.short_id, insightProps.dashboardId))
}, [insight.short_id, insightProps.dashboardId])
- const noDrillDownFooter = isFormulaDrillDownDisabled
- ? canNavigateToInsight
- ? "Drill-down isn't available for formula insights. Click to view the insight."
- : "Drill-down isn't available for formula insights"
- : undefined
+ // The default footer offers persons, which isn't where this click goes.
+ const viewInsightFooter = canNavigateToInsight ? 'Click to view the insight' : undefined
const clickDeps = useMemo(
() => ({
@@ -220,7 +216,7 @@ export function TrendsLineChart({
groupTypeLabel: resolvedGroupTypeLabel,
formatCompareLabel: context?.formatCompareLabel,
onRowClick,
- footerOverride: noDrillDownFooter,
+ footerOverride: viewInsightFooter,
}
return <InsightSeriesTooltip {...tooltipProps} />
},
@@ -239,7 +235,7 @@ export function TrendsLineChart({
canHandlePointInteraction,
canHandleClick,
navigateToInsight,
- noDrillDownFooter,
+ viewInsightFooter,
clickDeps,
]
)