Skip to content

Commit 385280b

Browse files
fix: stop shifting sparkline when complete
1 parent f8694a6 commit 385280b

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/features/Overview/SlotPerformance/useTileSparkline.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ export function useScaledDataPoints({
250250
}
251251
// live
252252
else {
253+
if (stopShifting) return;
254+
253255
if (!clocks.has(tickMs)) {
254256
clocks.set(tickMs, createClock(tickMs));
255257
}
@@ -262,7 +264,15 @@ export function useScaledDataPoints({
262264
return unsub;
263265
}
264266
}
265-
}, [height, normalizedHistory, isStatic, tickMs, width, windowMs]);
267+
}, [
268+
height,
269+
normalizedHistory,
270+
isStatic,
271+
tickMs,
272+
width,
273+
windowMs,
274+
stopShifting,
275+
]);
266276

267277
return {
268278
scaledDataPoints,

src/features/StartupProgress/Firedancer/Snapshot/SnapshotSparklineCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export default function SnapshotSparklineCard({
4141
tileCount: tileCounts[tileType],
4242
liveIdlePerTile: timers?.[tileType],
4343
});
44-
const avgBusy = useLastDefinedValue(currentAvgBusy);
44+
const lastDefinedAvgBusy = useLastDefinedValue(currentAvgBusy);
45+
const avgBusy = isComplete ? currentAvgBusy : lastDefinedAvgBusy;
4546

4647
const { scaledDataPoints, range, pxPerTick, chartTickMs, isLive } =
4748
useScaledDataPoints({

0 commit comments

Comments
 (0)