bug: [Flow UI/Canvas Run Viewer] State leak in For-Loop: "Run one branch" retains step data from previous iterations when switching iter-view
Describe the bug
When using a "Run one branch" component inside a For-Loop, the visual canvas in the run details does not properly clear the UI state of unexecuted branches when switching between iterations.
If Iteration 1 routes to Branch A, and Iteration 2 routes to Branch B, switching the view in the run logs from iter=0 to iter=1 correctly highlights Branch B. However, the data UI state of Branch A still displays the values from Iteration 1, even though Branch A was not executed in Iteration 2. This creates a confusing "ghost state" in the frontend, making it look like multiple branches were executed simultaneously or old data is leaking into the current iteration.
To reproduce
To Reproduce Create a flow with a For-Loop component.
Inside the loop, add a Run one branch component with at least two branches (Branch A and Branch B).
Feed the loop an array with at least two items. Configure your predicates so that Item 1 evaluates to Branch A and Item 2 evaluates to Branch B.
Run the flow.
Go to the run details and select the first iteration (iter=0) from the dropdown. You will see Branch A was executed.
Switch the dropdown to the second iteration (iter=1).
Observe the canvas: Branch B shows as executed with the new data, but Branch A still displays the step data/results from iter=0 instead of being cleared or shown as unexecuted.
Expected behavior
When switching between specific iterations in the run viewer, the visual canvas should completely reset the state for that specific iteration. Branches or steps that did not execute in the currently selected iteration should appear completely empty/dimmed. They must not display leftover data from a previously viewed iteration.
Screenshots
Browser information
No response
Application version
CE v1.721.0-27
Additional Context
Please note that the For-Loop containing the "Run one branch" component is actually nested inside another For-Loop in my flow. I am not 100% certain if this nested structure is strictly required to trigger the bug or if it also happens with a single-level loop, but it might be an important detail for reproducing the exact state leak in the run viewer canvas UI.