@@ -44,7 +44,7 @@ export type MiniLineChartProps = {
4444 throttled ?: number [ ] ;
4545 /** Tooltip wording for the overlay buckets. Null omits the overlay line. */
4646 overlayLabel ?: string | null ;
47- /** Epoch ms of the first bucket's start. When omitted, the last bucket is anchored to now. */
47+ /** Epoch ms of the first bucket's start. */
4848 bucketStartMs ?: number ;
4949 /** Width of each bucket in ms. Defaults to one hour. */
5050 bucketIntervalMs ?: number ;
@@ -92,7 +92,12 @@ export function MiniLineChart({
9292 showPeak = true ,
9393} : MiniLineChartProps ) {
9494 const hasPeakOverride = peakOverride !== undefined ;
95- if ( ! data || data . length === 0 || ( data . every ( ( v ) => v === 0 ) && ! hasPeakOverride ) ) {
95+ if (
96+ ! data ||
97+ data . length === 0 ||
98+ bucketStartMs === undefined ||
99+ ( data . every ( ( v ) => v === 0 ) && ! hasPeakOverride )
100+ ) {
96101 return < span className = "text-text-dimmed" > –</ span > ;
97102 }
98103
@@ -103,11 +108,9 @@ export function MiniLineChart({
103108 const max = Math . max ( ...data ) ;
104109 const peak = peakOverride ?? max ;
105110
106- // Map each bucket to a dated point so the tooltip can show the window it represents. Buckets are
107- // `intervalMs` wide; if the caller didn't pass the first bucket's start, anchor the last bucket to
108- // now (hourly default).
111+ // Map each bucket to a dated point so the tooltip can show the window it represents.
109112 const intervalMs = bucketIntervalMs ?? 3600_000 ;
110- const startMs = bucketStartMs ?? Date . now ( ) - ( data . length - 1 ) * intervalMs ;
113+ const startMs = bucketStartMs ;
111114 const chartData : MiniLineChartDatum [ ] = data . map ( ( count , i ) => {
112115 const t = throttled ?. [ i ] ?? 0 ;
113116 // Extend the mask one bucket forward (a segment needs both endpoints non-null), so even a
0 commit comments