fix(filter-builder): multi-pick id values matched nothing; hint the multi boxes

Comma-joined multi-picks matched ZERO: clauseFeed/clauseLibrary/
clauseCollection parsed each rule value as ONE uuid, but the builder's
pick loop stores several picks as a single comma-joined value
(["id1,id2"]) — uuid.Parse failed on the joined string, the id list
came back empty, and "feeds in [A, B]" matched no episodes (one pick
worked, which is why the briefing recipe survived). parseUUIDValues
now splits every value on commas (trimming) before parsing, accepting
both the builder's joined shape and hand-written separate elements —
same leniency the suggest-side id lookup already has.

The multi-value cells now say so: id-kind value inputs get the
placeholder "pick one or more" (the only boxes on the page that accept
several values; every other cell replaces its value).

Pins: comma_joined_multi_feed_matches_both — a tree collection built
with the exact comma-joined wire the client sends, asserting BOTH
feeds' episodes match. Filter-builder vitest 35/35, container filter +
episode-tree slices green.
This commit is contained in:
John O'Keefe committed 2026-11-01 00:20:31 -04:00
1 parent 09f8f0875f
commit cce488b76f
6 files changed
+78 -22

No files matched your search

+4 -2
View File
@@ -428,9 +428,11 @@ describe("id-kind value cells", () => {
);
c.resolveIdLabels();
await vi.waitFor(() => expect(c.idLabels["lib-9"]).toBe("Ebooks"));
expect(url).toContain("library=lib-9", "the stored id rides as the typed lookup");
// the stored id rides as the typed lookup
expect(url).toContain("library=lib-9");
expect(c.valueCellText([0])).toBe("Ebooks");
expect(c.suggestionsOpen).toBe("", "label resolution never opens a menu");
// label resolution never opens a menu
expect(c.suggestionsOpen).toBe("");
vi.unstubAllGlobals();
});
+9
View File
@@ -727,6 +727,15 @@ export function filterBuilderData() {
this.filterTree.children.forEach((child, idx) => visit(child, [idx]));
},
// valuePlaceholderFor — the value cell's hint. Id-kind cells are
// the few MULTI-VALUE boxes (pick several; the menu keeps toggling
// them in) — say so, because nothing else on the page does.
valuePlaceholderFor(rule: FilterRuleState): string {
if (this.fieldIsDays(rule.field)) return "days";
if (FIELD_BY_KEY.get(rule.field)?.valueKind === "id") return "pick one or more";
return "value";
},
// isIdValueRow — the value cell stores IDS (library/collection/
// feed/added_by): display needs the label map, typing filters NAMES.
isIdValueRow(path: number[]): boolean {