feat(ui): add trigger word highlighting for selected LoRAs

- Import applySelectionHighlight in lora_loader and lora_stacker
- Pass onSelectionChange callback to loras_widget to handle selection changes
- Implement selection tracking and payload building in loras_widget
- Emit selection changes when LoRA selection is modified
- Update tags_widget to support highlighted tag styling

This provides visual feedback when LoRAs are selected by highlighting associated trigger words in the interface.
This commit is contained in:
Will Miao
2025-11-07 16:08:56 +08:00
parent f76343f389
commit 388ff7f5b4
6 changed files with 350 additions and 22 deletions

View File

@@ -11,6 +11,7 @@ import {
} from "./utils.js";
import { addLorasWidget } from "./loras_widget.js";
import { applyLoraValuesToText, debounce } from "./lora_syntax_utils.js";
import { applySelectionHighlight } from "./trigger_word_highlight.js";
app.registerExtension({
name: "LoraManager.LoraLoader",
@@ -178,7 +179,10 @@ app.registerExtension({
this.lorasWidget = addLorasWidget(
this,
"loras",
{},
{
onSelectionChange: (selection) =>
applySelectionHighlight(this, selection),
},
(value) => {
// Prevent recursive calls
if (isUpdating) return;