: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(tracing): render no highlight when the selection falls off the histogram axis (#71498)
Jon McCallumdec220344abb
diff --git a/products/tracing/frontend/OperationHistogram.tsx b/products/tracing/frontend/OperationHistogram.tsxindex 5df7e525d4c6..ff8d9a145e36 100644--- a/products/tracing/frontend/OperationHistogram.tsx+++ b/products/tracing/frontend/OperationHistogram.tsx@@ -48,8 +48,12 @@ export function OperationHistogram({const startIndexRaw = bucketsNs.indexOf(snapDurationToBucket(selection.minNs))// maxNs is the exclusive upper edge — the highlight ends at the bar before it.const endIndexRaw = bucketsNs.indexOf(snapDurationToBucket(selection.maxNs))- const startIndex = startIndexRaw === -1 ? 0 : startIndexRaw- const endIndex = endIndexRaw === -1 ? bucketsNs.length : endIndexRaw+ // An off-axis edge clamps toward its near end; a selection entirely off the axis+ // (e.g. persisted before a date change reshaped the distribution) collapses to+ // start >= end and renders no highlight.+ const startIndex = startIndexRaw !== -1 ? startIndexRaw : selection.minNs <= bucketsNs[0] ? 0 : bucketsNs.length+ const endIndex =+ endIndexRaw !== -1 ? endIndexRaw : selection.maxNs > bucketsNs[bucketsNs.length - 1] ? bucketsNs.length : 0if (startIndex >= endIndex) {return null}