From f003bda7b2afb2348a99302ef6dac11162271faf Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Wed, 25 Feb 2026 17:32:35 -0800 Subject: [PATCH] Don't queue packets while the page is hidden --- frontend/src/components/PacketVisualizer3D.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/components/PacketVisualizer3D.tsx b/frontend/src/components/PacketVisualizer3D.tsx index 172e925..946ed8e 100644 --- a/frontend/src/components/PacketVisualizer3D.tsx +++ b/frontend/src/components/PacketVisualizer3D.tsx @@ -390,6 +390,11 @@ function useVisualizerData3D({ pendingRef.current.delete(packetKey); timersRef.current.delete(packetKey); + // Skip particle creation when tab is hidden — nobody is watching, and + // creating them now would cause a burst of animations when the tab + // becomes visible again (since rAF is paused while hidden). + if (document.hidden) return; + for (const path of pending.paths) { const dedupedPath = dedupeConsecutive(path.nodes); if (dedupedPath.length < 2) continue;