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.

feat(experiments): add breakdown attribution UI (#84861)

Rodrigo Iloroc52da44dd426
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 6605f7f55363..50601b8401b6 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -322,6 +322,7 @@ export const FEATURE_FLAGS = {
EVENT_MEDIA_PREVIEWS: 'event-media-previews', // owner: @alexlider
EXPERIMENT_BEHAVIOR_COMPARISON: 'experiment-behavior-comparison', // owner: @mp-hog #team-experiments
EXPERIMENT_FLAG_CLEANUP_PR: 'experiment-flag-cleanup-pr', // owner: @jurajmajerik #team-experiments
+ EXPERIMENT_METRIC_EVENT_BREAKDOWNS: 'experiment-metric-event-breakdowns', // owner: @rodrigoi #team-experiments
EXPERIMENT_RECORDINGS_TAB: 'experiment-recordings-tab', // owner: @mp-hog #team-experiments
EXPERIMENT_SESSION_REPLAYS_SKILL: 'experiment-session-replays-skill', // owner: @rodrigoi #team-experiments
EXPERIMENTS_DW_AA_TEST: 'experiments-dw-aa-test', // owner: @rodrigoi #team-experiments
diff --git a/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownAttribution.tsx b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownAttribution.tsx
new file mode 100644
index 000000000000..0c557c9548a4
--- /dev/null
+++ b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownAttribution.tsx
@@ -0,0 +1,72 @@
+import { LemonSelect } from '@posthog/lemon-ui'
+
+import { FUNNEL_STEP_COUNT_LIMIT } from 'scenes/insights/EditorFilters/FunnelsQuerySteps'
+
+import { ExperimentFunnelMetric } from '~/queries/schema/schema-general'
+import { BreakdownAttributionType, StepOrderValue } from '~/types'
+
+export function MetricBreakdownAttribution({
+ metric,
+ onChange,
+}: {
+ metric: ExperimentFunnelMetric
+ onChange: (attributionType: BreakdownAttributionType, attributionValue?: number) => void
+}): JSX.Element {
+ const { funnel_order_type } = metric
+ const stepCount = metric.series?.length || 0
+
+ /**
+ * hardcoded for now, this have to be configured at the metric level.
+ */
+ const breakdownAttributionType = BreakdownAttributionType.FirstTouch
+ const breakdownAttributionValue = 0
+
+ return (
+ <LemonSelect
+ size="small"
+ value={breakdownAttributionType}
+ placeholder="Attribution"
+ options={[
+ { value: BreakdownAttributionType.FirstTouch, label: 'First touchpoint' },
+ { value: BreakdownAttributionType.LastTouch, label: 'Last touchpoint' },
+ { value: BreakdownAttributionType.AllSteps, label: 'All steps' },
+ {
+ value: BreakdownAttributionType.Step,
+ label: 'Any step',
+ hidden: funnel_order_type !== StepOrderValue.UNORDERED,
+ },
+ {
+ label: 'Specific step',
+ options: Array(FUNNEL_STEP_COUNT_LIMIT)
+ .fill(null)
+ .map((_, stepIndex) => ({
+ value: `${BreakdownAttributionType.Step}/${stepIndex}`,
+ label: `Step ${stepIndex + 1}`,
+ /**
+ * if the funnel was shortened, an our of range stale selection gets hidden.
+ * this guard keeps it visible
+ */
+ hidden: stepIndex >= stepCount && stepIndex !== breakdownAttributionValue,
+ })),
+ hidden: funnel_order_type === StepOrderValue.UNORDERED,
+ },
+ ]}
+ onChange={(value) => {
+ if (!value) {
+ return
+ }
+ const [attributionType, attributionValue] = value.split('/')
+ /**
+ * the backend requires a breakdown attribution value for step attribution,
+ * so "Any step" stores zero.
+ */
+ onChange(
+ attributionType as BreakdownAttributionType,
+ attributionType === BreakdownAttributionType.Step ? parseInt(attributionValue) || 0 : undefined
+ )
+ }}
+ dropdownMaxContentWidth
+ data-attr="experiment-breakdown-attribution"
+ />
+ )
+}
diff --git a/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownError.tsx b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownError.tsx
new file mode 100644
index 000000000000..6644ae11d2f6
--- /dev/null
+++ b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownError.tsx
@@ -0,0 +1,35 @@
+import { ExperimentMetric } from '~/queries/schema/schema-general'
+import { BreakdownAttributionType } from '~/types'
+
+import { MetricBreakdowns } from './MetricBreakdowns'
+
+export type MetricBreakdownErrorProps = {
+ metric: ExperimentMetric
+ isAlternatingRow: boolean
+ onRemoveBreakdown: (index: number) => void
+ onAttributionChange: (attributionType: BreakdownAttributionType, attributionValue?: number) => void
+ onBreakdownLimitChange: (breakdownLimit: number) => void
+}
+
+export function MetricBreakdownError({
+ metric,
+ isAlternatingRow,
+ onRemoveBreakdown,
+ onAttributionChange,
+ onBreakdownLimitChange,
+}: MetricBreakdownErrorProps): JSX.Element {
+ return (
+ <tr data-breakdown-row className="hover:bg-bg-hover group">
+ <td colSpan={7} className={`p-0 border-t border-b ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}>
+ <div className="p-1">
+ <MetricBreakdowns
+ metric={metric}
+ onRemoveBreakdown={onRemoveBreakdown}
+ onAttributionChange={onAttributionChange}
+ onBreakdownLimitChange={onBreakdownLimitChange}
+ />
+ </div>
+ </td>
+ </tr>
+ )
+}
diff --git a/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownLimit.tsx b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownLimit.tsx
new file mode 100644
index 000000000000..a2c2de5c62ff
--- /dev/null
+++ b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownLimit.tsx
@@ -0,0 +1,69 @@
+import { IconInfo } from '@posthog/icons'
+import { LemonSelect } from '@posthog/lemon-ui'
+
+import { Tooltip } from 'lib/lemon-ui/Tooltip'
+
+import { ExperimentMetric } from '~/queries/schema/schema-general'
+
+const DEFAULT_BREAKDOWN_LIMIT = 25
+/**
+ * The backend has no unlimited option, so "Show all" is just a large top-N that covers any
+ * realistic breakdown cardinality.
+ */
+const SHOW_ALL_BREAKDOWN_LIMIT = 1000
+
+const BREAKDOWN_LIMIT_OPTIONS = [
+ { value: 5, label: '5' },
+ { value: 10, label: '10' },
+ { value: 15, label: '15' },
+ { value: 20, label: '20' },
+ { value: 25, label: '25' },
+ { value: SHOW_ALL_BREAKDOWN_LIMIT, label: 'Show all' },
+]
+
+export function MetricBreakdownLimit({
+ metric,
+ onChange,
+}: {
+ metric: ExperimentMetric
+ onChange: (breakdownLimit: number) => void
+}): JSX.Element {
+ const breakdownLimit = metric.breakdownFilter?.breakdown_limit ?? DEFAULT_BREAKDOWN_LIMIT
+
+ /**
+ * This is a protection against manual edits of the metric breakdown limit, in case
+ * a limit is set that does not map to a preset.
+ */
+ const options = BREAKDOWN_LIMIT_OPTIONS.some(({ value }) => value === breakdownLimit)
+ ? BREAKDOWN_LIMIT_OPTIONS
+ : [{ value: breakdownLimit, label: String(breakdownLimit) }, ...BREAKDOWN_LIMIT_OPTIONS]
+
+ return (
+ <div className="flex items-center gap-1">
+ <span className="text-muted">Limit</span>
+ <Tooltip
+ title={
+ <>
+ Keeps only the top breakdown values by frequency. The remaining values are grouped together
+ under "Other". This caps how many breakdown rows the results show. "Show all" raises the cap
+ high enough to cover any realistic number of values.
+ </>
+ }
+ >
+ <IconInfo className="text-secondary text-base shrink-0" />
+ </Tooltip>
+ <LemonSelect
+ size="small"
+ value={breakdownLimit}
+ options={options}
+ onChange={(value) => {
+ if (value != null && value !== breakdownLimit) {
+ onChange(value)
+ }
+ }}
+ dropdownMatchSelectWidth={false}
+ data-attr="experiment-breakdown-limit"
+ />
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdowns.tsx b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdowns.tsx
new file mode 100644
index 000000000000..a36fd8683b5d
--- /dev/null
+++ b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdowns.tsx
@@ -0,0 +1,100 @@
+import { IconInfo } from '@posthog/icons'
+
+import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
+import { Tooltip } from 'lib/lemon-ui/Tooltip'
+import { BreakdownTag } from 'scenes/insights/filters/BreakdownFilter/BreakdownTag'
+
+import { ExperimentFunnelMetric, ExperimentMetric } from '~/queries/schema/schema-general'
+import { isExperimentFunnelMetric } from '~/queries/schema/schema-general'
+import { BreakdownAttributionType, StepOrderValue } from '~/types'
+
+import { MetricBreakdownAttribution } from './MetricBreakdownAttribution'
+import { MetricBreakdownLimit } from './MetricBreakdownLimit'
+
+/**
+ * Renders the metric's breakdown chips on the left, then (behind the
+ * metric-event-breakdowns flag) the funnel attribution dropdown and the
+ * breakdown limit. Attribution is funnel-only; the limit applies to all types.
+ */
+export function MetricBreakdowns({
+ metric,
+ onRemoveBreakdown,
+ onAttributionChange,
+ onBreakdownLimitChange,
+}: {
+ metric: ExperimentMetric
+ onRemoveBreakdown: (index: number) => void
+ onAttributionChange: (attributionType: BreakdownAttributionType, attributionValue?: number) => void
+ onBreakdownLimitChange: (breakdownLimit: number) => void
+}): JSX.Element {
+ /**
+ * on the frontend, this flag controls whether we show the attribution and limit settings.
+ * these settings are available only for funnels
+ */
+ const metricEventBreakdownsEnabled = useFeatureFlag('EXPERIMENT_METRIC_EVENT_BREAKDOWNS')
+
+ /**
+ * this should collapse into isExperimentFunnelMetric(metric) once enabled
+ */
+ const showAttribution = metricEventBreakdownsEnabled && isExperimentFunnelMetric(metric)
+ /**
+ * all metric tipes will have a breakdown limit
+ */
+ const showLimit = metricEventBreakdownsEnabled
+
+ return (
+ <div className="flex items-center gap-3">
+ <div className="flex items-center gap-2">
+ {metric.breakdownFilter?.breakdowns?.map((breakdown, index) => (
+ <BreakdownTag
+ key={index}
+ breakdown={breakdown.property}
+ breakdownType={breakdown.type || 'event'}
+ onClose={() => onRemoveBreakdown(index)}
+ size="small"
+ />
+ ))}
+ </div>
+ {showAttribution && (
+ <div className="flex items-center gap-1">
+ <span className="text-muted">Attribution</span>
+ <Tooltip
+ title={
+ <>
+ Which funnel step the breakdown value is read from for each user:
+ <ul className="list-disc pl-4">
+ <li>
+ <strong>First touchpoint</strong>: the first property value seen in any step
+ </li>
+ <li>
+ <strong>Last touchpoint</strong>: the last property value seen across all steps
+ </li>
+ <li>
+ <strong>All steps</strong>: The property value must appear on all steps
+ </li>
+ {(metric as ExperimentFunnelMetric).funnel_order_type ===
+ StepOrderValue.UNORDERED ? (
+ <li>
+ <strong>Any step</strong>: value at any matching step
+ </li>
+ ) : (
+ <li>
+ <strong>Specific step</strong>: value at a step you choose
+ </li>
+ )}
+ </ul>
+ </>
+ }
+ >
+ <IconInfo className="text-secondary text-base shrink-0" />
+ </Tooltip>
+ <MetricBreakdownAttribution
+ metric={metric as ExperimentFunnelMetric}
+ onChange={onAttributionChange}
+ />
+ </div>
+ )}
+ {showLimit && <MetricBreakdownLimit metric={metric} onChange={onBreakdownLimitChange} />}
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx b/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx
index 4e684fb80698..761ca28f0e9e 100644
--- a/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx
+++ b/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx
@@ -14,7 +14,8 @@ import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { humanFriendlyLargeNumber } from 'lib/utils/numbers'
import { VariantTag } from 'scenes/experiments/ExperimentView/VariantTag'
-import { BreakdownTag } from 'scenes/insights/filters/BreakdownFilter/BreakdownTag'
+import { MetricBreakdownError } from 'scenes/experiments/MetricBreakdowns/MetricBreakdownError'
+import { MetricBreakdowns } from 'scenes/experiments/MetricBreakdowns/MetricBreakdowns'
import { formatBreakdownLabel } from 'scenes/insights/utils'
import {
@@ -73,34 +74,6 @@ import { renderTooltipContent } from './MetricRowGroupTooltip'
import { TimeseriesModal } from './TimeseriesModal'
import { useAxisScale } from './useAxisScale'
-interface BreakdownErrorStateProps {
- metric: ExperimentMetric
- isAlternatingRow: boolean
- onRemoveBreakdown: (index: number) => void
-}
-
-function BreakdownErrorState({ metric, isAlternatingRow, onRemoveBreakdown }: BreakdownErrorStateProps): JSX.Element {
- return (
- <tr data-breakdown-row className="hover:bg-bg-hover group">
- <td colSpan={7} className={`p-0 border-t border-b ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}>
- <div className="p-1">
- <div className="flex items-center gap-2">
- {metric.breakdownFilter?.breakdowns?.map((breakdown, index) => (
- <BreakdownTag
- key={index}
- breakdown={breakdown.property}
- breakdownType={breakdown.type || 'event'}
- onClose={() => onRemoveBreakdown(index)}
- size="small"
- />
- ))}
- </div>
- </div>
- </td>
- </tr>
- )
-}
-
interface CollapsibleBreakdownSectionProps {
breakdownResults: any[]
metric: ExperimentMetric
@@ -192,16 +165,13 @@ function CollapsibleBreakdownSection({
{
key: 'breakdowns',
header: (
- <div className="flex items-center gap-2">
- {metric.breakdownFilter?.breakdowns?.map((breakdown, index) => (
- <BreakdownTag
- key={index}
- breakdown={breakdown.property}
- breakdownType={breakdown.type || 'event'}
- onClose={() => onRemoveBreakdown(index)}
- size="small"
- />
- ))}
+ <div onClick={(e) => e.stopPropagation()}>
+ <MetricBreakdowns
+ metric={metric}
+ onRemoveBreakdown={onRemoveBreakdown}
+ onAttributionChange={() => {}}
+ onBreakdownLimitChange={() => {}}
+ />
</div>
),
// Render no content (non-expandable disabled header) when recalculating (stale
@@ -221,6 +191,7 @@ function CollapsibleBreakdownSection({
<tr
key={breakdownResult.breakdown_value}
className="hover:bg-bg-hover"
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<td
@@ -238,6 +209,7 @@ function CollapsibleBreakdownSection({
<td
colSpan={6}
className={`p-3 text-center ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
{isLoading || exposuresLoading ? (
@@ -266,11 +238,13 @@ function CollapsibleBreakdownSection({
{/* Baseline row */}
<tr
className="hover:bg-bg-hover"
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<td
className={`w-1/5 border-r p-3 align-top border-b ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'} text-xs`}
rowSpan={totalRows}
+ // eslint-disable-next-line react/forbid-dom-props
style={totalRowsHeightStyle}
>
{formatBreakdownLabel(
@@ -285,6 +259,7 @@ function CollapsibleBreakdownSection({
<td
className={`w-20 pt-1 pl-3 pr-3 pb-1 whitespace-nowrap overflow-hidden ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<VariantTag variantKey={baselineResult.key} />
@@ -292,6 +267,7 @@ function CollapsibleBreakdownSection({
<td
className={`w-24 pt-1 pl-3 pr-3 pb-1 text-left whitespace-nowrap overflow-hidden ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<div className="metric-cell">
@@ -304,6 +280,7 @@ function CollapsibleBreakdownSection({
<td
className={`w-20 pt-1 pl-3 pr-3 pb-1 ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<div />
@@ -311,6 +288,7 @@ function CollapsibleBreakdownSection({
<td
className={`w-20 pt-1 pl-3 pr-3 pb-1 text-center ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<div />
@@ -319,11 +297,13 @@ function CollapsibleBreakdownSection({
{/* Empty Details column for alignment (per-row; variant rows render their own) */}
<td
className={`w-20 ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
/>
<td
className={`p-0 align-top text-center relative overflow-hidden ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
{axisRange && axisRange > 0 ? (
@@ -380,6 +360,7 @@ function CollapsibleBreakdownSection({
<tr
key={`${metric.uuid}-${variant.key}`}
className="hover:bg-bg-hover"
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
onMouseEnter={(e) =>
handleTooltipMouseEnter(e, variant)
@@ -391,6 +372,7 @@ function CollapsibleBreakdownSection({
>
<td
className={`w-20 pt-1 pl-3 pr-3 pb-1 whitespace-nowrap overflow-hidden ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{
...FIXED_HEIGHT_STYLE,
backgroundImage: rowBackgroundImage,
@@ -401,6 +383,7 @@ function CollapsibleBreakdownSection({
<td
className={`w-24 pt-1 pl-3 pr-3 pb-1 text-left whitespace-nowrap overflow-hidden ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{
...FIXED_HEIGHT_STYLE,
backgroundImage: rowBackgroundImage,
@@ -419,6 +402,7 @@ function CollapsibleBreakdownSection({
<td
className={`w-20 pt-1 pl-3 pr-3 pb-1 text-left whitespace-nowrap overflow-hidden ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{
...FIXED_HEIGHT_STYLE,
backgroundImage: rowBackgroundImage,
@@ -457,6 +441,7 @@ function CollapsibleBreakdownSection({
<td
className={`w-20 pt-1 pl-3 pr-3 pb-1 text-center whitespace-nowrap overflow-hidden ${!significant ? (isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light') : ''} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{
...FIXED_HEIGHT_STYLE,
backgroundColor: significant
@@ -481,6 +466,7 @@ function CollapsibleBreakdownSection({
{/* Details (empty, for alignment) */}
<td
className={`w-20 ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{
...FIXED_HEIGHT_STYLE,
backgroundImage: rowBackgroundImage,
@@ -773,6 +759,7 @@ export function MetricRowGroup({
bg
)}
rowSpan={skeletonVariantKeys.length}
+ // eslint-disable-next-line react/forbid-dom-props
style={getScaledHeightStyle(skeletonVariantKeys.length)}
>
<MetricRetryState retry={metricRetry} />
@@ -781,13 +768,18 @@ export function MetricRowGroup({
return (
<>
- <tr className="hover:bg-bg-hover group" style={FIXED_HEIGHT_STYLE}>
+ <tr
+ className="hover:bg-bg-hover group"
+ // eslint-disable-next-line react/forbid-dom-props
+ style={FIXED_HEIGHT_STYLE}
+ >
{/* Metric column: real header spanning every variant row, stays interactive while loading */}
<td
className={`w-1/5 border-r p-3 align-top text-left relative overflow-hidden ${
!isLastMetric ? 'border-b' : ''
} ${bg}`}
rowSpan={skeletonVariantKeys.length}
+ // eslint-disable-next-line react/forbid-dom-props
style={getScaledHeightStyle(skeletonVariantKeys.length)}
>
<MetricHeader
@@ -816,6 +808,7 @@ export function MetricRowGroup({
bg
)}
rowSpan={skeletonVariantKeys.length}
+ // eslint-disable-next-line react/forbid-dom-props
style={getScaledHeightStyle(skeletonVariantKeys.length)}
>
{/* Reserve the Details button's footprint so the chart column doesn't shift when results land */}
@@ -830,7 +823,12 @@ export function MetricRowGroup({
</tr>
{skeletonVariantKeys.slice(1).map((variantKey, index) => (
- <tr key={variantKey} className="hover:bg-bg-hover group" style={FIXED_HEIGHT_STYLE}>
+ <tr
+ key={variantKey}
+ className="hover:bg-bg-hover group"
+ // eslint-disable-next-line react/forbid-dom-props
+ style={FIXED_HEIGHT_STYLE}
+ >
<SkeletonResultCells
variantKey={variantKey}
className={clsx(bg, index === skeletonVariantKeys.length - 2 && 'border-b')}
@@ -848,12 +846,17 @@ export function MetricRowGroup({
return (
<>
- <tr className="hover:bg-bg-hover group" style={noResultStateStyle}>
+ <tr
+ className="hover:bg-bg-hover group"
+ // eslint-disable-next-line react/forbid-dom-props
+ style={noResultStateStyle}
+ >
{/* Metric column - always visible */}
<td
className={`w-1/5 border-r p-3 align-top text-left relative overflow-hidden ${
!isLastMetric ? 'border-b' : ''
} ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={noResultStateStyle}
>
<MetricHeader
@@ -876,6 +879,7 @@ export function MetricRowGroup({
className={`p-3 text-center ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'} ${
!isLastMetric ? 'border-b' : ''
}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={noResultStateStyle}
>
<ChartEmptyState
@@ -890,10 +894,12 @@ export function MetricRowGroup({
</td>
</tr>
{metric.breakdownFilter?.breakdowns && metric.breakdownFilter.breakdowns.length > 0 && (
- <BreakdownErrorState
+ <MetricBreakdownError
metric={metric}
isAlternatingRow={isAlternatingRow}
onRemoveBreakdown={onRemoveBreakdown}
+ onAttributionChange={() => {}}
+ onBreakdownLimitChange={() => {}}
/>
)}
</>
@@ -929,6 +935,7 @@ export function MetricRowGroup({
<div
ref={tooltipRef}
className="fixed bg-bg-light border border-border px-3 py-2 rounded-md text-[13px] shadow-md z-[100] min-w-[280px] cursor-pointer hover:border-primary"
+ // eslint-disable-next-line react/forbid-dom-props
style={{
left: tooltipState.position.x,
top: tooltipState.position.y,
@@ -954,13 +961,17 @@ export function MetricRowGroup({
</div>,
document.body
)}
-
{/* Baseline row */}
- <tr className="hover:bg-bg-hover group" style={FIXED_HEIGHT_STYLE}>
+ <tr
+ className="hover:bg-bg-hover group"
+ // eslint-disable-next-line react/forbid-dom-props
+ style={FIXED_HEIGHT_STYLE}
+ >
{/* Metric column - with rowspan */}
<td
className={`w-1/5 border-r p-3 align-top text-left relative overflow-hidden ${!isLastMetric ? 'border-b' : ''} ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'}`}
rowSpan={variantResults.length + 1}
+ // eslint-disable-next-line react/forbid-dom-props
style={totalRowsHeightStyle}
>
<MetricHeader
@@ -982,6 +993,7 @@ export function MetricRowGroup({
className={`w-20 pt-1 pl-3 pr-3 pb-1 whitespace-nowrap overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${variantResults.length === 0 ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<VariantTag variantKey={baselineResult.key} />
@@ -992,6 +1004,7 @@ export function MetricRowGroup({
className={`w-24 pt-1 pl-3 pr-3 pb-1 text-left whitespace-nowrap overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${variantResults.length === 0 ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<div className="metric-cell">
@@ -1005,6 +1018,7 @@ export function MetricRowGroup({
className={`w-20 pt-1 pl-3 pr-3 pb-1 text-left whitespace-nowrap overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${variantResults.length === 0 ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<div />
@@ -1015,6 +1029,7 @@ export function MetricRowGroup({
className={`w-20 pt-1 pl-3 pr-3 pb-1 text-center whitespace-nowrap overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${variantResults.length === 0 ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
<div />
@@ -1025,6 +1040,7 @@ export function MetricRowGroup({
className={`w-20 pt-3 align-top relative overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${variantResults.length === 0 ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
{showDetailsModal && (
@@ -1048,6 +1064,7 @@ export function MetricRowGroup({
className={`p-0 align-top text-center relative overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${variantResults.length === 0 ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
>
{axisRange && axisRange > 0 ? (
@@ -1075,7 +1092,6 @@ export function MetricRowGroup({
)}
</td>
</tr>
-
{/* Variant rows */}
{variantResults.map((variant, index) => {
const isLastRow = index === variantResults.length - 1
@@ -1096,6 +1112,7 @@ export function MetricRowGroup({
<tr
key={`${metric.uuid}-${variant.key}`}
className="hover:bg-bg-hover group"
+ // eslint-disable-next-line react/forbid-dom-props
style={FIXED_HEIGHT_STYLE}
onMouseEnter={(e) => handleTooltipMouseEnter(e, variant)}
onMouseLeave={handleTooltipMouseLeave}
@@ -1106,6 +1123,7 @@ export function MetricRowGroup({
className={`w-20 pt-1 pl-3 pr-3 pb-1 text-left whitespace-nowrap overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{ ...FIXED_HEIGHT_STYLE, backgroundImage: rowBackgroundImage }}
>
<VariantTag variantKey={variant.key} />
@@ -1116,6 +1134,7 @@ export function MetricRowGroup({
className={`w-24 pt-1 pl-3 pr-3 pb-1 text-left whitespace-nowrap overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{ ...FIXED_HEIGHT_STYLE, backgroundImage: rowBackgroundImage }}
>
<div className="metric-cell">
@@ -1129,6 +1148,7 @@ export function MetricRowGroup({
className={`w-20 pt-1 pl-3 pr-3 pb-1 text-left whitespace-nowrap overflow-hidden ${
isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'
} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{ ...FIXED_HEIGHT_STYLE, backgroundImage: rowBackgroundImage }}
>
<div className="flex items-center gap-1">
@@ -1154,6 +1174,7 @@ export function MetricRowGroup({
className={`w-20 pt-1 pl-3 pr-3 pb-1 text-center whitespace-nowrap overflow-hidden ${
!significant ? (isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light') : ''
} ${isLastRow ? 'border-b' : ''}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{
...FIXED_HEIGHT_STYLE,
backgroundColor: significant
@@ -1177,6 +1198,7 @@ export function MetricRowGroup({
className={`w-20 ${isAlternatingRow ? 'bg-bg-table' : 'bg-bg-light'} ${
isLastRow ? 'border-b' : ''
}`}
+ // eslint-disable-next-line react/forbid-dom-props
style={{ ...FIXED_HEIGHT_STYLE, backgroundImage: rowBackgroundImage }}
/>
@@ -1195,7 +1217,6 @@ export function MetricRowGroup({
</tr>
)
})}
-
{/* Collapsible Breakdown Section. */}
{(metric.breakdownFilter?.breakdowns?.length ?? 0) > 0 && (
<CollapsibleBreakdownSection
@@ -1218,7 +1239,6 @@ export function MetricRowGroup({
handleTooltipMouseMove={handleTooltipMouseMove}
/>
)}
-
{timeseriesModalState.variantResult && (
<TimeseriesModal
isOpen={timeseriesModalState.isOpen}