diff --git a/frontend/src/lib/components/ScriptEditor.svelte b/frontend/src/lib/components/ScriptEditor.svelte index fe13e265b3..81214a09dd 100644 --- a/frontend/src/lib/components/ScriptEditor.svelte +++ b/frontend/src/lib/components/ScriptEditor.svelte @@ -679,7 +679,15 @@ args = nargs } - export async function runTest() { + export async function runTest(opts?: { cascade?: boolean }) { + // When the caller forces a cascade choice (e.g. the canvas runnable + // menu's "Run + trigger N downstream"), also flip the persistent + // `cascadeDownstream` state so the split button's label/icon reflect + // the active mode after the run kicks off — keeps "what mode am I in" + // visible instead of having a one-off run silently disagree with the + // UI. The caller is welcome to bump the signal repeatedly; we just + // keep the latest choice as the active mode. + if (opts?.cascade !== undefined) cascadeDownstream = opts.cascade // Discard any previous recording when running a normal test if (!scriptRecording.active) { lastRecording = undefined @@ -1717,9 +1725,13 @@ contentClasses="p-0" > {#snippet trigger()} +