Fix: Auto-prefill inputs for replay operations#15460
Fix: Auto-prefill inputs for replay operations#15460nancysangani wants to merge 5 commits intokestra-io:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes replay-with-inputs UX so previously executed inputs are automatically populated, and server-side default revalidation no longer overwrites user-edited values.
Changes:
- Auto-prefill replay inputs by invoking
fillInputsFromExecution()when replay mode is active. - Adjust default application in
InputsForm.vueto not overwrite non-empty user values during validation cycles. - Fix replay submission
FormDataserialization to use the component instance (for$momentdate/time conversions).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui/src/components/inputs/InputsForm.vue | Stops defaults from overwriting existing input values; impacts how defaults/prefills are applied during validation. |
| ui/src/components/flows/FlowRun.vue | Adds a watcher to trigger auto-prefill when replay submission is enabled. |
| ui/src/components/executions/ReplayWithInputs.vue | Passes the component instance proxy into inputsToFormData so date/time inputs serialize correctly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function updateDefaults(): void { | ||
| for (const input of inputsMetaData.value) { | ||
| const {type, id, value, defaults} = input; | ||
| const valueOrDefault = value ?? defaults; | ||
| if (inputsValues[id] === undefined || inputsValues[id] === null || input.isDefault) { | ||
| if (inputsValues[id] === undefined || inputsValues[id] === null) { | ||
| if (type === "MULTISELECT") { | ||
| multiSelectInputs[id] = valueOrDefault; |
There was a problem hiding this comment.
updateDefaults() only initializes multiSelectInputs[id] when inputsValues[id] is undefined/null. When a MULTISELECT value is provided via v-model (e.g., replay prefill sets inputsValues[id] to a JSON string), multiSelectInputs[id] remains unset, so the <el-select multiple> won’t display the prefilled selection. Consider syncing multiSelectInputs[id] from inputsValues[id] (parse JSON string -> array) whenever multiSelectInputs[id] is empty, independent of the default-application branch.
| // Auto-prefill inputs when replaying execution | ||
| replaySubmit: { | ||
| handler() { | ||
| if (this.execution && this.replaySubmit) { | ||
| this.fillInputsFromExecution(); | ||
| } | ||
| }, | ||
| immediate: true |
There was a problem hiding this comment.
The new replaySubmit watcher calls fillInputsFromExecution() whenever execution exists, but Execution.inputs is optional (ui/src/stores/executions.ts defines inputs?: ...). If an execution has no inputs, fillInputsFromExecution() will throw on Object.keys(this.execution.inputs). Guard the watcher (or fillInputsFromExecution) with this.execution?.inputs (or default to {}) before calling.
|
Closing. The changes in this PR do not align with the intended fix for the original issue, and it appears the requirements were misunderstood. Thanks for your efforts on this 🍀 |
Summary
Fixes replay input issue - automatic prefill now works and defaults no longer overwrite user-provided values.
Changes
1. Auto-prefill on Replay
FlowRun.vueto automatically populate form with previous execution values when replay dialog opens2. Prevent Defaults Overwriting
InputsForm.vueto only apply defaults to truly empty/undefined values|| input.isDefaultcondition that was resetting user values after validationTest Results
Screen Recording (After fix)
kestra-prefill.mp4