: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(experiments): shrink the breakdown tag on metric rows (#123487)
Juraj Majerik68fe8ede2028
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 4a271262df00..217dd0e3115e 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -16081,9 +16081,9 @@ snapshots:scenes-dashboards-customize-breakdown-colors--customize-breakdown-colors--light:hash: v1.k794b7964.441dbd7e00749f71e50c7b8c7b123485c1bc2da25498c43381bd12b2581f3034.ddH2Si9PeHnZaq2SataU1dDaQdDTMxWiJkhDaPlJypMscenes-inbox-scout-tags--editor-and-filter--dark:- hash: v1.k794b7964.b76b173ee1dc78112e700af267b53d59959164f8ebbc814df2b5f4a3811bcd49.2hfIhAW_k3BdFlo9jtUoJhOyZhS1uQmgafcdvh_CGmg+ hash: v1.k794b7964.79b0730ad23bc4daace066e8418a8f851d9a3e018bce50cd906f6f9276017d39.oiSmz7Fd649f4FBQK82nQ2-HLpGPZPaM9stDumq8qPoscenes-inbox-scout-tags--editor-and-filter--light:- hash: v1.k794b7964.4aed44e2990813028b0e9390cbae48142a07a1d7f977b8bfc69d8ca6025c1a80._qkBooayua1hQrnHoZoNzQ8Oj6iSL_nnwUrNwJ1qoh0+ hash: v1.k794b7964.f44b90833e5c168f2e25aab66ce05d955eae6452012f4ea1c1afc8012a28a8a4.9ZObJy17CcFKvWc7iI1hG9UaUhy32nEOiijsyRK-PMsscenes-inbox-scout-tags--many-tags--dark:hash: v1.k794b7964.491644324fcbe190b251205a2f7d5b0e59516b8345a63c4d604071095d53ef20.lEWGSyQZ8Qn0d98vMxEg5IZgxzTWFkx880UnUUY4wusscenes-inbox-scout-tags--many-tags--light:diff --git a/frontend/src/lib/lemon-ui/LemonTag/LemonTag.scss b/frontend/src/lib/lemon-ui/LemonTag/LemonTag.scssindex 2bcba826d111..b4008f9fb070 100644--- a/frontend/src/lib/lemon-ui/LemonTag/LemonTag.scss+++ b/frontend/src/lib/lemon-ui/LemonTag/LemonTag.scss@@ -117,6 +117,11 @@min-height: 0.875rem !important;padding: 0.0625rem !important;margin-left: 0.1875rem;++ .LemonButton__chrome {+ min-height: 0;+ padding: 0;+ }}// Close on click behaviordiff --git a/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownTag.tsx b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownTag.tsxnew file mode 100644index 000000000000..1d78c77231d8--- /dev/null+++ b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdownTag.tsx@@ -0,0 +1,27 @@+import { LemonTag } from '@posthog/lemon-ui'++import { PROPERTY_FILTER_TYPE_TO_TAXONOMIC_FILTER_GROUP_TYPE } from 'lib/components/PropertyFilters/utils'+import { PropertyKeyInfo } from 'lib/components/PropertyKeyInfo'++import { extractDisplayLabel } from '~/queries/nodes/DataTable/utils'+import { Breakdown } from '~/queries/schema/schema-general'++export function MetricBreakdownTag({+ breakdown,+ onRemove,+}: {+ breakdown: Breakdown+ onRemove: () => void+}): JSX.Element {+ const breakdownType = breakdown.type || 'event'++ return (+ <LemonTag type="muted" size="small" closable onClose={onRemove} data-attr="experiment-breakdown-tag">+ <PropertyKeyInfo+ value={extractDisplayLabel(String(breakdown.property))}+ type={PROPERTY_FILTER_TYPE_TO_TAXONOMIC_FILTER_GROUP_TYPE[breakdownType]}+ disableIcon+ />+ </LemonTag>+ )+}diff --git a/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdowns.tsx b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdowns.tsxindex a36fd8683b5d..77bf190ef780 100644--- a/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdowns.tsx+++ b/frontend/src/scenes/experiments/MetricBreakdowns/MetricBreakdowns.tsx@@ -2,7 +2,6 @@ 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'@@ -10,6 +9,7 @@ import { BreakdownAttributionType, StepOrderValue } from '~/types'import { MetricBreakdownAttribution } from './MetricBreakdownAttribution'import { MetricBreakdownLimit } from './MetricBreakdownLimit'+import { MetricBreakdownTag } from './MetricBreakdownTag'/*** Renders the metric's breakdown chips on the left, then (behind the@@ -44,15 +44,10 @@ export function MetricBreakdowns({return (<div className="flex items-center gap-3">- <div className="flex items-center gap-2">+ <div className="flex items-center gap-1 text-xs text-muted">+ <span>Breakdown by</span>{metric.breakdownFilter?.breakdowns?.map((breakdown, index) => (- <BreakdownTag- key={index}- breakdown={breakdown.property}- breakdownType={breakdown.type || 'event'}- onClose={() => onRemoveBreakdown(index)}- size="small"- />+ <MetricBreakdownTag key={index} breakdown={breakdown} onRemove={() => onRemoveBreakdown(index)} />))}</div>{showAttribution && (diff --git a/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx b/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsxindex 5eb31c8e6b47..abffba825735 100644--- a/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx+++ b/frontend/src/scenes/experiments/MetricsView/new/MetricRowGroup.tsx@@ -162,6 +162,7 @@ function CollapsibleBreakdownSection({<LemonCollapsemultiple={false}embedded+ size="small"activeKey={isExpanded ? 'breakdowns' : undefined}className={`breakdown-collapse breakdown-collapse--${isAlternatingRow ? 'alt-row' : 'normal-row'}`}panels={[