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): remove insights-tooltips flag and legacy tooltips (#70729)

Sam Penningtonbb4326a32a85
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index f279e4d22361..c558885d89ba 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -500,18 +500,6 @@ snapshots:
hash: v1.k794b7964.acbbd66bb3841f17a58d897e19c4b073fcbbf0452e959355276b012c7cd6b463.n89wKvwy5vfBtTTyqqi5InfW-EdZ8-pjfT0N1pRafQ0
components-eventdetails--nested-properties--light:
hash: v1.k794b7964.6f1c381cb3e974066a9b11169cf51b0ecaf39e636598a67e9a7d695bfcadd866.7oJQgvEiijwBqHCOAfPbYAKW6yAnMwtdzUbgdks_Xf0
- components-funneltooltip--default--dark:
- hash: v1.k794b7964.fac49a0f8c78321f545ec7d1a04452b27dae1abdf10d656d9fb232e8dbf8516c.eIr9U0bTAzMpVFiGMywP_O7jTeocwV2xZ8P7vr5nGhc
- components-funneltooltip--default--light:
- hash: v1.k794b7964.392d271a66f148cffd2ef08fc6e6a859ad84697df2602c59aad9301a248c5fd3.AsLtM5djuBC3Mj7eCEvOjSEoK5Neamnu1tGB5aVyMt4
- components-funneltooltip--with-long-name--dark:
- hash: v1.k794b7964.a18ed1580d92e9c1107af8c23b830ad96c1f116fb2d47b0dcaa288bb3dec14da.5dBFjtO8c5nfmpjMmeIS-UQ5mptSZSMk1F2mzbwAEds
- components-funneltooltip--with-long-name--light:
- hash: v1.k794b7964.9c6eed57c9570f9c80c15fef356b3f1da7e197d8fd5131c1af3a35e2ab333210.m-gJY19ZlAeShhFqUTlYxGxx9-oyNE6TB0YtoRTtjFw
- components-funneltooltip--with-long-unbroken-name--dark:
- hash: v1.k794b7964.2404a8a40604335a2dc663f05752b89226e3659ad601f469edeee992570f1321.J7U2EIIWr_9cGThvfc0V6QWv5uLAp0piJOeBJedUFtE
- components-funneltooltip--with-long-unbroken-name--light:
- hash: v1.k794b7964.c3fc160b74a3da69d101e018e6ce21e4d7637034db899401636b0d7ee787c596.qVTLY0VF1PD7AvFAnHhbScmBV8WMlPcqbahRb8dGP0g
components-hedgehogmode--profile-picture-hog--dark:
hash: v1.k794b7964.969bdab0c4f15b4457bc162b9ad87ec0341d5e98ed3a9279494cc2f019c12250.5eEGiofVhJFttdE4ETVy01n1PTA-WrkIsgHZEB9rG5I
components-hedgehogmode--profile-picture-hog--light:
@@ -2660,10 +2648,6 @@ snapshots:
hash: v1.k794b7964.0f8fa49edbd34b530c19436f135928a1c0fe8a41d81a134557867a49a654f1ba.sb9Q-YkoG2R6noyY_Z-jXBOwm5VE0plTgWmtBrEBSD0
insights-funnellinechart--with-legend--light:
hash: v1.k794b7964.80b650a037743b29c986a4b5882679363826a0b899f634aea108334158fb6de0.qVa8Q3V9d2K9ui278M9r-0Ir9zm-LVJ0RrSkZ08t28U
- insights-funnellinechart-tooltip--breakdown-ordered-by-conversion--dark:
- hash: v1.k794b7964.921fd1aa35dea4db0e35d7894f08564cc2e658b1939aedaa11edbaaa7d22b2e4.qj8RQ5XQ9WFd1sv3IGtPEqVftgG_m_aF7bURwAuD1vE
- insights-funnellinechart-tooltip--breakdown-ordered-by-conversion--light:
- hash: v1.k794b7964.4616bfd5b45e06a6ce60ade668b9f0d2fc9ed964c73d94f05b19f85feef3d3fd.uKok4J8d1f72hhIjX58vZ2LYo8IOc7ITu3rDxFw6QZM
insights-funnelpropertycorrelationtable--default--dark:
hash: v1.k794b7964.311f6f62c92c4d57da0b590f8a10ee96eab682f58229d0e542643ea7982e0870.HjRKhvWCBYWS6qVwoa_4U68G5x-fMIfuiqowpJd_EH8
insights-funnelpropertycorrelationtable--default--light:
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index b1c346e3f001..9a343c5a7616 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -425,7 +425,6 @@ export const FEATURE_FLAGS = {
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_INSIGHT_HORIZONTAL_CONTROLS: 'insight-horizontal-controls', // owner: #team-product-analytics
- PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS: 'product-analytics-insights-tooltips', // owner: #team-product-analytics, gates the unified quill DefaultTooltip for trends/retention/stickiness insight charts
PRODUCT_ANALYTICS_PATHS_V2: 'paths-v2', // owner: @thmsobrmlr #team-product-analytics
PRODUCT_ANALYTICS_QUARTER_YEAR_INTERVALS: 'product-analytics-quarter-year-intervals', // owner: @sampennington #team-product-analytics, gates quarter/year interval selection on insights
PRODUCT_ANALYTICS_QUILL_LEGEND: 'product-analytics-quill-legend', // owner: #team-product-analytics, gates the in-chart quill legend replacing the legacy side InsightLegend
diff --git a/frontend/src/scenes/funnels/FunnelTooltip.stories.tsx b/frontend/src/scenes/funnels/FunnelTooltip.stories.tsx
deleted file mode 100644
index 3fe5693ab852..000000000000
--- a/frontend/src/scenes/funnels/FunnelTooltip.stories.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import type { Meta, StoryObj } from '@storybook/react'
-
-import { FunnelStepWithConversionMetrics } from '~/types'
-
-import { FunnelTooltip, FunnelTooltipProps } from './FunnelTooltip'
-
-const step: FunnelStepWithConversionMetrics = {
- action_id: '$pageview',
- name: '$pageview',
- custom_name: null,
- order: 0,
- people: [],
- count: 1,
- type: 'events',
- average_conversion_time: null,
- median_conversion_time: null,
- droppedOffFromPrevious: 0,
- conversionRates: {
- fromPrevious: 1,
- total: 1,
- fromBasisStep: 1,
- },
- breakdown_value: 'Baseline',
- converted_people_url: '',
- dropped_people_url: '',
-}
-
-type Story = StoryObj<FunnelTooltipProps>
-const meta: Meta<FunnelTooltipProps> = {
- title: 'Components/FunnelTooltip',
- component: FunnelTooltip,
- args: {
- showPersonsModal: true,
- stepIndex: 0,
- series: step,
- groupTypeLabel: 'persons',
- breakdownFilter: undefined,
- },
-}
-export default meta
-
-export const Default: Story = {
- args: {},
-}
-
-export const WithLongName: Story = {
- args: {
- series: {
- ...step,
- custom_name: 'with a very very very very very very very very very very very very long custom name',
- },
- },
-}
-
-export const WithLongUnbrokenName: Story = {
- args: {
- series: {
- ...step,
- name: 'a_very_long_snake_case_event_name_with_no_spaces_that_would_otherwise_be_clipped_by_the_tooltip',
- },
- },
-}
diff --git a/frontend/src/scenes/funnels/FunnelTooltip.tsx b/frontend/src/scenes/funnels/FunnelTooltip.tsx
deleted file mode 100644
index 0f8f085166ba..000000000000
--- a/frontend/src/scenes/funnels/FunnelTooltip.tsx
+++ /dev/null
@@ -1,228 +0,0 @@
-// .FunnelTooltip styles live in FunnelBarVertical.scss; import here so they load on the quill funnel
-// charts that reuse this tooltip (the old FunnelBarVertical that used to pull them in is gone).
-import './FunnelBarVertical/FunnelBarVertical.scss'
-
-import clsx from 'clsx'
-import { useValues } from 'kea'
-import { useEffect, useRef } from 'react'
-
-import { EntityFilterInfo } from 'lib/components/EntityFilterInfo'
-import { LemonDivider } from 'lib/lemon-ui/LemonDivider'
-import { LemonRow } from 'lib/lemon-ui/LemonRow'
-import { Lettermark, LettermarkColor } from 'lib/lemon-ui/Lettermark'
-import { humanFriendlyDuration } from 'lib/utils/durations'
-import { humanFriendlyNumber, percentage } from 'lib/utils/numbers'
-import { insightLogic } from 'scenes/insights/insightLogic'
-import { ClickToInspectActors } from 'scenes/insights/InsightTooltip/InsightTooltip'
-import { useInsightTooltip } from 'scenes/insights/useInsightTooltip'
-import { formatBreakdownLabel } from 'scenes/insights/utils'
-import { getActionFilterFromFunnelStep } from 'scenes/insights/views/Funnels/funnelStepTableUtils'
-
-import { cohortsModel } from '~/models/cohortsModel'
-import { groupsModel } from '~/models/groupsModel'
-import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel'
-import { BreakdownFilter } from '~/queries/schema/schema-general'
-import { FunnelStepWithConversionMetrics } from '~/types'
-
-import { funnelDataLogic } from './funnelDataLogic'
-import { funnelTooltipLogic } from './funnelTooltipLogic'
-import { funnelComparePeriodDateRange, funnelTooltipHeaderLabel, hasBreakdown } from './funnelUtils'
-
-/** The tooltip is offset horizontally by a few pixels from the bar to give it some breathing room. */
-const FUNNEL_TOOLTIP_OFFSET_PX = 4
-
-export interface FunnelTooltipProps {
- showPersonsModal: boolean
- stepIndex: number
- series: FunnelStepWithConversionMetrics
- groupTypeLabel: string
- breakdownFilter: BreakdownFilter | null | undefined
- embedded?: boolean
- /** Date range of the hovered series' compare period; shown when the series is compare-tagged. */
- comparePeriodDateRange?: string | null
- /** Baseline conversion rate across all breakdown values; shown only for breakdown variants past the first step. */
- aggregateConversionRate?: number | null
- /** True when the cursor is over the unfilled track area (drop-off region) rather than the bar. */
- isDropOffHover?: boolean
-}
-
-export function FunnelTooltip({
- showPersonsModal,
- stepIndex,
- series,
- groupTypeLabel,
- breakdownFilter,
- embedded = false,
- comparePeriodDateRange,
- aggregateConversionRate,
- isDropOffHover = false,
-}: FunnelTooltipProps): JSX.Element {
- const { allCohorts } = useValues(cohortsModel)
- const { formatPropertyValueForDisplay } = useValues(propertyDefinitionsModel)
- const headerLabel = funnelTooltipHeaderLabel({
- // Pure compare bars (no real breakdown) show only the period; breakdown and
- // breakdown + compare bars show the breakdown value (plus the period if any).
- breakdownLabel:
- !series.compare_label || hasBreakdown(series.breakdown_value)
- ? formatBreakdownLabel(
- series.breakdown_value,
- breakdownFilter,
- allCohorts.results,
- formatPropertyValueForDisplay
- )
- : null,
- compareLabel: series.compare_label,
- comparePeriodDateRange,
- })
- const showDropOff = isDropOffHover && stepIndex > 0
- return (
- <div
- data-attr="funnel-tooltip"
- className={clsx('FunnelTooltip InsightTooltip', {
- 'p-2': !embedded,
- 'border-none': embedded,
- 'shadow-none': embedded,
- })}
- >
- <LemonRow icon={<Lettermark name={stepIndex + 1} color={LettermarkColor.Gray} />} fullWidth>
- <strong>
- <EntityFilterInfo filter={getActionFilterFromFunnelStep(series)} allowWrap />
- {headerLabel && (
- <>
- <span className="mx-1">•</span>
- {headerLabel}
- </>
- )}
- </strong>
- </LemonRow>
- <LemonDivider className="my-2" />
- <table>
- <tbody>
- {showDropOff ? (
- <>
- <tr>
- <td>Dropped off</td>
- <td>{humanFriendlyNumber(series.droppedOffFromPrevious)}</td>
- </tr>
- <tr>
- <td>Drop-off from previous</td>
- <td>{percentage(1 - series.conversionRates.fromPrevious, 2, true)}</td>
- </tr>
- <tr>
- <td>Drop-off from start</td>
- <td>{percentage(1 - series.conversionRates.total, 2, true)}</td>
- </tr>
- </>
- ) : (
- <>
- <tr>
- <td>{stepIndex === 0 ? 'Entered' : 'Converted'}</td>
- <td>{humanFriendlyNumber(series.count)}</td>
- </tr>
- {stepIndex > 0 && (
- <tr>
- <td>Dropped off</td>
- <td>{humanFriendlyNumber(series.droppedOffFromPrevious)}</td>
- </tr>
- )}
- <tr>
- <td>Conversion so far</td>
- <td>{percentage(series.conversionRates.total, 2, true)}</td>
- </tr>
- {stepIndex > 0 && aggregateConversionRate != null && (
- <tr>
- <td>Baseline conversion rate</td>
- <td>{percentage(aggregateConversionRate, 2, true)}</td>
- </tr>
- )}
- {stepIndex > 0 && (
- <tr>
- <td>Conversion from previous</td>
- <td>{percentage(series.conversionRates.fromPrevious, 2, true)}</td>
- </tr>
- )}
- {stepIndex > 0 && series.median_conversion_time != null && (
- <tr>
- <td>Median time from previous</td>
- <td>{humanFriendlyDuration(series.median_conversion_time, { maxUnits: 3 })}</td>
- </tr>
- )}
- {stepIndex > 0 && series.average_conversion_time != null && (
- <tr>
- <td>Average time from previous</td>
- <td>{humanFriendlyDuration(series.average_conversion_time, { maxUnits: 3 })}</td>
- </tr>
- )}
- </>
- )}
- </tbody>
- </table>
- {showPersonsModal && (
- <>
- <LemonDivider className="my-2" />
- <ClickToInspectActors groupTypeLabel={groupTypeLabel} />
- </>
- )}
- </div>
- )
-}
-
-export function useFunnelTooltip(showPersonsModal: boolean): React.RefObject<HTMLDivElement> {
- const { insightProps } = useValues(insightLogic)
- const { breakdownFilter, querySource, insightData } = useValues(funnelDataLogic(insightProps))
- const { isTooltipShown, currentTooltip, tooltipOrigin } = useValues(funnelTooltipLogic(insightProps))
- const { aggregationLabel } = useValues(groupsModel)
-
- const vizRef = useRef<HTMLDivElement>(null)
- const { getTooltip } = useInsightTooltip()
-
- useEffect(() => {
- const svgRect = vizRef.current?.getBoundingClientRect()
- const [tooltipRoot, tooltipEl] = getTooltip()
- tooltipEl.style.opacity = isTooltipShown ? '1' : '0'
- const tooltipRect = tooltipEl.getBoundingClientRect()
- if (tooltipOrigin) {
- tooltipRoot.render(
- <>
- {currentTooltip && (
- <FunnelTooltip
- showPersonsModal={showPersonsModal}
- stepIndex={currentTooltip[0]}
- series={currentTooltip[1]}
- groupTypeLabel={aggregationLabel(querySource?.aggregation_group_type_index).plural}
- breakdownFilter={breakdownFilter}
- comparePeriodDateRange={
- currentTooltip[1].compare_label
- ? funnelComparePeriodDateRange(
- currentTooltip[1].compare_label,
- insightData?.resolved_date_range,
- querySource?.compareFilter?.compare_to
- )
- : null
- }
- />
- )}
- </>
- )
- // Put the tooltip to the bottom right of the cursor, but flip to left if tooltip doesn't fit
- let xOffset: number
- if (
- svgRect &&
- tooltipRect &&
- tooltipOrigin[0] + tooltipOrigin[2] + tooltipRect.width + FUNNEL_TOOLTIP_OFFSET_PX >
- svgRect.x + svgRect.width
- ) {
- xOffset = -tooltipRect.width - FUNNEL_TOOLTIP_OFFSET_PX
- } else {
- xOffset = tooltipOrigin[2] + FUNNEL_TOOLTIP_OFFSET_PX
- }
- tooltipEl.style.left = `${window.pageXOffset + tooltipOrigin[0] + xOffset}px`
- tooltipEl.style.top = `${window.pageYOffset + tooltipOrigin[1]}px`
- } else {
- tooltipEl.style.left = 'revert'
- tooltipEl.style.top = 'revert'
- }
- }, [isTooltipShown, tooltipOrigin, currentTooltip]) // oxlint-disable-line react-hooks/exhaustive-deps
-
- return vizRef
-}
diff --git a/frontend/src/scenes/funnels/funnelTooltipLogic.ts b/frontend/src/scenes/funnels/funnelTooltipLogic.ts
deleted file mode 100644
index a657fa29fb91..000000000000
--- a/frontend/src/scenes/funnels/funnelTooltipLogic.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { actions, kea, key, path, props, reducers } from 'kea'
-
-import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'
-
-import { FunnelStepWithConversionMetrics, InsightLogicProps } from '~/types'
-
-import type { funnelTooltipLogicType } from './funnelTooltipLogicType'
-
-const DEFAULT_FUNNEL_LOGIC_KEY = 'default_funnel_key'
-
-export const funnelTooltipLogic = kea<funnelTooltipLogicType>([
- props({} as InsightLogicProps),
- key(keyForInsightLogicProps(DEFAULT_FUNNEL_LOGIC_KEY)),
- path((key) => ['scenes', 'funnels', 'funnelTooltipLogic', key]),
- actions({
- showTooltip: (
- origin: [number, number, number],
- stepIndex: number,
- series: FunnelStepWithConversionMetrics
- ) => ({
- origin,
- stepIndex,
- series,
- }),
- hideTooltip: true,
- }),
- reducers({
- isTooltipShown: [
- false,
- {
- showTooltip: () => true,
- hideTooltip: () => false,
- },
- ],
- currentTooltip: [
- null as [number, FunnelStepWithConversionMetrics] | null,
- {
- showTooltip: (_, { stepIndex, series }) => [stepIndex, series],
- },
- ],
- tooltipOrigin: [
- null as [number, number, number] | null, // x, y, width
- {
- showTooltip: (_, { origin }) => origin,
- },
- ],
- }),
-])
diff --git a/frontend/src/scenes/insights/views/BoxPlot/BoxPlotChart.tsx b/frontend/src/scenes/insights/views/BoxPlot/BoxPlotChart.tsx
index 172472392555..b28e544cde91 100644
--- a/frontend/src/scenes/insights/views/BoxPlot/BoxPlotChart.tsx
+++ b/frontend/src/scenes/insights/views/BoxPlot/BoxPlotChart.tsx
@@ -2,69 +2,26 @@ import { useValues } from 'kea'
import { useCallback, useMemo } from 'react'
import { BoxPlot } from '@posthog/quill-charts'
-import type { BoxPlotClickData, BoxPlotConfig, BoxPlotSeries, BoxPlotTooltipContext } from '@posthog/quill-charts'
+import type { BoxPlotClickData, BoxPlotConfig, BoxPlotSeries } from '@posthog/quill-charts'
-import 'scenes/insights/InsightTooltip/InsightTooltip.scss'
import { useChartConfig, useChartTheme } from 'lib/charts/hooks'
import { getSeriesColor } from 'lib/colors'
import { DateDisplay } from 'lib/components/DateDisplay'
-import { SeriesLetter } from 'lib/components/SeriesGlyph'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { insightLogic } from 'scenes/insights/insightLogic'
-import { InsightTooltip } from 'scenes/insights/InsightTooltip/InsightTooltip'
-import { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
import { teamLogic } from 'scenes/teamLogic'
import { openPersonsModal } from 'scenes/trends/persons-modal/PersonsModal'
-import { BoxPlotDatum, InsightActorsQuery, NodeKind } from '~/queries/schema/schema-general'
+import { InsightActorsQuery, NodeKind } from '~/queries/schema/schema-general'
import { ChartParams } from '~/types'
-import { BoxPlotSeriesData, boxPlotChartLogic } from './boxPlotChartLogic'
-
-const BOX_PLOT_STATS = [
- { label: 'Max', value: (d: BoxPlotDatum) => d.max },
- { label: '75th percentile', value: (d: BoxPlotDatum) => d.p75 },
- { label: 'Median', value: (d: BoxPlotDatum) => d.median },
- { label: 'Mean', value: (d: BoxPlotDatum) => d.mean },
- { label: '25th percentile', value: (d: BoxPlotDatum) => d.p25 },
- { label: 'Min', value: (d: BoxPlotDatum) => d.min },
-] as const
-
-function seriesDataToTooltip(seriesGroups: BoxPlotSeriesData[], dataIndex: number): SeriesDatum[] {
- const result: SeriesDatum[] = []
- for (const group of seriesGroups) {
- const datum = group.rawData[dataIndex]
- if (!datum) {
- continue
- }
- const showSeriesLabel = seriesGroups.length > 1
- const color = getSeriesColor(group.seriesIndex)
- for (let statIdx = 0; statIdx < BOX_PLOT_STATS.length; statIdx++) {
- const stat = BOX_PLOT_STATS[statIdx]
- const label = showSeriesLabel ? `${group.seriesLabel} - ${stat.label}` : stat.label
- result.push({
- id: group.seriesIndex * BOX_PLOT_STATS.length + statIdx,
- dataIndex,
- datasetIndex: group.seriesIndex,
- label,
- order: group.seriesIndex * BOX_PLOT_STATS.length + statIdx,
- color,
- count: stat.value(datum),
- })
- }
- }
- return result
-}
+import { boxPlotChartLogic } from './boxPlotChartLogic'
export function BoxPlotChart({ showPersonsModal = true }: ChartParams): JSX.Element {
const { insightProps } = useValues(insightLogic)
const { boxplotData, seriesGroups, dateLabels, yAxisScaleType, querySource, interval, insightData, trendsFilter } =
useValues(boxPlotChartLogic(insightProps))
const { timezone, weekStartDay } = useValues(teamLogic)
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
const theme = useChartTheme()
@@ -97,46 +54,9 @@ export function BoxPlotChart({ showPersonsModal = true }: ChartParams): JSX.Elem
yScaleType: yAxisScaleType === 'log10' ? 'log' : 'linear',
yTickFormatter: formatValue,
showGrid: true,
- tooltip: quillTooltipEnabled ? { pinnable: true, placement: 'cursor' } : undefined,
+ tooltip: { pinnable: true, placement: 'cursor' },
}),
- [yAxisScaleType, formatValue, quillTooltipEnabled]
- )
-
- const renderTooltip = useCallback(
- (ctx: BoxPlotTooltipContext): JSX.Element | null => {
- const dataIndex = ctx.dataIndex
- const day = seriesGroups[0]?.rawData[dataIndex]?.day
- if (!seriesGroups.length || !day) {
- return null
- }
- return (
- <InsightTooltip
- date={day}
- timezone={timezone}
- seriesData={seriesDataToTooltip(seriesGroups, dataIndex)}
- interval={interval}
- dateRange={insightData?.resolved_date_range}
- hideColorCol={seriesGroups.length === 1}
- renderSeries={(value, datum) => (
- <div className="datum-label-column">
- {seriesGroups.length > 1 && (
- <SeriesLetter
- className="mr-2"
- hasBreakdown={false}
- seriesIndex={datum.datasetIndex}
- seriesColor={datum.color}
- />
- )}
- {value}
- </div>
- )}
- renderCount={(value: number) => formatValue(value)}
- hideInspectActorsSection={!showPersonsModal}
- groupTypeLabel="people"
- />
- )
- },
- [seriesGroups, timezone, interval, insightData, showPersonsModal, formatValue]
+ [yAxisScaleType, formatValue]
)
const handleBoxClick = useCallback(
@@ -192,7 +112,6 @@ export function BoxPlotChart({ showPersonsModal = true }: ChartParams): JSX.Elem
labels={dateLabels}
theme={theme}
config={config}
- tooltip={quillTooltipEnabled ? undefined : renderTooltip}
onBoxClick={handleBoxClick}
dataAttr="box-plot-graph"
/>
diff --git a/frontend/src/test/insight-testing/interactions.ts b/frontend/src/test/insight-testing/interactions.ts
index 9736306dd4b7..e97a292b1c09 100644
--- a/frontend/src/test/insight-testing/interactions.ts
+++ b/frontend/src/test/insight-testing/interactions.ts
@@ -164,7 +164,10 @@ export const chart = {
* after `clickAtIndex` has pinned a multi-series tooltip. */
async clickTooltipRow(label: string | RegExp): Promise<void> {
const tooltip = await waitForHogChartTooltip()
- const row = within(tooltip).getByText(label)
+ // Each quill tooltip row renders its label twice — a visible copy plus an aria-hidden
+ // measurement copy used for truncation layout — so match only the visible one.
+ const matches = within(tooltip).getAllByText(label)
+ const row = matches.find((el) => !el.closest('[aria-hidden="true"]')) ?? matches[0]
const clickable = row.closest('[data-attr="hog-chart-tooltip-row"]') ?? row.closest('tr') ?? row
fireEvent.click(clickable)
},
diff --git a/frontend/src/test/insight-testing/tooltip-helpers.ts b/frontend/src/test/insight-testing/tooltip-helpers.ts
index 03b1de524b8d..51cefde9d929 100644
--- a/frontend/src/test/insight-testing/tooltip-helpers.ts
+++ b/frontend/src/test/insight-testing/tooltip-helpers.ts
@@ -1,11 +1,10 @@
import { createHogChartTooltip, type HogChartTooltip } from '@posthog/quill-charts/testing'
/** Insight-flavored tooltip accessor. Extends the generic hog-charts tooltip
- * with helpers for reading a per-series tooltip. Dual-mode: trends-family charts
- * render hog-charts' `DefaultTooltip` (`hog-chart-tooltip-*` rows), while funnel
- * and retention still render the legacy `InsightTooltip` table (`<th>` header,
- * `<tr>` rows with `.datum-column` / `.datum-counts-column`). The accessor reads
- * whichever is present so a single helper covers both during the migration. */
+ * with helpers for reading a per-series tooltip. Insight charts render hog-charts'
+ * `DefaultTooltip` (`hog-chart-tooltip-*` rows); the legacy `InsightTooltip` table
+ * branch (`<th>` header, `<tr>` rows with `.datum-column` / `.datum-counts-column`)
+ * is retained for any remaining table-based tooltip readers. */
export interface InsightTooltipAccessor extends HogChartTooltip {
/** Header text — typically the hovered date (e.g. "Wednesday, 12 Jun (UTC)"). */
title(): string
@@ -30,8 +29,12 @@ export function createInsightTooltipAccessor(element: HTMLElement): InsightToolt
row(label: string): string | undefined {
if (isDefaultTooltip()) {
+ // The series label mixes non-breaking spaces (e.g. the compare separator) with regular
+ // ones, so normalize whitespace before matching against the caller's plain-space label.
+ const normalize = (text: string | null | undefined): string => (text ?? '').replace(/\s+/g, ' ').trim()
+ const needle = normalize(label)
const row = defaultRows().find((r) =>
- r.querySelector('[data-attr="hog-chart-tooltip-series"]')?.textContent?.includes(label)
+ normalize(r.querySelector('[data-attr="hog-chart-tooltip-series"]')?.textContent).includes(needle)
)
return row?.querySelector('[data-attr="hog-chart-tooltip-value"]')?.textContent ?? undefined
}
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalTooltip.tsx b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalTooltip.tsx
index b38f6162b514..c49ce341b64c 100644
--- a/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalTooltip.tsx
+++ b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalTooltip.tsx
@@ -1,10 +1,5 @@
-import { useValues } from 'kea'
-
import type { TooltipContext } from '@posthog/quill-charts'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { FunnelTooltip } from 'scenes/funnels/FunnelTooltip'
import { funnelComparePeriodDateRange, getFunnelAggregateConversionRate } from 'scenes/funnels/funnelUtils'
import type { BreakdownFilter } from '~/queries/schema/schema-general'
@@ -37,9 +32,6 @@ export function FunnelBarHorizontalTooltip({
resolvedDateRange,
compareTo,
}: FunnelBarHorizontalTooltipProps): JSX.Element | null {
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
-
const target = resolveFunnelBarHorizontalHover(context, step, stepIndex, firstStep)
if (!target) {
return null
@@ -61,9 +53,5 @@ export function FunnelBarHorizontalTooltip({
comparePeriodDateRange,
}
- return quillTooltipEnabled ? (
- <FunnelStepTooltip {...sharedProps} isDropOffHover={isDropOffHover} color={color} />
- ) : (
- <FunnelTooltip {...sharedProps} isDropOffHover={isDropOffHover} />
- )
+ return <FunnelStepTooltip {...sharedProps} isDropOffHover={isDropOffHover} color={color} />
}
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.test.tsx b/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.test.tsx
index 999f31fbcd08..0841a6ed4c45 100644
--- a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.test.tsx
+++ b/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.test.tsx
@@ -112,11 +112,12 @@ describe('FunnelLineChart', () => {
// Current and previous of the same breakdown are separate tooltip rows, keyed by
// breakdown_value/compare_label. Regression guard: without compare_label threaded into
// the tooltip datum, both rows collapsed into one shared column and only the current
- // value rendered, leaving the previous row showing "–".
- expect(tooltip.row('Spike · Current')).toContain('50%')
- expect(tooltip.row('Spike · Previous')).toContain('45%')
- expect(tooltip.row('Bramble · Current')).toContain('30%')
- expect(tooltip.row('Bramble · Previous')).toContain('25%')
+ // value rendered, leaving the previous row showing "–". Rows are sorted by value
+ // descending, so the four distinct conversion values must all render.
+ const rowValues = Array.from(tooltip.element.querySelectorAll('[data-attr="hog-chart-tooltip-row"]')).map(
+ (row) => row.querySelector('[data-attr="hog-chart-tooltip-value"]')?.textContent
+ )
+ expect(rowValues).toEqual(['50%', '45%', '30%', '25%'])
})
})
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.tsx b/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.tsx
index caa3be3eabef..feca8f7ce56c 100644
--- a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.tsx
+++ b/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart.tsx
@@ -11,13 +11,10 @@ import type {
} from '@posthog/quill-charts'
import { useChartConfig, useChartTheme, useDateRangeZoom } from 'lib/charts/hooks'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic'
import { funnelPersonsModalLogic } from 'scenes/funnels/funnelPersonsModalLogic'
import { hasBreakdown } from 'scenes/funnels/funnelUtils'
import { insightLogic } from 'scenes/insights/insightLogic'
-import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
import { formatBreakdownLabel } from 'scenes/insights/utils'
import { teamLogic } from 'scenes/teamLogic'
import { openPersonsModal } from 'scenes/trends/persons-modal/PersonsModal'
@@ -31,12 +28,11 @@ import { ChartParams, type FlattenedFunnelStepByBreakdown } from '~/types'
import { chartStyleCurve } from '../../shared/chartStyleAdapter'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
-import { INSIGHT_TOOLTIP_CONFIG, INSIGHT_TOOLTIP_CONFIG_LEGACY } from '../../shared/tooltipConfig'
+import { INSIGHT_TOOLTIP_CONFIG } from '../../shared/tooltipConfig'
import { AnnotationsLayer } from '../../trends/shared/AnnotationsLayer'
import { buildBaseLegendConfig } from '../../trends/shared/buildBaseLegendConfig'
import { FUNNEL_CONVERSION_SERIES_LABEL, type FunnelSeriesMeta } from '../shared/funnelSeriesMeta'
import { buildFunnelLineSeries, buildFunnelLineTimeSeriesConfig, type IndexedFunnelStep } from './funnelChartTransforms'
-import { FunnelLineTooltip } from './FunnelLineTooltip'
import { type FunnelLineChartClickDeps, handleFunnelLineChartClick } from './handleFunnelLineChartClick'
const EMPTY_STRINGS: string[] = []
@@ -67,9 +63,6 @@ export function FunnelLineChart({
showPersonsModal: showPersonsModalProp = true,
}: Omit<ChartParams, 'filters'>): JSX.Element | null {
const theme = useChartTheme()
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
- const TOOLTIP_CONFIG = quillTooltipEnabled ? INSIGHT_TOOLTIP_CONFIG : INSIGHT_TOOLTIP_CONFIG_LEGACY
const { insightProps, insight, canEditInsight } = useValues(insightLogic)
const {
@@ -151,7 +144,7 @@ export function FunnelLineChart({
showTrendLines: funnelsFilter?.showTrendLines ?? false,
valueLabels: showValuesOnSeries ? { formatter: (value) => `${value}%` } : false,
showCrosshair: true,
- tooltip: TOOLTIP_CONFIG,
+ tooltip: INSIGHT_TOOLTIP_CONFIG,
}),
curve: chartStyleCurve(funnelsFilter?.chartStyle),
legend: legendConfig,
@@ -166,7 +159,6 @@ export function FunnelLineChart({
funnelsFilter?.chartStyle,
showValuesOnSeries,
legendConfig,
- TOOLTIP_CONFIG,
]
)
@@ -215,54 +207,29 @@ export function FunnelLineChart({
const onDateRangeZoom = useDateRangeZoom(annotationDates, context?.onDateRangeZoom)
const renderTooltip = useCallback(
- (ctx: TooltipContext<FunnelSeriesMeta>): JSX.Element => {
- if (quillTooltipEnabled) {
- return (
- <InsightSeriesTooltip
- context={ctx}
- timezone={timezone}
- interval={interval ?? undefined}
- breakdownFilter={breakdownFilter ?? undefined}
- dateRange={insightData?.resolved_date_range ?? undefined}
- groupTypeLabel={resolvedGroupTypeLabel}
- renderSeriesOverride={(datum) => datum.label ?? ''}
- renderCount={(value) => `${value}%`}
- onRowClick={
- showPersonsModal
- ? (datum) => {
- const meta = ctx.seriesData[datum.datasetIndex]?.series.meta
- if (meta) {
- handleFunnelLineChartClick(meta, datum.dataIndex, clickDeps)
- }
- }
- : undefined
- }
- />
- )
- }
- return (
- <FunnelLineTooltip
- context={ctx}
- timezone={timezone}
- interval={interval ?? undefined}
- breakdownFilter={breakdownFilter ?? undefined}
- dateRange={insightData?.resolved_date_range ?? undefined}
- groupTypeLabel={resolvedGroupTypeLabel}
- onRowClick={
- showPersonsModal
- ? (datum: SeriesDatum) => {
- const meta = ctx.seriesData[datum.datasetIndex]?.series.meta
- if (meta) {
- handleFunnelLineChartClick(meta, datum.dataIndex, clickDeps)
- }
+ (ctx: TooltipContext<FunnelSeriesMeta>): JSX.Element => (
+ <InsightSeriesTooltip
+ context={ctx}
+ timezone={timezone}
+ interval={interval ?? undefined}
+ breakdownFilter={breakdownFilter ?? undefined}
+ dateRange={insightData?.resolved_date_range ?? undefined}
+ groupTypeLabel={resolvedGroupTypeLabel}
+ renderSeriesOverride={(datum) => datum.label ?? ''}
+ renderCount={(value) => `${value}%`}
+ onRowClick={
+ showPersonsModal
+ ? (datum) => {
+ const meta = ctx.seriesData[datum.datasetIndex]?.series.meta
+ if (meta) {
+ handleFunnelLineChartClick(meta, datum.dataIndex, clickDeps)
}
- : undefined
- }
- />
- )
- },
+ }
+ : undefined
+ }
+ />
+ ),
[
- quillTooltipEnabled,
timezone,
interval,
breakdownFilter,
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineTooltip.stories.tsx b/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineTooltip.stories.tsx
deleted file mode 100644
index e187d8ffc678..000000000000
--- a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineTooltip.stories.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { Meta, StoryObj } from '@storybook/react'
-import { useMountedLogic } from 'kea'
-
-import type { Series, TooltipContext } from '@posthog/quill-charts'
-
-import { cohortsModel } from '~/models/cohortsModel'
-import type { BreakdownFilter } from '~/queries/schema/schema-general'
-
-import type { FunnelSeriesMeta } from '../shared/funnelSeriesMeta'
-import { FunnelLineTooltip } from './FunnelLineTooltip'
-
-const days = ['2024-06-10', '2024-06-11', '2024-06-12', '2024-06-13', '2024-06-14']
-const DATA_INDEX = 2
-
-const breakdownFilter: BreakdownFilter = { breakdown: '$browser', breakdown_type: 'event' }
-
-const COLORS = ['#1d4aff', '#621da6', '#42827e', '#f4a261', '#e76f51']
-
-// Breakdown series are supplied in a deliberately scrambled order (40, 20, 55, 60, 10).
-// The tooltip must reorder rows by conversion value descending, so the screenshot reads
-// Firefox 60% → Edge 55% → Safari 40% → Chrome 20% → Opera 10% top to bottom.
-const breakdownRows: { label: string; value: number }[] = [
- { label: 'Safari', value: 40 },
- { label: 'Chrome', value: 20 },
- { label: 'Edge', value: 55 },
- { label: 'Firefox', value: 60 },
- { label: 'Opera', value: 10 },
-]
-
-function buildContext(rows: { label: string; value: number }[]): TooltipContext<FunnelSeriesMeta> {
- const seriesData = rows.map(({ label, value }, idx) => {
- const series: Series<FunnelSeriesMeta> = {
- key: label,
- label,
- data: days.map(() => value),
- meta: { days, breakdown_value: label, order: 0, label },
- }
- return { series, value, color: COLORS[idx % COLORS.length] }
- })
- return {
- dataIndex: DATA_INDEX,
- label: days[DATA_INDEX],
- seriesData,
- position: { x: 0, y: 0 },
- hoverPosition: null,
- canvasBounds: { x: 0, y: 0, width: 0, height: 0, top: 0, right: 0, bottom: 0, left: 0 } as DOMRect,
- isPinned: true,
- onUnpin: () => {},
- }
-}
-
-type Story = StoryObj<{}>
-
-const meta: Meta = {
- title: 'Insights/FunnelLineChart/Tooltip',
- component: FunnelLineTooltip,
- parameters: {
- layout: 'centered',
- mockDate: '2024-06-12',
- testOptions: { snapshotBrowsers: ['chromium'] },
- },
-}
-export default meta
-
-export const BreakdownOrderedByConversion: Story = {
- render: () => {
- useMountedLogic(cohortsModel)
-
- return (
- <FunnelLineTooltip
- context={buildContext(breakdownRows)}
- timezone="UTC"
- interval="day"
- breakdownFilter={breakdownFilter}
- groupTypeLabel="persons"
- onRowClick={() => {}}
- />
- )
- },
-}
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineTooltip.tsx b/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineTooltip.tsx
deleted file mode 100644
index 6e73a04a8872..000000000000
--- a/products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineTooltip.tsx
+++ /dev/null
@@ -1,97 +0,0 @@
-import { useCallback, useMemo } from 'react'
-
-import type { TooltipContext } from '@posthog/quill-charts'
-
-import { hasBreakdown } from 'scenes/funnels/funnelUtils'
-import { InsightTooltip } from 'scenes/insights/InsightTooltip/InsightTooltip'
-import { getDatumTitle, type SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
-
-import type { BreakdownFilter, DateRange } from '~/queries/schema/schema-general'
-import type { IntervalType } from '~/types'
-
-import { FUNNEL_CONVERSION_SERIES_LABEL, type FunnelSeriesMeta } from '../shared/funnelSeriesMeta'
-
-const NOOP = (): void => {}
-
-interface FunnelLineTooltipProps {
- context: TooltipContext<FunnelSeriesMeta>
- timezone?: string
- interval?: IntervalType
- breakdownFilter?: BreakdownFilter
- dateRange?: DateRange
- groupTypeLabel?: string
- onRowClick?: (datum: SeriesDatum) => void
-}
-
-export function FunnelLineTooltip({
- context,
- timezone,
- interval,
- breakdownFilter,
- dateRange,
- groupTypeLabel,
- onRowClick,
-}: FunnelLineTooltipProps): React.ReactElement {
- const seriesData = useMemo<SeriesDatum[]>(() => {
- const data = context.seriesData.map((entry, idx) => {
- const meta = entry.series.meta ?? ({} as FunnelSeriesMeta)
- return {
- id: idx,
- dataIndex: context.dataIndex,
- datasetIndex: idx,
- // Each conversion-rate line is a single value, so every series shares one tooltip
- // value column. The inverted layout instead separates them into rows keyed by
- // breakdown_value/compare_label. Distinct orders would split them across columns
- // the layout never renders, leaving every series but the first showing "–".
- order: 0,
- label: entry.series.label,
- color: entry.color,
- count: entry.value,
- breakdown_value: meta.breakdown_value,
- compare_label: meta.compare_label,
- date_label: meta.days?.[context.dataIndex],
- }
- })
- // Order rows by conversion value descending (matching the trends tooltip) so the
- // highest-converting series sits at the top, ties broken alphabetically. datasetIndex
- // keeps the original series index for persons-modal scoping; only the display id is
- // re-derived from the sorted order.
- data.sort(
- (a, b) =>
- b.count - a.count ||
- (a.label === undefined || b.label === undefined ? 0 : a.label.localeCompare(b.label))
- )
- return data.map((s, id) => ({ ...s, id }))
- }, [context.seriesData, context.dataIndex])
-
- const date = context.seriesData[0]?.series.meta?.days?.[context.dataIndex]
-
- const renderCount = useCallback((value: number): string => `${value}%`, [])
-
- const renderSeries = useCallback(
- (_value: React.ReactNode, datum: SeriesDatum): React.ReactElement => {
- if (hasBreakdown(datum.breakdown_value)) {
- return <div className="datum-label-column">{getDatumTitle(datum, breakdownFilter)}</div>
- }
- return <div className="datum-label-column">{FUNNEL_CONVERSION_SERIES_LABEL}</div>
- },
- [breakdownFilter]
- )
-
- return (
- <InsightTooltip
- date={date}
- timezone={timezone}
- seriesData={seriesData}
- breakdownFilter={breakdownFilter}
- interval={interval}
- dateRange={dateRange}
- groupTypeLabel={groupTypeLabel}
- onClose={context.onUnpin ?? NOOP}
- renderSeries={renderSeries}
- renderCount={renderCount}
- onRowClick={onRowClick}
- hideInspectActorsSection={!onRowClick}
- />
- )
-}
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarChart.tsx b/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarChart.tsx
index 9db766b16dd6..acfa372c5dee 100644
--- a/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarChart.tsx
+++ b/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarChart.tsx
@@ -7,8 +7,6 @@ import type { PointClickData, TooltipContext } from '@posthog/quill-charts'
import { useChartConfig, useChartTheme } from 'lib/charts/hooks'
import { ScrollableShadows } from 'lib/components/ScrollableShadows/ScrollableShadows'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { StepLegend } from 'scenes/funnels/FunnelBarVertical/StepLegend'
import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic'
import { funnelPersonsModalLogic } from 'scenes/funnels/funnelPersonsModalLogic'
@@ -47,8 +45,6 @@ export function FunnelStepsBarChart({
showPersonsModal: showPersonsModalProp = true,
inCardView,
}: ChartParams): JSX.Element | null {
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
const theme = useChartTheme()
const { insightProps } = useValues(insightLogic)
const { visibleStepsWithConversionMetrics, getFunnelsColor, breakdownFilter, querySource, insightData } = useValues(
@@ -70,10 +66,7 @@ export function FunnelStepsBarChart({
[steps, getFunnelsColor]
)
- const config = useChartConfig(
- () => withFunnelStepsBarInteraction(chartConfig, { quillTooltipEnabled }),
- [quillTooltipEnabled]
- )
+ const config = useChartConfig(() => withFunnelStepsBarInteraction(chartConfig), [])
const groupTypeLabel = aggregationLabel(querySource?.aggregation_group_type_index).plural
const showTime = steps.some((step) => step.average_conversion_time != null)
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarTooltip.tsx b/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarTooltip.tsx
index 3ba104a45313..06bc92f4468c 100644
--- a/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarTooltip.tsx
+++ b/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarTooltip.tsx
@@ -1,10 +1,5 @@
-import { useValues } from 'kea'
-
import type { TooltipContext } from '@posthog/quill-charts'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { FunnelTooltip } from 'scenes/funnels/FunnelTooltip'
import { funnelComparePeriodDateRange, getFunnelAggregateConversionRate } from 'scenes/funnels/funnelUtils'
import type { BreakdownFilter } from '~/queries/schema/schema-general'
@@ -32,9 +27,6 @@ export function FunnelStepsBarTooltip({
resolvedDateRange,
compareTo,
}: FunnelStepsBarTooltipProps): JSX.Element | null {
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
-
const stepIndex = context.dataIndex
const step = steps[stepIndex]
const entry = context.seriesData[0]
@@ -63,9 +55,5 @@ export function FunnelStepsBarTooltip({
comparePeriodDateRange,
}
- return quillTooltipEnabled ? (
- <FunnelStepTooltip {...sharedProps} isDropOffHover={isDropOffHover} color={entry.color} />
- ) : (
- <FunnelTooltip {...sharedProps} isDropOffHover={isDropOffHover} />
- )
+ return <FunnelStepTooltip {...sharedProps} isDropOffHover={isDropOffHover} color={entry.color} />
}
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/funnelStepsBarTransforms.test.ts b/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/funnelStepsBarTransforms.test.ts
index 62fa44b12ff1..865948bc4ef9 100644
--- a/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/funnelStepsBarTransforms.test.ts
+++ b/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/funnelStepsBarTransforms.test.ts
@@ -250,17 +250,11 @@ describe('resolveFunnelStepClick', () => {
describe('withFunnelStepsBarInteraction', () => {
const baseConfig: BarChartConfig = { barLayout: 'grouped', tooltip: { placement: 'top' } }
- it('returns the base config unchanged when the new tooltip is off', () => {
- const config = withFunnelStepsBarInteraction(baseConfig, { quillTooltipEnabled: false })
-
- expect(config).toBe(baseConfig)
- })
-
- it('enables a pinnable tooltip that resolves clicks to the nearest series when the new tooltip is on', () => {
+ it('enables a pinnable tooltip that resolves clicks to the nearest series', () => {
// A breakdown puts one series per breakdown value at each step, so a pinnable tooltip
// here always covers multiple series — resolveClickToNearestSeries must stay set or a
// click pins the tooltip instead of opening the persons modal (the bug this guards).
- const config = withFunnelStepsBarInteraction(baseConfig, { quillTooltipEnabled: true })
+ const config = withFunnelStepsBarInteraction(baseConfig)
expect(config.tooltip).toEqual({ pinnable: true, resolveClickToNearestSeries: true, placement: 'cursor' })
})
diff --git a/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/funnelStepsBarTransforms.ts b/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/funnelStepsBarTransforms.ts
index cdb01ada1ca1..3518e045d44c 100644
--- a/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/funnelStepsBarTransforms.ts
+++ b/products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/funnelStepsBarTransforms.ts
@@ -114,21 +114,15 @@ function orderCompareSeriesPreviousFirst(
)
}
-/** Derives the chart config from the base config plus whether the new pinnable tooltip is
- * enabled. A breakdown always puts one series per breakdown value at each step, so a pinnable
- * tooltip here always covers multiple series — `resolveClickToNearestSeries` resolves the
- * click to the nearest one and opens its persons modal directly instead of pinning first. */
-export function withFunnelStepsBarInteraction(
- baseConfig: BarChartConfig,
- options: { quillTooltipEnabled: boolean }
-): BarChartConfig {
- if (options.quillTooltipEnabled) {
- return {
- ...baseConfig,
- tooltip: { ...INSIGHT_TOOLTIP_CONFIG, resolveClickToNearestSeries: true },
- }
+/** Adds the pinnable tooltip to the base config. A breakdown always puts one series per breakdown
+ * value at each step, so a pinnable tooltip here always covers multiple series —
+ * `resolveClickToNearestSeries` resolves the click to the nearest one and opens its persons modal
+ * directly instead of pinning first. */
+export function withFunnelStepsBarInteraction(baseConfig: BarChartConfig): BarChartConfig {
+ return {
+ ...baseConfig,
+ tooltip: { ...INSIGHT_TOOLTIP_CONFIG, resolveClickToNearestSeries: true },
}
- return baseConfig
}
export interface FunnelStepClickTarget {
diff --git a/products/product_analytics/frontend/insights/retention/RetentionBarChart/RetentionBarChart.tsx b/products/product_analytics/frontend/insights/retention/RetentionBarChart/RetentionBarChart.tsx
index d4e486808a5b..9c0a45e7d73c 100644
--- a/products/product_analytics/frontend/insights/retention/RetentionBarChart/RetentionBarChart.tsx
+++ b/products/product_analytics/frontend/insights/retention/RetentionBarChart/RetentionBarChart.tsx
@@ -6,8 +6,6 @@ import { TimeSeriesBarChart } from '@posthog/quill-charts'
import type { PointClickData, TooltipContext } from '@posthog/quill-charts'
import { useChartConfig, useChartTheme } from 'lib/charts/hooks'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { roundToDecimal } from 'lib/utils/numbers'
import { insightLogic } from 'scenes/insights/insightLogic'
import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
@@ -19,14 +17,13 @@ import type { GoalLine } from '~/queries/schema/schema-general'
import type { GroupTypeIndex, LabelGroupType } from '~/types'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
-import { INSIGHT_TOOLTIP_CONFIG, INSIGHT_TOOLTIP_CONFIG_LEGACY } from '../../shared/tooltipConfig'
+import { INSIGHT_TOOLTIP_CONFIG } from '../../shared/tooltipConfig'
import {
buildRetentionBarChartConfig,
buildRetentionSeries,
type RetentionSeriesMeta,
type RetentionTrendSeriesEntry,
} from '../shared/retentionChartTransforms'
-import { RetentionTooltip } from '../shared/RetentionTooltip'
interface RetentionBarChartProps {
inSharedMode?: boolean
@@ -55,9 +52,6 @@ function resolveGroupTypeLabel(
export function RetentionBarChart({ inSharedMode = false }: RetentionBarChartProps): JSX.Element | null {
const { insightProps } = useValues(insightLogic)
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
- const TOOLTIP_CONFIG = quillTooltipEnabled ? INSIGHT_TOOLTIP_CONFIG : INSIGHT_TOOLTIP_CONFIG_LEGACY
const theme = useChartTheme()
const {
@@ -106,42 +100,25 @@ export function RetentionBarChart({ inSharedMode = false }: RetentionBarChartPro
const renderTooltip = useCallback(
(ctx: TooltipContext<RetentionSeriesMeta>) => {
- if (quillTooltipEnabled) {
- const altTitle =
- selectedInterval !== null
- ? `${period ?? ''} ${selectedInterval}`
- : (xAxisLabels[ctx.dataIndex] ?? ctx.label)
- return (
- <InsightSeriesTooltip
- context={ctx}
- altTitle={altTitle}
- renderCount={(value) =>
- isPercentage ? `${roundToDecimal(value)}%` : `${roundToDecimal(value)}`
- }
- renderSeriesOverride={(datum) => {
- const showCohortPrefix = selectedInterval !== null || !shouldShowMeanPerBreakdown
- return showCohortPrefix ? `Cohort ${datum.label ?? ''}` : (datum.label ?? '')
- }}
- groupTypeLabel={groupTypeLabel}
- onRowClick={canClick ? onRowClick : undefined}
- />
- )
- }
+ const altTitle =
+ selectedInterval !== null
+ ? `${period ?? ''} ${selectedInterval}`
+ : (xAxisLabels[ctx.dataIndex] ?? ctx.label)
return (
- <RetentionTooltip
+ <InsightSeriesTooltip
context={ctx}
- xAxisLabels={xAxisLabels}
- period={period}
- selectedInterval={selectedInterval}
- shouldShowMeanPerBreakdown={shouldShowMeanPerBreakdown}
- isPercentage={isPercentage}
+ altTitle={altTitle}
+ renderCount={(value) => (isPercentage ? `${roundToDecimal(value)}%` : `${roundToDecimal(value)}`)}
+ renderSeriesOverride={(datum) => {
+ const showCohortPrefix = selectedInterval !== null || !shouldShowMeanPerBreakdown
+ return showCohortPrefix ? `Cohort ${datum.label ?? ''}` : (datum.label ?? '')
+ }}
groupTypeLabel={groupTypeLabel}
onRowClick={canClick ? onRowClick : undefined}
/>
)
},
[
- quillTooltipEnabled,
xAxisLabels,
period,
selectedInterval,
@@ -171,8 +148,8 @@ export function RetentionBarChart({ inSharedMode = false }: RetentionBarChartPro
const goalLines = retentionFilter?.goalLines ?? EMPTY_GOAL_LINES
const barConfig = useChartConfig(
- () => buildRetentionBarChartConfig({ isPercentage, goalLines, series, tooltip: TOOLTIP_CONFIG }),
- [isPercentage, goalLines, series, TOOLTIP_CONFIG]
+ () => buildRetentionBarChartConfig({ isPercentage, goalLines, series, tooltip: INSIGHT_TOOLTIP_CONFIG }),
+ [isPercentage, goalLines, series]
)
if (filteredTrendSeries.length === 0 && hasValidBreakdown) {
diff --git a/products/product_analytics/frontend/insights/retention/RetentionLineChart/RetentionLineChart.tsx b/products/product_analytics/frontend/insights/retention/RetentionLineChart/RetentionLineChart.tsx
index d5d4a3af0550..16259105cf38 100644
--- a/products/product_analytics/frontend/insights/retention/RetentionLineChart/RetentionLineChart.tsx
+++ b/products/product_analytics/frontend/insights/retention/RetentionLineChart/RetentionLineChart.tsx
@@ -6,8 +6,6 @@ import { TimeSeriesLineChart } from '@posthog/quill-charts'
import type { PointClickData, TooltipContext } from '@posthog/quill-charts'
import { useChartConfig, useChartTheme } from 'lib/charts/hooks'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { roundToDecimal } from 'lib/utils/numbers'
import { insightLogic } from 'scenes/insights/insightLogic'
import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
@@ -20,14 +18,13 @@ import type { GroupTypeIndex, LabelGroupType } from '~/types'
import { chartStyleCurve } from '../../shared/chartStyleAdapter'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
-import { INSIGHT_TOOLTIP_CONFIG, INSIGHT_TOOLTIP_CONFIG_LEGACY } from '../../shared/tooltipConfig'
+import { INSIGHT_TOOLTIP_CONFIG } from '../../shared/tooltipConfig'
import {
buildRetentionLineChartConfig,
buildRetentionSeries,
type RetentionSeriesMeta,
type RetentionTrendSeriesEntry,
} from '../shared/retentionChartTransforms'
-import { RetentionTooltip } from '../shared/RetentionTooltip'
interface RetentionLineChartProps {
inSharedMode?: boolean
@@ -56,9 +53,6 @@ function resolveGroupTypeLabel(
export function RetentionLineChart({ inSharedMode = false }: RetentionLineChartProps): JSX.Element | null {
const { insightProps } = useValues(insightLogic)
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
- const TOOLTIP_CONFIG = quillTooltipEnabled ? INSIGHT_TOOLTIP_CONFIG : INSIGHT_TOOLTIP_CONFIG_LEGACY
const theme = useChartTheme()
const {
@@ -110,42 +104,25 @@ export function RetentionLineChart({ inSharedMode = false }: RetentionLineChartP
const renderTooltip = useCallback(
(ctx: TooltipContext<RetentionSeriesMeta>) => {
- if (quillTooltipEnabled) {
- const altTitle =
- selectedInterval !== null
- ? `${period ?? ''} ${selectedInterval}`
- : (xAxisLabels[ctx.dataIndex] ?? ctx.label)
- return (
- <InsightSeriesTooltip
- context={ctx}
- altTitle={altTitle}
- renderCount={(value) =>
- isPercentage ? `${roundToDecimal(value)}%` : `${roundToDecimal(value)}`
- }
- renderSeriesOverride={(datum) => {
- const showCohortPrefix = selectedInterval !== null || !shouldShowMeanPerBreakdown
- return showCohortPrefix ? `Cohort ${datum.label ?? ''}` : (datum.label ?? '')
- }}
- groupTypeLabel={groupTypeLabel}
- onRowClick={canClick ? onRowClick : undefined}
- />
- )
- }
+ const altTitle =
+ selectedInterval !== null
+ ? `${period ?? ''} ${selectedInterval}`
+ : (xAxisLabels[ctx.dataIndex] ?? ctx.label)
return (
- <RetentionTooltip
+ <InsightSeriesTooltip
context={ctx}
- xAxisLabels={xAxisLabels}
- period={period}
- selectedInterval={selectedInterval}
- shouldShowMeanPerBreakdown={shouldShowMeanPerBreakdown}
- isPercentage={isPercentage}
+ altTitle={altTitle}
+ renderCount={(value) => (isPercentage ? `${roundToDecimal(value)}%` : `${roundToDecimal(value)}`)}
+ renderSeriesOverride={(datum) => {
+ const showCohortPrefix = selectedInterval !== null || !shouldShowMeanPerBreakdown
+ return showCohortPrefix ? `Cohort ${datum.label ?? ''}` : (datum.label ?? '')
+ }}
groupTypeLabel={groupTypeLabel}
onRowClick={canClick ? onRowClick : undefined}
/>
)
},
[
- quillTooltipEnabled,
xAxisLabels,
period,
selectedInterval,
@@ -181,11 +158,11 @@ export function RetentionLineChart({ inSharedMode = false }: RetentionLineChartP
goalLines,
showTrendLines,
series,
- tooltip: TOOLTIP_CONFIG,
+ tooltip: INSIGHT_TOOLTIP_CONFIG,
}),
curve: chartStyleCurve(retentionFilter?.chartStyle),
}),
- [isPercentage, goalLines, showTrendLines, series, TOOLTIP_CONFIG, retentionFilter?.chartStyle]
+ [isPercentage, goalLines, showTrendLines, series, retentionFilter?.chartStyle]
)
if (filteredTrendSeries.length === 0 && hasValidBreakdown) {
diff --git a/products/product_analytics/frontend/insights/retention/shared/RetentionTooltip.tsx b/products/product_analytics/frontend/insights/retention/shared/RetentionTooltip.tsx
deleted file mode 100644
index bf1e8c48c74b..000000000000
--- a/products/product_analytics/frontend/insights/retention/shared/RetentionTooltip.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { useCallback, useMemo } from 'react'
-
-import type { TooltipContext } from '@posthog/quill-charts'
-
-import { roundToDecimal } from 'lib/utils/numbers'
-import { InsightTooltip } from 'scenes/insights/InsightTooltip/InsightTooltip'
-import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
-
-import type { RetentionSeriesMeta } from './retentionChartTransforms'
-
-const NOOP = (): void => {}
-
-interface RetentionTooltipProps {
- context: TooltipContext<RetentionSeriesMeta>
- xAxisLabels: string[]
- period?: string
- selectedInterval: number | null
- shouldShowMeanPerBreakdown: boolean
- isPercentage: boolean
- groupTypeLabel?: string
- onRowClick?: (datum: SeriesDatum) => void
-}
-
-export function RetentionTooltip({
- context,
- xAxisLabels,
- period,
- selectedInterval,
- shouldShowMeanPerBreakdown,
- isPercentage,
- groupTypeLabel,
- onRowClick,
-}: RetentionTooltipProps): React.ReactElement {
- const seriesData = useMemo<SeriesDatum[]>(
- () =>
- context.seriesData
- // Each retention series is already its own row (cohort or breakdown value), so the
- // breakdown value is carried by `label`. Don't set `breakdown_value` here — it would
- // flip InsightTooltip into its breakdown-column pivot, which renders one column per
- // series and leaves every other cell as "–".
- .map((entry, idx) => ({
- id: idx,
- dataIndex: context.dataIndex,
- datasetIndex: idx,
- order: entry.series.meta?.rowIndex ?? idx,
- label: entry.series.label,
- color: entry.color,
- count: entry.value,
- }))
- // Show highest values first, matching the legacy LineGraph tooltip.
- .sort((a, b) => b.count - a.count || (a.label ?? '').localeCompare(b.label ?? ''))
- .map((datum, id) => ({ ...datum, id })),
- [context.seriesData, context.dataIndex]
- )
-
- const renderCount = useCallback(
- (value: number): string => (isPercentage ? `${roundToDecimal(value)}%` : `${roundToDecimal(value)}`),
- [isPercentage]
- )
-
- const renderSeries = useCallback(
- (value: React.ReactNode): React.ReactElement => {
- const showCohortPrefix = selectedInterval !== null || !shouldShowMeanPerBreakdown
- return <>{showCohortPrefix ? <>Cohort {value}</> : value}</>
- },
- [selectedInterval, shouldShowMeanPerBreakdown]
- )
-
- const title =
- selectedInterval !== null ? `${period} ${selectedInterval}` : (xAxisLabels[context.dataIndex] ?? context.label)
-
- return (
- <InsightTooltip
- altTitle={title}
- seriesData={seriesData}
- groupTypeLabel={groupTypeLabel}
- onClose={context.onUnpin ?? NOOP}
- renderSeries={renderSeries}
- renderCount={renderCount}
- onRowClick={onRowClick}
- hideInspectActorsSection={!onRowClick}
- />
- )
-}
diff --git a/products/product_analytics/frontend/insights/shared/tooltipConfig.ts b/products/product_analytics/frontend/insights/shared/tooltipConfig.ts
index 2a530a4a754f..3d1af1849e36 100644
--- a/products/product_analytics/frontend/insights/shared/tooltipConfig.ts
+++ b/products/product_analytics/frontend/insights/shared/tooltipConfig.ts
@@ -1,7 +1,4 @@
import type { TooltipConfig } from '@posthog/quill-charts'
-/** Tooltip config for the new unified tooltip (product-analytics-insights-tooltips flag on). */
+/** Shared config for the unified insight tooltip. */
export const INSIGHT_TOOLTIP_CONFIG: TooltipConfig = { pinnable: true, placement: 'cursor' }
-
-/** Legacy tooltip config used when the flag is off. */
-export const INSIGHT_TOOLTIP_CONFIG_LEGACY: TooltipConfig = { pinnable: true, placement: 'top' }
diff --git a/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart.tsx b/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart.tsx
index 8a98cd347b97..b0ac97b441b3 100644
--- a/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart.tsx
+++ b/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart.tsx
@@ -5,8 +5,6 @@ import { TimeSeriesBarChart } from '@posthog/quill-charts'
import type { PointClickData, Series, TimeSeriesBarChartConfig, TooltipContext } from '@posthog/quill-charts'
import { useChartConfig, useChartTheme } from 'lib/charts/hooks'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { InsightEmptyState } from 'scenes/insights/EmptyStates'
import { insightLogic } from 'scenes/insights/insightLogic'
import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
@@ -23,7 +21,6 @@ import { QueryContext } from '~/queries/types'
import { ChartDisplayType } from '~/types'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
-import { INSIGHT_TOOLTIP_CONFIG_LEGACY } from '../../shared/tooltipConfig'
import { makeChartErrorHandler } from '../../trends/shared/chartErrorHandler'
import { getTrendsSeriesDisplayLabel } from '../../trends/shared/getTrendsSeriesDisplayLabel'
import {
@@ -31,7 +28,6 @@ import {
resolveGroupTypeLabel,
type TrendsSeriesMeta,
} from '../../trends/shared/trendsSeriesMeta'
-import { TrendsTooltip } from '../../trends/shared/TrendsTooltip'
import { useInsightsLegendConfig } from '../../trends/shared/useInsightsLegendConfig'
import { handleStickinessChartClick } from '../StickinessLineChart/handleStickinessChartClick'
import {
@@ -51,9 +47,7 @@ const handleChartError = makeChartErrorHandler('stickiness-bar-chart')
export function StickinessBarChart({ context }: StickinessBarChartProps): JSX.Element | null {
const theme = useChartTheme()
const { insightProps } = useValues(insightLogic)
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
- const tooltipConfig = quillTooltipEnabled ? STICKINESS_TOOLTIP_CONFIG : INSIGHT_TOOLTIP_CONFIG_LEGACY
+ const tooltipConfig = STICKINESS_TOOLTIP_CONFIG
const legendConfig = useInsightsLegendConfig({ insightProps })
const quillLegendEnabled = !!legendConfig
@@ -68,7 +62,6 @@ export function StickinessBarChart({ context }: StickinessBarChartProps): JSX.El
currentPeriodResult,
breakdownFilter,
trendsFilter,
- formula,
labelGroupType,
hasPersonsModal,
querySource,
@@ -176,21 +169,19 @@ export function StickinessBarChart({ context }: StickinessBarChartProps): JSX.El
onRowClick,
altTitle,
}
- return quillTooltipEnabled ? <InsightSeriesTooltip {...sharedProps} /> : <TrendsTooltip {...sharedProps} />
+ return <InsightSeriesTooltip {...sharedProps} />
},
[
timezone,
interval,
breakdownFilter,
trendsFilter,
- formula,
baseCurrency,
resolvedGroupTypeLabel,
formatCompareLabel,
hasClickHandler,
clickDeps,
altTitle,
- quillTooltipEnabled,
]
)
diff --git a/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart.tsx b/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart.tsx
index 397f463549e7..a9006ff3e400 100644
--- a/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart.tsx
+++ b/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart.tsx
@@ -5,8 +5,6 @@ import { TimeSeriesLineChart } from '@posthog/quill-charts'
import type { PointClickData, Series, TimeSeriesLineChartConfig, TooltipContext } from '@posthog/quill-charts'
import { useChartConfig, useChartTheme } from 'lib/charts/hooks'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { InsightEmptyState } from 'scenes/insights/EmptyStates'
import { insightLogic } from 'scenes/insights/insightLogic'
import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
@@ -23,7 +21,6 @@ import { QueryContext } from '~/queries/types'
import { chartStyleCurve } from '../../shared/chartStyleAdapter'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
-import { INSIGHT_TOOLTIP_CONFIG_LEGACY } from '../../shared/tooltipConfig'
import { makeChartErrorHandler } from '../../trends/shared/chartErrorHandler'
import { getTrendsSeriesDisplayLabel } from '../../trends/shared/getTrendsSeriesDisplayLabel'
import {
@@ -31,7 +28,6 @@ import {
resolveGroupTypeLabel,
type TrendsSeriesMeta,
} from '../../trends/shared/trendsSeriesMeta'
-import { TrendsTooltip } from '../../trends/shared/TrendsTooltip'
import { useInsightsLegendConfig } from '../../trends/shared/useInsightsLegendConfig'
import { handleStickinessChartClick } from './handleStickinessChartClick'
import {
@@ -52,9 +48,7 @@ const handleChartError = makeChartErrorHandler('stickiness-line-chart')
export function StickinessLineChart({ context }: StickinessLineChartProps): JSX.Element | null {
const theme = useChartTheme()
const { insightProps } = useValues(insightLogic)
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
- const tooltipConfig = quillTooltipEnabled ? STICKINESS_TOOLTIP_CONFIG : INSIGHT_TOOLTIP_CONFIG_LEGACY
+ const tooltipConfig = STICKINESS_TOOLTIP_CONFIG
const legendConfig = useInsightsLegendConfig({ insightProps })
const quillLegendEnabled = !!legendConfig
@@ -71,7 +65,6 @@ export function StickinessLineChart({ context }: StickinessLineChartProps): JSX.
breakdownFilter,
trendsFilter,
stickinessFilter,
- formula,
labelGroupType,
hasPersonsModal,
querySource,
@@ -177,21 +170,19 @@ export function StickinessLineChart({ context }: StickinessLineChartProps): JSX.
onRowClick,
altTitle,
}
- return quillTooltipEnabled ? <InsightSeriesTooltip {...sharedProps} /> : <TrendsTooltip {...sharedProps} />
+ return <InsightSeriesTooltip {...sharedProps} />
},
[
timezone,
interval,
breakdownFilter,
trendsFilter,
- formula,
baseCurrency,
resolvedGroupTypeLabel,
context?.formatCompareLabel,
canHandleClick,
clickDeps,
altTitle,
- quillTooltipEnabled,
]
)
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 6bf479181e8c..ff08bb4b4365 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.test.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.test.tsx
@@ -433,70 +433,6 @@ describe('TrendsBarChart (ActionsBarValue)', () => {
expect(rowText).toContain('Spike')
expect(rowText).toContain('11')
})
-
- it('keeps the previous-period identifier glyph opaque while dimming only the row ribbon', async () => {
- // Give the previous period the larger aggregated_value so it sorts topmost (DESC) and is the
- // bar hovered at plotTop. Its series color arrives pre-dimmed (rgba .5); the ribbon should keep
- // that dim to mark the period, but the SeriesLetter glyph must render at full opacity.
- const action = { id: '$pageview', type: 'events', name: '$pageview', order: 0 }
- const compareResults = {
- results: [
- {
- action,
- label: '$pageview',
- count: 50,
- aggregated_value: 50,
- data: [50],
- labels: ['Day 1'],
- days: ['2024-06-10'],
- compare: true,
- compare_label: 'current',
- },
- {
- action,
- label: '$pageview',
- count: 500,
- aggregated_value: 500,
- data: [500],
- labels: ['Day 1'],
- days: ['2024-06-03'],
- compare: true,
- compare_label: 'previous',
- },
- ],
- }
- renderInsight({
- query: aggregatedBar({ compareFilter: { compare: true } }),
- // Pin to the legacy InsightTooltip path — the glyph/ribbon assertions are specific
- // to that rendering and will get a quill-flavoured equivalent when the flag ships.
- featureFlags: { [FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]: false },
- mocks: {
- additionalMockResponses: [{ match: (q) => q.kind === NodeKind.TrendsQuery, response: compareResults }],
- },
- })
- const canvas = await screen.findByLabelText(/chart with/i, undefined, { timeout: 5000 })
- const wrapper = canvas.parentElement!
- // Topmost band is the previous period (largest aggregated_value, sorted DESC). Aim at the
- // band centre — the bar's hittable region sits inside the band's padding.
- const previousBandY = dimensions.plotTop + dimensions.plotHeight / 4
-
- // Re-fire the hover each tick until the chart commits its scales and the tooltip populates —
- // a single mouseMove before the chart settles is silently dropped.
- await waitFor(
- () => {
- fireEvent.mouseMove(wrapper, { clientX: dimensions.plotLeft + 30, clientY: previousBandY })
- const glyph = chart.getTooltip()?.querySelector<HTMLElement>('.graph-series-glyph')
- expect(glyph).toBeTruthy()
- // The identifier glyph stays opaque — no alpha channel bled in from the dimmed color.
- expect(glyph!.style.color).not.toMatch(/rgba/)
- expect(glyph!.style.borderColor).not.toMatch(/rgba/)
- // The left ribbon still carries the half-opacity previous-period color.
- const ribbon = glyph!.closest('tr')!.style.getPropertyValue('--row-ribbon-color')
- expect(ribbon).toMatch(/rgba\([^)]*0?\.5\)/)
- },
- { timeout: 8000 }
- )
- }, 12000)
})
describe('TrendsBarChart (ActionsUnstackedBar)', () => {
diff --git a/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx
index dbaf3274f42b..51d4fd9b7b79 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx
@@ -13,8 +13,6 @@ import {
import type { BarChartConfig, PointClickData, TimeSeriesBarChartConfig, TooltipContext } from '@posthog/quill-charts'
import { useChartTheme, useChartConfig, useDateRangeZoom } from 'lib/charts/hooks'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { percentage } from 'lib/utils/numbers'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { InsightEmptyState } from 'scenes/insights/EmptyStates'
@@ -34,7 +32,7 @@ import { getStackBreakdownValues } from '~/queries/utils'
import { ChartDisplayType } from '~/types'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
-import { INSIGHT_TOOLTIP_CONFIG, INSIGHT_TOOLTIP_CONFIG_LEGACY } from '../../shared/tooltipConfig'
+import { INSIGHT_TOOLTIP_CONFIG } from '../../shared/tooltipConfig'
import { AnnotationsLayer } from '../shared/AnnotationsLayer'
import { makeChartErrorHandler } from '../shared/chartErrorHandler'
import { getTrendsSeriesDisplayLabel } from '../shared/getTrendsSeriesDisplayLabel'
@@ -43,7 +41,6 @@ import { handleTrendsChartClick, type TrendsChartClickDeps } from '../shared/han
import { TrendsAlertOverlays } from '../shared/TrendsAlertOverlays'
import { trendsFilterToYFormatterConfig } from '../shared/trendsAxisFormat'
import { buildTrendsSeriesMeta, type TrendsSeriesMeta } from '../shared/trendsSeriesMeta'
-import { TrendsTooltip } from '../shared/TrendsTooltip'
import { useInsightsLegendConfig } from '../shared/useInsightsLegendConfig'
import { getAggregatedDisplayLabel as getAggregatedDisplayLabelFn } from './getAggregatedDisplayLabel'
import { handleTrendsBarAggregatedChartClick } from './handleTrendsBarAggregatedChartClick'
@@ -91,9 +88,6 @@ export function TrendsBarChart({
embedded = false,
}: TrendsBarChartProps): JSX.Element | null {
const theme = useChartTheme()
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
- const TIME_SERIES_TOOLTIP_CONFIG = quillTooltipEnabled ? INSIGHT_TOOLTIP_CONFIG : INSIGHT_TOOLTIP_CONFIG_LEGACY
const { insightProps, insight } = useValues(insightLogic)
// Time-series bars (vertical) render the in-chart legend; the aggregated bar-value layout has
@@ -111,7 +105,6 @@ export function TrendsBarChart({
breakdownFilter,
insightData,
trendsFilter,
- formula,
isStickiness,
labelGroupType,
hasPersonsModal,
@@ -232,7 +225,7 @@ export function TrendsBarChart({
yAxisLabel: trendsFilter?.yAxisLabel,
goalLines,
valueLabels: showValuesOnSeries ? { formatter: valueLabelFormatter } : false,
- tooltip: TIME_SERIES_TOOLTIP_CONFIG,
+ tooltip: INSIGHT_TOOLTIP_CONFIG,
}),
// Interactive legend (toggle callbacks, context menu) is a component concern, kept out
// of the pure transform so the builder stays free of React state.
@@ -253,7 +246,6 @@ export function TrendsBarChart({
showValuesOnSeries,
valueLabelFormatter,
legendConfig,
- TIME_SERIES_TOOLTIP_CONFIG,
]
)
@@ -400,11 +392,7 @@ export function TrendsBarChart({
showHeader: isAggregated ? (false as const) : undefined,
sortedByValue: false,
}
- return quillTooltipEnabled ? (
- <InsightSeriesTooltip {...sharedProps} />
- ) : (
- <TrendsTooltip {...sharedProps} formula={formula} />
- )
+ return <InsightSeriesTooltip {...sharedProps} />
},
[
timezone,
@@ -412,7 +400,6 @@ export function TrendsBarChart({
breakdownFilter,
insightData?.resolved_date_range,
trendsFilter,
- formula,
isStickiness,
isPercentStackView,
baseCurrency,
@@ -421,7 +408,6 @@ export function TrendsBarChart({
canHandleClick,
clickDeps,
isAggregated,
- quillTooltipEnabled,
]
)
diff --git a/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx
index 21c5fe28ff05..3f014d558e45 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart.tsx
@@ -6,8 +6,6 @@ import type { ChartLegendConfig, PointClickData, TooltipContext } from '@posthog
import { useChartConfig, useChartTheme, useDateRangeZoom } from 'lib/charts/hooks'
import { getBarColorFromStatus } from 'lib/colors'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { InsightEmptyState } from 'scenes/insights/EmptyStates'
import { insightLogic } from 'scenes/insights/insightLogic'
@@ -31,7 +29,6 @@ import {
type TrendsChartClickDeps,
} from '../shared/handleTrendsChartClick'
import { buildTrendsSeriesMeta, type TrendsSeriesMeta } from '../shared/trendsSeriesMeta'
-import { TrendsTooltip } from '../shared/TrendsTooltip'
import { buildLifecycleChartModel, buildLifecycleValueLabelFormatter } from './trendsLifecycleChartTransforms'
interface TrendsLifecycleChartProps {
@@ -41,7 +38,6 @@ interface TrendsLifecycleChartProps {
const EMPTY_LABELS: string[] = []
const LIFECYCLE_TOOLTIP_CONFIG = { placement: 'cursor' as const }
-const LIFECYCLE_TOOLTIP_CONFIG_LEGACY = { pinnable: true, placement: 'top' as const }
const handleChartError = makeChartErrorHandler('trends-lifecycle-chart')
@@ -53,8 +49,6 @@ const renderLifecycleSeriesLabel = (datum: SeriesDatum): React.ReactNode => datu
export function TrendsLifecycleChart({ context, inSharedMode = false }: TrendsLifecycleChartProps): JSX.Element | null {
const theme = useChartTheme()
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
const { insightProps, insight, canEditInsight } = useValues(insightLogic)
const {
@@ -127,7 +121,7 @@ export function TrendsLifecycleChart({ context, inSharedMode = false }: TrendsLi
timezone,
allDays: currentPeriodResult?.days ?? [],
valueLabels: showValuesOnSeries || showPercentagesOnSeries ? { formatter: valueLabelFormatter } : false,
- tooltip: quillTooltipEnabled ? LIFECYCLE_TOOLTIP_CONFIG : LIFECYCLE_TOOLTIP_CONFIG_LEGACY,
+ tooltip: LIFECYCLE_TOOLTIP_CONFIG,
legend: legendConfig,
}),
[
@@ -144,7 +138,6 @@ export function TrendsLifecycleChart({ context, inSharedMode = false }: TrendsLi
showPercentagesOnSeries,
valueLabelFormatter,
legendConfig,
- quillTooltipEnabled,
]
)
const config = useChartConfig(() => baseConfig, [baseConfig])
@@ -210,11 +203,7 @@ export function TrendsLifecycleChart({ context, inSharedMode = false }: TrendsLi
handleTrendsChartClick(seriesKey, datum.dataIndex, clickDeps, LIFECYCLE_PERSONS_MODAL_OPTIONS)
}
: undefined
- return quillTooltipEnabled ? (
- <InsightSeriesTooltip {...sharedProps} sortedByValue={false} hideZeroRows onRowClick={onRowClick} />
- ) : (
- <TrendsTooltip {...sharedProps} onRowClick={onRowClick} />
- )
+ return <InsightSeriesTooltip {...sharedProps} sortedByValue={false} hideZeroRows onRowClick={onRowClick} />
},
[
timezone,
@@ -225,7 +214,6 @@ export function TrendsLifecycleChart({ context, inSharedMode = false }: TrendsLi
formula,
baseCurrency,
renderTooltipCount,
- quillTooltipEnabled,
canHandleClick,
clickDeps,
]
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 78ec287047bf..d962cf695552 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
@@ -292,18 +292,6 @@ describe('TrendsLineChart', () => {
expect(tooltip.title()).toMatch(/Wednesday/i)
expect(tooltip.title()).toMatch(/12.+Jun/)
})
-
- it('keeps the weekday in the quill tooltip (PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS on)', async () => {
- renderInsight({
- query: buildTrendsQuery({ interval: 'day' }),
- featureFlags: { [FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]: true },
- })
-
- const tooltip = await chart.hoverTooltip(2)
-
- expect(tooltip.title()).toMatch(/Wednesday/i)
- expect(tooltip.title()).toMatch(/12.+Jun/)
- })
})
describe('alert overlays', () => {
diff --git a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
index 07f4c342d8ad..4ba5e5550b51 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx
@@ -5,8 +5,6 @@ import { DEFAULT_Y_AXIS_ID, TimeSeriesLineChart } from '@posthog/quill-charts'
import type { PointClickData, TooltipContext } from '@posthog/quill-charts'
import { useChartTheme, useChartConfig, useDateRangeZoom } from 'lib/charts/hooks'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { ciRanges } from 'lib/statistics'
import { percentage } from 'lib/utils/numbers'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
@@ -27,14 +25,13 @@ import { ChartDisplayType } from '~/types'
import { chartStyleCurve } from '../../shared/chartStyleAdapter'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
-import { INSIGHT_TOOLTIP_CONFIG, INSIGHT_TOOLTIP_CONFIG_LEGACY } from '../../shared/tooltipConfig'
+import { INSIGHT_TOOLTIP_CONFIG } from '../../shared/tooltipConfig'
import { AnnotationsLayer } from '../shared/AnnotationsLayer'
import { makeChartErrorHandler } from '../shared/chartErrorHandler'
import { getTrendsSeriesDisplayLabel } from '../shared/getTrendsSeriesDisplayLabel'
import { handleTrendsChartClick } from '../shared/handleTrendsChartClick'
import { TrendsAlertOverlays } from '../shared/TrendsAlertOverlays'
import { buildTrendsSeriesMeta, resolveGroupTypeLabel, type TrendsSeriesMeta } from '../shared/trendsSeriesMeta'
-import { TrendsTooltip as TrendsTooltipLegacy } from '../shared/TrendsTooltip'
import { useInsightsLegendConfig } from '../shared/useInsightsLegendConfig'
import { buildTrendsLineTimeSeriesConfig, buildTrendsSeries } from './trendsChartTransforms'
@@ -46,9 +43,6 @@ interface TrendsLineChartProps {
const handleChartError = makeChartErrorHandler('trends-line-chart')
export function TrendsLineChart({ context, inSharedMode = false }: TrendsLineChartProps): JSX.Element | null {
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
- const TOOLTIP_CONFIG = quillTooltipEnabled ? INSIGHT_TOOLTIP_CONFIG : INSIGHT_TOOLTIP_CONFIG_LEGACY
const theme = useChartTheme()
const { insightProps, insight } = useValues(insightLogic)
@@ -192,11 +186,7 @@ export function TrendsLineChart({ context, inSharedMode = false }: TrendsLineCha
formatCompareLabel: context?.formatCompareLabel,
onRowClick,
}
- return quillTooltipEnabled ? (
- <InsightSeriesTooltip {...tooltipProps} />
- ) : (
- <TrendsTooltipLegacy {...tooltipProps} />
- )
+ return <InsightSeriesTooltip {...tooltipProps} />
},
[
timezone,
@@ -212,7 +202,6 @@ export function TrendsLineChart({ context, inSharedMode = false }: TrendsLineCha
context?.formatCompareLabel,
canHandleClick,
clickDeps,
- quillTooltipEnabled,
]
)
@@ -270,7 +259,7 @@ export function TrendsLineChart({ context, inSharedMode = false }: TrendsLineCha
valueLabels: showValuesOnSeries && valueLabelFormatter ? { formatter: valueLabelFormatter } : false,
curve: chartStyleCurve(trendsFilter?.chartStyle),
showCrosshair: true,
- tooltip: TOOLTIP_CONFIG,
+ tooltip: INSIGHT_TOOLTIP_CONFIG,
legend: legendConfig,
}),
[
@@ -295,7 +284,6 @@ export function TrendsLineChart({ context, inSharedMode = false }: TrendsLineCha
showValuesOnSeries,
valueLabelFormatter,
legendConfig,
- TOOLTIP_CONFIG,
]
)
diff --git a/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart.tsx
index f95a062f1b14..4db4fc9e9d5e 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart.tsx
@@ -6,8 +6,6 @@ import { PieChart } from '@posthog/quill-charts'
import type { PieChartConfig, RadialSlicePayload, Series, TooltipContext } from '@posthog/quill-charts'
import { useChartTheme } from 'lib/charts/hooks'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import {
formatAggregationAxisValue,
formatAggregationAxisValueWithShareOfTotal,
@@ -30,7 +28,6 @@ import { QueryContext } from '~/queries/types'
import { InsightSeriesTooltip } from '../../shared/InsightSeriesTooltip'
import type { TrendsSeriesMeta } from '../shared/trendsSeriesMeta'
-import { TrendsTooltip } from '../shared/TrendsTooltip'
import { buildTrendsPieSeries } from './trendsPieTransforms'
interface TrendsPieChartProps {
@@ -47,8 +44,6 @@ const handleChartError = (error: Error, info: ErrorInfo): void => {
}
export function TrendsPieChart({ context, showPersonsModal = true }: TrendsPieChartProps): JSX.Element | null {
- const { featureFlags } = useValues(featureFlagLogic)
- const quillTooltipEnabled = !!featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_INSIGHTS_TOOLTIPS]
const theme = useChartTheme()
const { insightProps } = useValues(insightLogic)
@@ -218,22 +213,16 @@ export function TrendsPieChart({ context, showPersonsModal = true }: TrendsPieCh
showHeader: false as const,
renderCount,
}
- return quillTooltipEnabled ? (
- <InsightSeriesTooltip {...sharedProps} />
- ) : (
- <TrendsTooltip {...sharedProps} formula={formula} />
- )
+ return <InsightSeriesTooltip {...sharedProps} />
},
[
breakdownFilter,
trendsFilter,
- formula,
baseCurrency,
resolvedGroupTypeLabel,
context?.formatCompareLabel,
onRowClick,
renderCount,
- quillTooltipEnabled,
]
)