: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(signals): make report chart tables scroll and add chart spacing (#75357)
Andrew Maguireca2384c1d0ac
diff --git a/frontend/src/scenes/inbox/components/detail/ReportChart.tsx b/frontend/src/scenes/inbox/components/detail/ReportChart.tsxindex 02729800de0b..06723cc3db00 100644--- a/frontend/src/scenes/inbox/components/detail/ReportChart.tsx+++ b/frontend/src/scenes/inbox/components/detail/ReportChart.tsx@@ -175,13 +175,15 @@ export function ReportChart({ chartId }: { chartId: string }): JSX.Element | nul// `size` arrives as stored JSON, so an unknown value falls back to the inferred height rather// than dropping the box altogether.const size = chart.size && chart.size in SIZE_HEIGHTS ? chart.size : null- // A graph fills whatever box it's given and collapses without one. A data table sizes itself to- // its rows, so it only takes a box when its author asked for one — and then that box is a- // ceiling it scrolls within rather than a height it has to fill. Either way the box scrolls, so- // a grid taller than its size is reachable instead of cut off.+ const inferredSize = size ?? inferChartSize(query)+ // A graph fills whatever box it's given and collapses without one, so it takes a fixed height. A+ // data table sizes itself to its rows, so its box is a ceiling it scrolls within rather than a+ // height it has to fill. Every chart gets a bounded box either way: a table taller than its size+ // then scrolls inside the card, instead of growing the whole report down the page with its last+ // rows left unreachable at the bottom.const isSelfSizing = !(isInsightVizNode(query) || isSavedInsightNode(query) || isGraphicalSqlNode(query))- const height = isSelfSizing ? (size ? SIZE_MAX_HEIGHTS[size] : null) : SIZE_HEIGHTS[size ?? inferChartSize(query)]- const bodyClass = height ? `flex flex-col overflow-y-auto ${height}` : 'flex flex-col'+ const height = isSelfSizing ? SIZE_MAX_HEIGHTS[inferredSize] : SIZE_HEIGHTS[inferredSize]+ const bodyClass = `flex flex-col overflow-y-auto ${height}`// The SQLEditor prefix opts into container-governed chart sizing// (dataVisualizationLogic.presetChartHeight). Without it a graphical SQL chart renders at 60vh// and swallows the report, which is why NotebookNodeSQLV2 prefixes its key the same way.diff --git a/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx b/frontend/src/scenes/inbox/components/detail/ReportDetail.tsxindex 60c6aa4a7d12..a6a4f0bf7145 100644--- a/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx+++ b/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx@@ -352,7 +352,7 @@ export function InboxDetailFrame({<DetailSection icon={summary.icon} title={summary.title}>{report.summary ? (<LemonMarkdown- className="text-sm text-secondary leading-relaxed break-words [&>*+*]:mt-3 [&_li]:my-1 [&_ul]:my-2 [&_ol]:my-2 [&_h1]:mt-5 [&_h2]:mt-5 [&_h3]:mt-4"+ className="text-sm text-secondary leading-relaxed break-words [&>*+*]:mt-3 [&_[data-attr=report-chart]]:my-5 [&_li]:my-1 [&_ul]:my-2 [&_ol]:my-2 [&_h1]:mt-5 [&_h2]:mt-5 [&_h3]:mt-4"disableImagesrenderChartRef={renderChartRef}>@@ -364,7 +364,7 @@ export function InboxDetailFrame({</p>)}{trailingCharts.length > 0 && (- <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-4 mt-5">{trailingCharts.map((chart) => (<ReportChart key={chart.chart_id} chartId={chart.chart_id} />))}