From 0486045d29b1ffb710a5504f9fce8e0670ef991d Mon Sep 17 00:00:00 2001 From: archipelago Date: Fri, 31 Jul 2026 02:21:07 -0400 Subject: [PATCH] fix(02-review): WR-06 skip redundant fallback init timer on later MeshMap reactivations armMapVisibility() unconditionally scheduled a setTimeout(initMap, 300) on every reactivation, not just the first mount. initMap()'s own guard made this harmless (a no-op once the map exists), but it scheduled a throwaway timer on every tab-switch back into Mesh. Guard the scheduling itself so intent ("fallback init for the very first mount") matches behavior. Co-Authored-By: Claude --- neode-ui/src/components/MeshMap.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/neode-ui/src/components/MeshMap.vue b/neode-ui/src/components/MeshMap.vue index 9d1ecfed..ad067e65 100644 --- a/neode-ui/src/components/MeshMap.vue +++ b/neode-ui/src/components/MeshMap.vue @@ -397,8 +397,10 @@ function armMapVisibility() { } // Fallback init for the very first mount (idempotent no-op once `map` is - // already set — mirrors initMap's own not-yet-laid-out retry loop). - setTimeout(initMap, 300) + // already set — mirrors initMap's own not-yet-laid-out retry loop). Guard + // against `map` already existing so later reactivations don't schedule a + // throwaway no-op timer (WR-06) — this is genuinely first-mount-only. + if (!map) setTimeout(initMap, 300) // A map laid out while the tab was off screen may have settled at a // zero/partial size; re-tile it at its real size now that it's back on