Context
Follow-on to B2 (conditional rules). A very common enterprise-form need: a select/lookup whose available options depend on another field — e.g. pick a Country, then State only lists that country's states; or Status filters the allowed next-Status set.
Goal
A CEL-driven option filter, same dual-side philosophy as B2 (client UX + server enforcement, one dialect):
- Spec: add an
optionsWhen / option-filter predicate to the field schema (framework @objectstack/spec).
- Client (objectui): the select/lookup widget re-evaluates the option set reactively against the live record (reuse
@objectstack/formula via the evalFieldPredicate path).
- Server: enforce that a submitted value is within the allowed set (reject otherwise), so the client filter isn't bypassable.
Cross-repo
- framework: spec prop + server-side validation (
@objectstack/objectql rule path, alongside requiredWhen/readonlyWhen).
- objectui: select/lookup widget filtering +
ObjectForm/grid passthrough.
Open questions
- Static option list filtering vs. lookup (query-backed) filtering — likely both, but lookup needs the predicate folded into the query filter.
- Authoring shape: predicate over
record.* returning the allowed value set, vs. a per-option visibleWhen.
Acceptance
- Showcase demo: a cascading pair (e.g. category → subcategory) where changing the parent re-filters the child options live.
- Server rejects an out-of-set value.
- Live e2e + ADR.
Context
Follow-on to B2 (conditional rules). A very common enterprise-form need: a select/lookup whose available options depend on another field — e.g. pick a Country, then State only lists that country's states; or Status filters the allowed next-Status set.
Goal
A CEL-driven option filter, same dual-side philosophy as B2 (client UX + server enforcement, one dialect):
optionsWhen/ option-filter predicate to the field schema (framework@objectstack/spec).@objectstack/formulavia theevalFieldPredicatepath).Cross-repo
@objectstack/objectqlrule path, alongsiderequiredWhen/readonlyWhen).ObjectForm/grid passthrough.Open questions
record.*returning the allowed value set, vs. a per-optionvisibleWhen.Acceptance