From 63807b359f2f10e3526c346a4296a41e21628f84 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 8 Jun 2026 20:07:41 +0000 Subject: [PATCH] fix: avoid pane editor remount flicker when deploying a pipeline draft Co-Authored-By: Claude Opus 4.8 (1M context) --- .../AssetGraph/AssetGraphDetailsPane.svelte | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/assets/AssetGraph/AssetGraphDetailsPane.svelte b/frontend/src/lib/components/assets/AssetGraph/AssetGraphDetailsPane.svelte index fd58f9917f..8db2c697bf 100644 --- a/frontend/src/lib/components/assets/AssetGraph/AssetGraphDetailsPane.svelte +++ b/frontend/src/lib/components/assets/AssetGraph/AssetGraphDetailsPane.svelte @@ -326,7 +326,21 @@ return } const fresh = scriptRes.current - script = fresh ? structuredClone($state.snapshot(fresh) as Script) : undefined + if (fresh) { + script = structuredClone($state.snapshot(fresh) as Script) + return + } + // Resource is loading with no cached value. If we already hold the + // script for the selected path — e.g. a draft the user just deployed, + // whose now-persisted version is being fetched — keep showing it so the + // editor doesn't blink through the loading state (the "pane closed then + // reopened" flicker). Only blank when the selection points elsewhere. + const selPath = + selection?.kind === 'runnable' && selection.runnable_kind === 'script' + ? selection.path + : undefined + if (script && selPath && script.path === selPath) return + script = undefined }) // Persist draft edits back to the parent's drafts Map on transitions @@ -842,7 +856,14 @@ Failed to load: {scriptRes.error.message} {:else if script} - {#key (script.hash ?? `draft:${script.path}`) + script.language} + + {#key script.path}