diff --git a/frontend/src/lib/components/sessions/FlowEditorView.svelte b/frontend/src/lib/components/sessions/FlowEditorView.svelte index 45163cc416..fe1ae268d7 100644 --- a/frontend/src/lib/components/sessions/FlowEditorView.svelte +++ b/frontend/src/lib/components/sessions/FlowEditorView.svelte @@ -15,7 +15,8 @@ path, workspaceId, onNavigate, - isActiveSession = true + isActiveSession = true, + active = true }: { runtime: SessionRuntime path: string @@ -24,8 +25,12 @@ /** Forwarded to SessionEditorTarget — only the visible session claims the * workspace's single live-editor slot. */ isActiveSession?: boolean + /** Whether this is the visible preview tab (forwarded as isActiveTab). */ + active?: boolean } = $props() + // This tab's own flow cell; each open flow editor binds its own store. + const cell = $derived(runtime.flowCell(path)) let selectedId = $state('settings-metadata') let diffDrawer: DiffDrawer | undefined = $state() @@ -35,7 +40,7 @@ // baseline — useUserDraftSync's inbound effect then syncs the editor preview. // Mirrors ScriptEditorView. async function restoreDeployed() { - const saved = runtime.savedFlow.val + const saved = cell.saved.val if (!saved) { sendUserToast('Could not restore to deployed', true) return @@ -61,7 +66,7 @@ } -{#if runtime.savedFlow.val} +{#if cell.saved.val} {/if} runtime.flowStore.val?.path ?? path} + isActiveTab={active} + effectivePath={() => cell.store.val?.path ?? path} > {#snippet editor()} - +