From a8f71630506c6286d700586b7270d1caeef13f6c Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 31 May 2026 17:33:33 -0400 Subject: [PATCH] Linked Designs: fix re-render wiping the resolved preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renderResolved had an `if (!el.isConnected) return` guard meant to catch the async path resuming after the layer was removed. But renderLayers() creates `el` via document.createElement and only appends it to the overlay *after* renderDesignObjectIntoElement runs (line 14442). On the synchronous peek-hit path, that meant the guard fired on every re-render — wiping the layer every time the canvas re-rendered after the cache warmed. Move the guard out of renderResolved (the sync caller doesn't need it — fitWrap is a descendant of el either way, and the caller will append el right after this function returns) and keep it in the async closure (where it's actually needed, because by the time the await resumes the old el may have been discarded by a subsequent render). --- src/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 0ea3d9b..f0f2ed8 100644 --- a/src/index.html +++ b/src/index.html @@ -10773,8 +10773,11 @@ } if (key) el.dataset.linkedKey = key; + // Synchronous paint helper. Callers from the async path must + // guard against el having been detached between the await and + // here; the synchronous peek-hit path calls this before el is + // even appended to the overlay, so don't guard inside. const renderResolved = (payload) => { - if (!el.isConnected) return; // host re-rendered while we fetched fitWrap.innerHTML = ''; try { renderDesignPayloadPreview(fitWrap, payload, { compact: true, transparentPixelArt: true });