diff --git a/frontend/src/lib/components/RunForm.svelte b/frontend/src/lib/components/RunForm.svelte index c9ced988c6..aa0190689e 100644 --- a/frontend/src/lib/components/RunForm.svelte +++ b/frontend/src/lib/components/RunForm.svelte @@ -65,6 +65,13 @@ return { scriptArgs, commonParams } } + /** Everything the form is holding, as a run would send it: the schema's arguments and the + * PowerShell common parameters, which are kept apart from them in here and only put back + * on the way out. For a caller handing the form's contents somewhere else. */ + export function heldArgs(): Record { + return { ...args, ...psCommonParams } + } + export async function setArgs(nargs: Record) { const { scriptArgs, commonParams } = extractPsCommonParams(nargs) args = scriptArgs diff --git a/frontend/src/lib/components/details/FlowDetail.svelte b/frontend/src/lib/components/details/FlowDetail.svelte index 30f010f1ba..106c6825d4 100644 --- a/frontend/src/lib/components/details/FlowDetail.svelte +++ b/frontend/src/lib/components/details/FlowDetail.svelte @@ -400,7 +400,7 @@ // tab closed while the item is still being fetched would otherwise hand the card an empty // object and wipe the proposal it is still parked on. onDestroy(() => { - if (args !== undefined) pendingRun?.handBack(args) + if (args !== undefined) pendingRun?.handBack(runForm?.heldArgs() ?? args) }) // The dev workspace's editor is not one the session panel can host, so from a preview tab diff --git a/frontend/src/lib/components/details/ScriptDetail.svelte b/frontend/src/lib/components/details/ScriptDetail.svelte index b7b4b6fa68..d73d081581 100644 --- a/frontend/src/lib/components/details/ScriptDetail.svelte +++ b/frontend/src/lib/components/details/ScriptDetail.svelte @@ -449,7 +449,7 @@ // tab closed while the item is still being fetched would otherwise hand the card an empty // object and wipe the proposal it is still parked on. onDestroy(() => { - if (args !== undefined) pendingRun?.handBack(args) + if (args !== undefined) pendingRun?.handBack(runForm?.heldArgs() ?? args) }) // Read once on purpose: these args seed the form, so tracking the fragment would