Data UI Backlog

Same-target filter semantics

Two :filter-with :reference fields on one type can share a target (:assigned-to and :reviewer, both → :users). Filtering on both is useless today: fetchList emits one target-keyed :in row per selected field (["users","name","in",[…]] carries no field identity), the backend joins the target table once, and add-where-clause ANDs every row through that single joined column — disjoint selections read as users.user_name IN ('admin') AND users.user_name IN ('guest') and match nothing. The honest v1 contract (AND through the shared join column) is documented in model-reference.md's :filter-with row and pinned by a dev-REPL probe (admin/guest rows seeded, two same-target rows → :total 0); no Lisp test pins two same-target rows.

The fix is the joined-column-aliasing relaxation: join the target once per field under distinct SQL aliases and carry field identity through the wire so each filter row constrains its own alias (per-field AND, satisfiable). The wire row shape cannot say which field a constraint belongs to, so this is a breaking filters change — version or extend the row shape deliberately, and move docs/rest.md, parse-filters, and fetchList's chip emission together.

Not a union: aliasing enables per-field AND; whether cross-field same-target rows should also express OR is a separate semantics decision the aliasing work enables but does not make. Surfaced by the clickable-reference-chips plan (clickable-reference-plan.org), whose docs correction first stated the contract; "Sort by :target field display column" (MVP Now) shares the joined-column machinery but is a different ask.

Slot
16800
Status
10 Open
Tags
backend, frontend
Contributors
Donnie