From c60384cde75f375bda4641c20c00a684468f3235 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 5 Nov 2026 10:10:01 +0000 Subject: [PATCH] show one header when turning the loop concurrency cap off (#12237) * fix: show one header when turning the loop concurrency cap off Co-Authored-By: Claude Opus 5.5 * fix: remount the loop concurrency form whenever a cap appears Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .../lib/components/flows/content/FlowLoop.svelte | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/flows/content/FlowLoop.svelte b/frontend/src/lib/components/flows/content/FlowLoop.svelte index bfb80addd6..9c896484d8 100644 --- a/frontend/src/lib/components/flows/content/FlowLoop.svelte +++ b/frontend/src/lib/components/flows/content/FlowLoop.svelte @@ -150,6 +150,17 @@ const parallelismCapped = $derived( mod.value.type === 'forloopflow' && mod.value.parallelism != undefined ) + // Changes only when the cap appears (toggle, undo, AI edit): the form seeds its + // static/expression mode once, so a new value needs a fresh form. Removing the cap must not + // remount it, or the old form slides its input out next to the new collapsed one and the + // header shows twice. + let capAppearances = 0 + let wasCapped = false + const parallelismFormKey = $derived.by(() => { + if (parallelismCapped && !wasCapped) capAppearances++ + wasCapped = parallelismCapped + return capAppearances + }) {#snippet parallelismToggle()} @@ -331,9 +342,7 @@ parallelismEditor?.focus() }} > - - {#key parallelismCapped} + {#key parallelismFormKey} (mod.value as ForloopFlow).parallelism,