diff --git a/frontend/src/lib/components/RunForm.svelte b/frontend/src/lib/components/RunForm.svelte index 3ab7bb69e2..9296f2c22d 100644 --- a/frontend/src/lib/components/RunForm.svelte +++ b/frontend/src/lib/components/RunForm.svelte @@ -66,9 +66,10 @@ } export async function setArgs(nargs: Record) { - // Only when this form is the one offering them. Unoffered, they stay in the arguments - // and travel with them: `enforceDisabledDefaults` copies every key, so the job still - // receives them, and taking them out here would drop them from whoever owns `args`. + // Only when this form is the one offering them: taking them aside is what lets the + // section edit them, and a form without that section has nowhere to put them back + // from. It does not keep them — `SchemaForm` holds `args` to the keys the schema + // declares — so a form that hides the section neither offers these nor carries them. const { scriptArgs, commonParams } = showPsCommonParams ? extractPsCommonParams(nargs) : { scriptArgs: nargs, commonParams: {} } diff --git a/frontend/src/lib/components/details/FlowDetail.svelte b/frontend/src/lib/components/details/FlowDetail.svelte index e070cd8a7d..f7839159ca 100644 --- a/frontend/src/lib/components/details/FlowDetail.svelte +++ b/frontend/src/lib/components/details/FlowDetail.svelte @@ -347,7 +347,10 @@ // card edits — rather than a copy of it. There is then nothing to keep in step and nothing // to carry back: whatever is typed on either surface is what the call runs with. let ownArgs: Record | undefined = $state(undefined) - const args = $derived(pendingRun ? pendingRun.draftArgs : ownArgs) + // Falls back once the draft is gone: pressing Run settles the call, and the form must go + // on showing what it submitted while the job starts — and still show it if the start is + // refused, which leaves the reader on the page with the run to make again. + const args = $derived(pendingRun?.draftArgs ?? ownArgs) function setArgs(next: Record | undefined) { if (pendingRun) pendingRun.setDraftArgs(next ?? {}) else ownArgs = next @@ -390,6 +393,8 @@ const call = pendingRun if (!call) return runFlow return (_scheduledForStr: string | undefined, a: Record) => { + // Kept for the moment the draft stops answering, just below. + ownArgs = a if (!call.submit(a)) { sendUserToast('That request is no longer waiting on this form', true) } diff --git a/frontend/src/lib/components/details/ScriptDetail.svelte b/frontend/src/lib/components/details/ScriptDetail.svelte index eb2837e925..18458ac031 100644 --- a/frontend/src/lib/components/details/ScriptDetail.svelte +++ b/frontend/src/lib/components/details/ScriptDetail.svelte @@ -422,7 +422,10 @@ // card edits — rather than a copy of it. There is then nothing to keep in step and nothing // to carry back: whatever is typed on either surface is what the call runs with. let ownArgs: Record | undefined = $state(undefined) - const args = $derived(pendingRun ? pendingRun.draftArgs : ownArgs) + // Falls back once the draft is gone: pressing Run settles the call, and the form must go + // on showing what it submitted while the job starts — and still show it if the start is + // refused, which leaves the reader on the page with the run to make again. + const args = $derived(pendingRun?.draftArgs ?? ownArgs) function setArgs(next: Record | undefined) { if (pendingRun) pendingRun.setDraftArgs(next ?? {}) else ownArgs = next @@ -439,6 +442,8 @@ const call = pendingRun if (!call) return runScript return (_scheduledForStr: string | undefined, a: Record) => { + // Kept for the moment the draft stops answering, just below. + ownArgs = a if (!call.submit(a)) { sendUserToast('That request is no longer waiting on this form', true) }