Clean up label-embedding architecture

- Move {id,label} stripping into _SetCriterion.from_json() so both
  MultiCriterion and ChoiceCriterion normalise at the parse boundary;
  the querying layer stays typed (list[int] / list[str]) and clean.
- Revert MultiCriterion to a thin _extra_q() override; _SetCriterion.to_q()
  is no longer duplicated.
- JS: readSearchSelect always emits {id, label} objects — no conditional
  mixed-type arrays. filter_bar.js stores them as-is for all fields,
  removing the fragile isIdField hardcoded list.
- Update tests to use the {id, label} filter format.

https://claude.ai/code/session_01EyAJcMoDktLrY9tSbdHViA
This commit is contained in:
Claude
2026-06-08 18:33:33 +00:00
committed by Lukáš Kucharczyk
parent 83cbac9505
commit d9902146dc
5 changed files with 36 additions and 78 deletions
+2 -3
View File
@@ -436,11 +436,10 @@
}
var value = pill.getAttribute("data-value");
var label = pill.getAttribute("data-label") || "";
var entry = label ? {id: value, label: label} : value;
if (pill.getAttribute("data-search-select-type") === "exclude") {
excluded.push(entry);
excluded.push({id: value, label: label});
} else {
included.push(entry);
included.push({id: value, label: label});
}
});
}