Skip to content

Fix: Auto-prefill inputs for replay operations#15460

Closed
nancysangani wants to merge 5 commits intokestra-io:developfrom
nancysangani:fix/15334-replay-prefill-inputs
Closed

Fix: Auto-prefill inputs for replay operations#15460
nancysangani wants to merge 5 commits intokestra-io:developfrom
nancysangani:fix/15334-replay-prefill-inputs

Conversation

@nancysangani
Copy link
Copy Markdown
Contributor

Summary

Fixes replay input issue - automatic prefill now works and defaults no longer overwrite user-provided values.

Changes

1. Auto-prefill on Replay

  • Added watcher in FlowRun.vue to automatically populate form with previous execution values when replay dialog opens
  • Values now appear without manual "Prefill inputs" button click

2. Prevent Defaults Overwriting

  • Modified InputsForm.vue to only apply defaults to truly empty/undefined values
  • Removed || input.isDefault condition that was resetting user values after validation

Test Results

  • Prefilled values appear automatically on replay dialog open
  • Modified values persist after form validation
  • Replay execution uses the custom input values

Screen Recording (After fix)

kestra-prefill.mp4

Copilot AI review requested due to automatic review settings April 8, 2026 18:25
@github-project-automation github-project-automation Bot moved this to To review in Pull Requests Apr 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.vue to not overwrite non-empty user values during validation cycles.
  • Fix replay submission FormData serialization to use the component instance (for $moment date/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.

Comment on lines 410 to 416
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;
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +274 to +281
// Auto-prefill inputs when replaying execution
replaySubmit: {
handler() {
if (this.execution && this.replaySubmit) {
this.fillInputsFromExecution();
}
},
immediate: true
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@MilosPaunovic MilosPaunovic added area/frontend Needs frontend code changes kind/external Pull requests raised by community contributors labels Apr 9, 2026
@Piyush-r-bhaskar
Copy link
Copy Markdown
Contributor

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 🍀

@github-project-automation github-project-automation Bot moved this from To review to Done in Pull Requests Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend Needs frontend code changes kind/external Pull requests raised by community contributors

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Prefill doesn't work for Replay using Modify inputs

4 participants