fix(central-ui): Flow Debugger — remount ParameterValueForm per script so stale form state cannot block Run
Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
This commit is contained in:
@@ -235,7 +235,12 @@
|
||||
else
|
||||
{
|
||||
<div data-test="flow-script-params">
|
||||
<ParameterValueForm ParameterDefinitions="@script.ParameterDefinitions"
|
||||
@* Keyed on the script so a change of script REMOUNTS the form: its raw
|
||||
text and parse errors are per-instance state that must not survive
|
||||
(and two scripts may even declare byte-identical definitions, which
|
||||
would otherwise skip the reparse and its ValidChanged entirely). *@
|
||||
<ParameterValueForm @key="@script.CanonicalName"
|
||||
ParameterDefinitions="@script.ParameterDefinitions"
|
||||
Values="_scriptParams"
|
||||
ValuesChanged="@(v => _scriptParams = v)"
|
||||
ValidChanged="@(ok => _scriptParamsValid = ok)" />
|
||||
|
||||
@@ -330,6 +330,11 @@ public partial class FlowDebugger : ComponentBase, IDisposable
|
||||
ResetResult();
|
||||
_predicted = null;
|
||||
_state = FlowState.Idle;
|
||||
// Inputs are per-entry-point, as in OnScriptChangedAsync: never carry a script's value or
|
||||
// parameter tree (or its validity) across a switch of entry kind.
|
||||
_scriptParams = new();
|
||||
_scriptParamsValid = false;
|
||||
_valueChangeValue = string.Empty;
|
||||
await PersistAsync(StorageEntry, entry.ToString());
|
||||
if (_entry == EntryKind.Method && _selectedMethodId > 0)
|
||||
await OnMethodChangedAsync();
|
||||
|
||||
Reference in New Issue
Block a user