From b86785d5c8092845e3b84ff13c0e2f14f8b86f28 Mon Sep 17 00:00:00 2001 From: Vidya Rupak Date: Mon, 22 Dec 2025 17:24:49 -0700 Subject: [PATCH] bugfix: physics persisted sometimes after slideshow ends. now explicitly stopping physics after slideshow ends --- packages/memory-graph/src/components/memory-graph.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/memory-graph/src/components/memory-graph.tsx b/packages/memory-graph/src/components/memory-graph.tsx index e16d5882..b5aab75d 100644 --- a/packages/memory-graph/src/components/memory-graph.tsx +++ b/packages/memory-graph/src/components/memory-graph.tsx @@ -578,6 +578,8 @@ export const MemoryGraph = ({ if (!isSlideshowActive) { // Close the popover when stopping slideshow setSelectedNode(null) + // Explicitly cool down physics simulation in case timeout hasn't fired yet + forceSimulation.coolDown() return } @@ -622,6 +624,7 @@ export const MemoryGraph = ({ clearTimeout(physicsTimeoutRef.current) } physicsTimeoutRef.current = setTimeout(() => { + // Only cool down if slideshow is still active or if this is cleanup forceSimulationRef.current.coolDown() physicsTimeoutRef.current = null }, 1000)