diff --git a/web/app/dashboard/ai-workflows/_components/node-config-panel.tsx b/web/app/dashboard/ai-workflows/_components/node-config-panel.tsx index f8b976f..e797869 100644 --- a/web/app/dashboard/ai-workflows/_components/node-config-panel.tsx +++ b/web/app/dashboard/ai-workflows/_components/node-config-panel.tsx @@ -241,6 +241,7 @@ export function ConditionBranchConfigPanel({ options={targetOptions} placeholder="选择目标节点" triggerClassName={inspectorComboboxClassName} + preserveExternalSelection onChange={(targetNodeId) => updateBranch({ ...branch, targetNodeId })} /> @@ -346,6 +347,7 @@ function ConditionBranchesEditor({ options={targetOptions} placeholder="选择目标节点" triggerClassName={inspectorComboboxClassName} + preserveExternalSelection onChange={(targetNodeId) => onChange({ ...branch, targetNodeId })} /> @@ -418,6 +420,7 @@ function ConditionFields({ options={CONDITION_OPERATOR_OPTIONS} placeholder="选择操作符" triggerClassName={inspectorComboboxClassName} + preserveExternalSelection onChange={(operator) => onChange({ ...branch, condition: { ...condition, operator }, @@ -435,6 +438,7 @@ function ConditionFields({ }))} placeholder="选择取值" triggerClassName={inspectorComboboxClassName} + preserveExternalSelection onChange={(nextValue) => { const selectedOption = valueOptions.find((option) => stringifyConditionRight(option.value) === nextValue) onChange({ diff --git a/web/app/dashboard/ai-workflows/_components/variable-selector.tsx b/web/app/dashboard/ai-workflows/_components/variable-selector.tsx index 018f6e2..3aa9c77 100644 --- a/web/app/dashboard/ai-workflows/_components/variable-selector.tsx +++ b/web/app/dashboard/ai-workflows/_components/variable-selector.tsx @@ -33,6 +33,7 @@ export function VariableSelector({ options={options} placeholder={placeholder} triggerClassName={triggerClassName} + preserveExternalSelection onChange={(next) => { const variable = variables.find((item) => `${item.nodeId}.${item.field}` === next) if (variable) { diff --git a/web/components/option-combobox.tsx b/web/components/option-combobox.tsx index 87c9030..e2fec98 100644 --- a/web/components/option-combobox.tsx +++ b/web/components/option-combobox.tsx @@ -35,6 +35,7 @@ type OptionComboboxProps = { emptyText?: string disabled?: boolean triggerClassName?: string + preserveExternalSelection?: boolean onChange: (value: string) => void renderOptionAction?: (option: ComboboxOption) => ReactNode } @@ -47,6 +48,7 @@ export function OptionCombobox({ emptyText, disabled = false, triggerClassName, + preserveExternalSelection = false, onChange, renderOptionAction, }: OptionComboboxProps) { @@ -70,7 +72,11 @@ export function OptionCombobox({ {selectedLabel} - +