From 69f3894c18cc548fb3d51a8299ab549308d9674f Mon Sep 17 00:00:00 2001 From: DevEnv nis2-agile Date: Tue, 25 Aug 2026 18:15:21 +0200 Subject: [PATCH] [FIX] RACI + Competenze: stesso anti-loop MutationObserver+createIcons dell'organigramma Prevenzione proattiva dello stesso freeze latente trovato in organigramma: le pagine raci.html e competenze.html richiamavano createIcons() su ogni mutazione DOM. Debounce+disconnect. Co-Authored-By: Claude Opus 4.8 (1M context) --- public/competenze.html | 12 +++++++++++- public/raci.html | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/public/competenze.html b/public/competenze.html index 9d2e1f3..1bf6f7c 100644 --- a/public/competenze.html +++ b/public/competenze.html @@ -206,7 +206,17 @@ v3Icons(); var root = document.querySelector('main.wrap'); if (root && window.MutationObserver) { - var mo = new MutationObserver(function () { v3Icons(); }); + // Anti-loop: createIcons() muta il DOM (->svg) → osservare "ogni mutazione" + // e ri-chiamarlo puo' auto-ritriggerarsi (freeze). Debounce + disconnect. + var applying = false, timer = null; + var mo = new MutationObserver(function () { + if (applying) return; + clearTimeout(timer); + timer = setTimeout(function () { + applying = true; mo.disconnect(); v3Icons(); + mo.observe(root, { childList: true, subtree: true }); applying = false; + }, 120); + }); mo.observe(root, { childList: true, subtree: true }); } }); diff --git a/public/raci.html b/public/raci.html index fcaf4d3..12c6f3c 100644 --- a/public/raci.html +++ b/public/raci.html @@ -155,7 +155,17 @@ v3Icons(); var root = document.querySelector('main.wrap'); if (root && window.MutationObserver) { - var mo = new MutationObserver(function () { v3Icons(); }); + // Anti-loop: createIcons() muta il DOM (->svg) → osservare "ogni mutazione" + // e ri-chiamarlo puo' auto-ritriggerarsi (freeze). Debounce + disconnect. + var applying = false, timer = null; + var mo = new MutationObserver(function () { + if (applying) return; + clearTimeout(timer); + timer = setTimeout(function () { + applying = true; mo.disconnect(); v3Icons(); + mo.observe(root, { childList: true, subtree: true }); applying = false; + }, 120); + }); mo.observe(root, { childList: true, subtree: true }); } });