: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(mcp-analytics): scroll share lists instead of stretching the chart beside them (#126239)
Georgis Andonis061c515e6577
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 4e303089740a..f3e107cc252f 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -14047,13 +14047,13 @@ snapshots:scenes-app-mcp-analytics--dashboard--wide--light:hash: v1.k794b7964.340966c0065f43f16f14c1851dccc95af6b2e893ed02093d4c2a22c59030d8d5.tgVoQgV0yZngM7l64DF2m_oPDp7dcKpFDDhmX9QqHNIscenes-app-mcp-analytics--dashboard-leaderboard-home--medium--dark:- hash: v1.k794b7964.86a323deef3bab2e5d898362e448e302446c749867a43b216036a3173122336e.646z1Pn80uV9VPl3HYAZeCJ2R_ByIPvbxQ_xCHQUgvA+ hash: v1.k794b7964.62ed4d36f3a4336c04ee7fd61f0bbbb0cbc473ab207e8160f21fbaf8a11547a3.AdEpafadet6zpyXEQZpgSwrXM_LmOxWkqhOFeLgw9r0scenes-app-mcp-analytics--dashboard-leaderboard-home--medium--light:- hash: v1.k794b7964.ae04b94c6ff580e3026881871df2b42d1f002c352cbc668ba1688e27b505ba42._FakMKll-H1Ih1AmNf5cD_5aXafIQIZlFw0ugjYR7cQ+ hash: v1.k794b7964.2fac1d26fa23636dafef5b086afbed99864f47c4881496f57b1b4d74b2b56bb6.lCjpjz7Q5HfYQBxcz9l_Gb7e0lDS4rEUGBlb4THxMHUscenes-app-mcp-analytics--dashboard-leaderboard-home--wide--dark:- hash: v1.k794b7964.feefa338401c50764231971fab44ca60b6ae8d61a6301fb2ddbe1822e9a763c8.qpmfK5Vld_iyBzgshqUYNSCWvPPBpOhDI_HaUYtJ3LM+ hash: v1.k794b7964.5448571cc722665f12483a3545f1a14932da9438ba02948743758f2efa9584b5.V-TxQ52GcdP-pKUxDQ5YWGPgP7c0xp7x-oiayABvd3wscenes-app-mcp-analytics--dashboard-leaderboard-home--wide--light:- hash: v1.k794b7964.8ea9a3b552ece0dd6ac1c216908dfe47dcc277c649582ffa3725e007aad11ca7.PCtbbOqed1_4048B1yMmHKL5e0gXi11iQtRQCwZt9jY+ hash: v1.k794b7964.ae0a552da5dab344b6d2c577892a47e3ba7570c7d46b62addd9600cb3cf20422.yqPk6pti-p1W9G0d7xF20BvMcFXjpzEIrakYD9iJuMoscenes-app-mcp-analytics--dashboard-narrow--dark:hash: v1.k794b7964.ad1f901d628a63d3ee7e37d765b8ad88bd40a9f117e98fb98bc083d54af2213e.i4plYiLDJthqGoGeC2YIFIOZBeQzTfZq_gJXCZGW3vsscenes-app-mcp-analytics--dashboard-narrow--light:diff --git a/products/mcp_analytics/frontend/dashboard/HarnessBarChart.tsx b/products/mcp_analytics/frontend/dashboard/HarnessBarChart.tsxindex 943a38840268..760633411617 100644--- a/products/mcp_analytics/frontend/dashboard/HarnessBarChart.tsx+++ b/products/mcp_analytics/frontend/dashboard/HarnessBarChart.tsx@@ -42,10 +42,12 @@ export function HarnessBarChart({rows,loading,theme,+ fillHeight = false,}: {rows: HarnessRow[]loading: booleantheme: ChartTheme+ fillHeight?: boolean}): JSX.Element {const [expanded, setExpanded] = useState(false)const { totalCalls, chartRows: sortedRows, allRows } = useMemo(() => summarizeHarnessBreakdown(rows), [rows])@@ -81,7 +83,7 @@ export function HarnessBarChart({</LemonButton>)}</div>- <div className="p-3">+ <div className="flex min-h-0 flex-1 flex-col p-3"><CardStateloading={loading}isEmpty={rows.length === 0}@@ -119,7 +121,14 @@ export function HarnessBarChart({</Tooltip>)}</div>- <ShareBarChart rows={chartRows} totalCalls={totalCalls} theme={theme} tooltip={renderTooltip} />+ <ShareBarChart+ rows={chartRows}+ totalCalls={totalCalls}+ theme={theme}+ tooltip={renderTooltip}+ fillHeight={fillHeight}+ label="Calls by harness"+ /></CardState></div><LemonModal title="All harnesses" isOpen={expanded} onClose={() => setExpanded(false)} width={640}>diff --git a/products/mcp_analytics/frontend/dashboard/ModelBarChart.tsx b/products/mcp_analytics/frontend/dashboard/ModelBarChart.tsxindex e5f012db9bc2..940299d7eee8 100644--- a/products/mcp_analytics/frontend/dashboard/ModelBarChart.tsx+++ b/products/mcp_analytics/frontend/dashboard/ModelBarChart.tsx@@ -48,6 +48,7 @@ export function ModelBarChart({filters = {},colorOf,rowLabels,+ fillHeight = false,}: {rows: ModelRow[]theme: ChartTheme@@ -56,6 +57,7 @@ export function ModelBarChart({colorOf?: (model: string) => string | undefined/** Pass the page's model rows when another chart on the page also shows models. */rowLabels?: ReadonlyMap<string, string>+ fillHeight?: boolean}): JSX.Element {const logic = modelBreakdownLogic({ filters })const { expanded, modelPageLoading } = useValues(logic)@@ -112,8 +114,8 @@ export function ModelBarChart({/></div></div>- <div className="flex flex-col gap-3 p-3">- <div>+ <div className="flex min-h-0 flex-1 flex-col gap-3 p-3">+ <div className="flex min-h-0 flex-1 flex-col"><divclassName="flex flex-wrap justify-between gap-2 text-xs text-secondary tabular-nums"translate="no"@@ -141,7 +143,14 @@ export function ModelBarChart({</Tooltip></div>{sortedRows.length > 0 ? (- <ShareBarChart rows={chartRows} totalCalls={totalCalls} theme={theme} tooltip={renderTooltip} />+ <ShareBarChart+ rows={chartRows}+ totalCalls={totalCalls}+ theme={theme}+ tooltip={renderTooltip}+ fillHeight={fillHeight}+ label="Calls by model"+ />) : (<p className="mb-0 text-xs text-secondary">{totalCalls > 0diff --git a/products/mcp_analytics/frontend/dashboard/ShareBarChart.tsx b/products/mcp_analytics/frontend/dashboard/ShareBarChart.tsxindex d3682d8b0e61..af9ace9dced7 100644--- a/products/mcp_analytics/frontend/dashboard/ShareBarChart.tsx+++ b/products/mcp_analytics/frontend/dashboard/ShareBarChart.tsx@@ -29,11 +29,16 @@ export function ShareBarChart<T>({totalCalls,theme,tooltip,+ fillHeight = false,+ label,}: {rows: ShareBarRow<T>[]totalCalls: numbertheme: ChartThemetooltip: (ctx: TooltipContext<ShareMeta<T>>) => JSX.Element | null+ /** Fill the parent's height and scroll the rows. The parent must be a flex column. */+ fillHeight?: boolean+ label?: string}): JSX.Element {const series = useMemo<Series<ShareMeta<T>>[]>(() =>@@ -65,17 +70,36 @@ export function ShareBarChart<T>({},[rowByKey])+ const barList = (+ <BarList+ series={series}+ theme={theme}+ total={totalCalls}+ config={SHARE_BAR_CONFIG}+ valueFormatter={formatCalls}+ renderLabel={renderLabel}+ tooltip={tooltip}+ />+ )+ if (!fillHeight) {+ return (+ <div translate="no" className="pt-2">+ {barList}+ </div>+ )+ }+ // The absolute scroller adds no height, so the chart beside it sets the row height. Keep min-h-60 below that chart's height.return (- <div translate="no" className="pt-2">- <BarList- series={series}- theme={theme}- total={totalCalls}- config={SHARE_BAR_CONFIG}- valueFormatter={formatCalls}- renderLabel={renderLabel}- tooltip={tooltip}- />+ <div className="relative min-h-60 flex-1">+ <div+ className="absolute inset-0 overflow-y-auto pt-2"+ translate="no"+ tabIndex={0}+ role="region"+ aria-label={label}+ >+ {barList}+ </div></div>)}diff --git a/products/mcp_analytics/frontend/leaderboardHome/MCPAnalyticsLeaderboardHome.tsx b/products/mcp_analytics/frontend/leaderboardHome/MCPAnalyticsLeaderboardHome.tsxindex f4d1dfc46c28..21c6b6d5094f 100644--- a/products/mcp_analytics/frontend/leaderboardHome/MCPAnalyticsLeaderboardHome.tsx+++ b/products/mcp_analytics/frontend/leaderboardHome/MCPAnalyticsLeaderboardHome.tsx@@ -177,6 +177,7 @@ export function MCPAnalyticsLeaderboardHome(): JSX.Element {filters={queryFilters}colorOf={modelColorOf}rowLabels={modelRowLabelMap}+ fillHeight/>)}</TwoColumns>@@ -192,7 +193,7 @@ export function MCPAnalyticsLeaderboardHome(): JSX.Element {interval={interval}colorOf={labColorOf}/>- <HarnessBarChart rows={harnessRows} loading={harnessRowsLoading} theme={theme} />+ <HarnessBarChart rows={harnessRows} loading={harnessRowsLoading} theme={theme} fillHeight /></TwoColumns></Section>diff --git a/products/mcp_analytics/frontend/leaderboardHome/ShareOverTimeChart.tsx b/products/mcp_analytics/frontend/leaderboardHome/ShareOverTimeChart.tsxindex 7d2e5b3761d2..f6c8d64270d5 100644--- a/products/mcp_analytics/frontend/leaderboardHome/ShareOverTimeChart.tsx+++ b/products/mcp_analytics/frontend/leaderboardHome/ShareOverTimeChart.tsx@@ -100,12 +100,14 @@ export function ShareOverTimeChart({empty={failed ? <LoadErrorMessage /> : <NoDataMessage />}><div className="flex min-h-[300px] flex-1 flex-col">+ {/* The minimum is on the plot so a wrapping legend grows the card instead of shrinking the plot. `!` beats the chart's min-h-0. */}<TimeSeriesLineChartseries={chartSeries}labels={labels}config={config}theme={theme}tooltip={renderTooltip}+ className="min-h-[276px]!"/></div></CardState>