perf(ui): enforce 750 ms live update cadence

Use one 750 ms interval for running download snapshots, progress updates, the bandwidth chart, and the header speed sparkline across every queue size. Remove the extra active-download renderer delay and add timing regressions for small, medium, and large queues.
This commit is contained in:
Sucukdeluxe
2026-08-20 05:23:59 +02:00
parent 08f017e8c4
commit 10528a2696
5 changed files with 59 additions and 21 deletions
+3 -3
View File
@@ -880,7 +880,7 @@ const historyRetentionLabels: Record<RendererSettings["historyRetentionMode"], s
const AUTO_RENDER_PACKAGE_LIMIT = 260;
export function getSnapshotRenderDelay(itemCount: number, running: boolean, activeTab: MainView): number {
let delay = itemCount >= 250 ? 0 : 100;
let delay = running && activeTab === "downloads" ? 0 : itemCount >= 250 ? 0 : 100;
if (!running) delay = Math.min(delay, 200);
if (activeTab !== "downloads") delay = Math.max(delay, 800);
return delay;
@@ -1272,7 +1272,7 @@ const BandwidthChart = memo(function BandwidthChart({ running, paused, speedHist
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const interval = setInterval(() => {
drawChart();
}, reducedMotion ? 1000 : 500);
}, reducedMotion ? 1000 : 750);
return () => clearInterval(interval);
}, [drawChart, running, paused]);
@@ -1374,7 +1374,7 @@ const DownloadSpeedSparkline = memo(function DownloadSpeedSparkline({ speedBps,
draw();
};
const id = window.setInterval(tick, 500);
const id = window.setInterval(tick, 750);
return () => window.clearInterval(id);
}, []);