feat(lora-loader): add trigger word update on LoRA syntax edits

Add test coverage for trigger word refresh functionality when LoRA syntax is edited in the input widget. The test verifies that after modifying LoRA syntax in the input field, the connected trigger words are properly updated to reflect the active LoRAs.

Additionally, implement the actual trigger word update logic in lora_loader.js by calling updateConnectedTriggerWords after merging LoRAs, ensuring the UI stays synchronized with the current LoRA state.
This commit is contained in:
Will Miao
2025-11-03 12:03:21 +08:00
parent 56ea7594ce
commit 707d0cb8a4
2 changed files with 134 additions and 0 deletions

View File

@@ -178,6 +178,9 @@ app.registerExtension({
const mergedLoras = mergeLoras(value, currentLoras);
this.lorasWidget.value = mergedLoras;
const allActiveLoraNames = collectActiveLorasFromChain(this);
updateConnectedTriggerWords(this, allActiveLoraNames);
} finally {
isUpdating = false;
}