fix: make key_name selection sticky, never auto-reset

The key_name combo now only updates its dropdown options from the API
but never changes the user's selected value. Only the output value
refreshes on execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-20 21:01:03 +01:00
parent 6e232da193
commit bf598ebf80
+2 -5
View File
@@ -161,14 +161,11 @@ app.registerExtension({
this._availableKeys = data.keys; this._availableKeys = data.keys;
this._availableTypes = data.types; this._availableTypes = data.types;
// Update key_name combo values // Update key_name combo options only — never change the selection
const keyWidget = this.widgets?.find(w => w.name === "key_name"); const keyWidget = this.widgets?.find(w => w.name === "key_name");
if (keyWidget) { if (keyWidget) {
keyWidget.options.values = data.keys; keyWidget.options.values = data.keys;
// Keep current selection if still valid // Selection is sticky: user must change it manually
if (!data.keys.includes(keyWidget.value)) {
keyWidget.value = data.keys[0] || "";
}
this._applyKeySelection(); this._applyKeySelection();
} }
} catch (e) { } catch (e) {