Files
DumiFlex-ComfyUI-Wildcard-P…/docs
DumiFlex 51db05620d feat(spa): wire the booru tag autocomplete into the editor
Completes #27. Typing a word in an option value now suggests tags; `$` and `@`
are untouched.

Non-interference is structural, not coordinated. The tag mode is a third value
on the SAME `acTrigger` state, so only one popover can exist -- two independent
popovers could both open over one caret, which is the behaviour this feature
was not allowed to introduce. And it is probed only where `probeAutocomplete`
already declined the caret, so the sigil probe gets first refusal on every
keystroke. `probeTagWord` re-checks for a preceding sigil as a second lock, and
19 tests assert the two probes never both claim a caret.

Commit inserts PLAIN TEXT. `$`/`@` build chips because they carry engine
meaning; a tag is just characters in a prompt. Deliberately not a branch inside
`insertChipAtCaret` -- its defensive re-derivation scans backwards for a
`$`/`@` run, which is exactly wrong for a sigil-less word.

Rows follow the design pass: the line that gets INSERTED is always primary, so
an alias hit reads `head_tuft` with `from blue_head_tuft` beneath rather than
leading with the alias, which is not what Enter produces. The category bar
appears only when the loaded file has categories, and the legend only when the
results actually differ -- a column of identical grey bars explains nothing.

Three bugs found by QA against the real SPA, none of which any test caught:

- `useUiStore()` at setup scope threw in 113 existing tests, which mount this
  component without Pinia. Every other setting arrives as a prop, so the store
  dependency was the odd one out as well as the broken one; it is now resolved
  lazily and degrades to "off" when Pinia is absent.
- The popover renders on `acOpen && acItems.length > 0`, and tag mode returns
  no `acItems` by design, so it could never appear. Now gated on the row count
  for whichever mode is active.
- The "shared" status promise was a `let` inside `<script setup>`, which
  compiles into `setup()` and is therefore per-instance: 135 identical requests
  on a 133-option wildcard. Moved to a real module -- measured 135 -> 1.

Verified in the running SPA: the popover opens with 20 real rows from a
286,337-entry list, Enter completes `blue_h` to `blue_hair` as plain text with
zero chips, and typing `$mood` shows no tag rows at all.
2026-08-06 22:00:21 +03:00
..