From 9924e056b53221142e88f7c8ff1ec88a0193f714 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Mon, 28 Sep 2026 19:51:37 +0000 Subject: [PATCH] Plugin Studio releases its corner-widget hosts when it unmounts window.__doxaStudioWidgets keeps the corner hosts across a hot update so a live widget keeps its state, but a real unmount never released it, so the hosts and every widget element in them stayed on the page. It is now released in beforeUnmount, except during a hot update. --- plugin-designs/plugin-studio/plugin-studio.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugin-designs/plugin-studio/plugin-studio.vue b/plugin-designs/plugin-studio/plugin-studio.vue index bc971a1ef..78c969db1 100644 --- a/plugin-designs/plugin-studio/plugin-studio.vue +++ b/plugin-designs/plugin-studio/plugin-studio.vue @@ -758,6 +758,15 @@ export default defineComponent({ } this.loadManifest() }, + // The corner-widget hosts live on window.__doxaStudioWidgets so a HOT UPDATE remounts Studio onto + // the same hosts and a live widget (Rudder) keeps its state. A real unmount must release them, or + // the hosts and every widget element in them stay pinned on the page after Studio is gone. + beforeUnmount() { + if (import.meta.hot) return + const W = window.__doxaStudioWidgets + if (W && W.hosts) for (const h of Object.values(W.hosts)) { try { h.remove() } catch (_) {} } + delete window.__doxaStudioWidgets + }, methods: { // ── MAP TOKEN ──────────────────────────────────────────────────────────────────────────────── // A token service answers with JSON ({token|tk|accessToken}) or a bare string — the same contract