Context
B2 added field-level conditional rules authored as CEL: visibleWhen / readonlyWhen / requiredWhen (+ deprecated conditionalRequired). Today a low-code author can only type a raw CEL string into the field config — no validation, no field-name help.
Goal
In Studio's metadata-admin field-config form, give each *When property a proper CEL editor:
- Inline syntax/semantic validation as you type.
- Field-name autocomplete scoped to the object's fields (and
record.* / previous.* / parent.*).
- Clear error surfacing when a predicate is invalid.
Reuse (don't reimplement)
@objectstack/formula already exports the validators the server uses:
validateExpression(...) — parse + semantic check.
introspectScope(...) / expectedDialect(...) / CEL_STDLIB_FUNCTIONS.
Wire these into the Studio form widget rather than writing a parallel checker. See the objectstack-studio-admin skill for how metadata types map fields → form widgets and how to register a custom widget per property.
Scope notes
- objectui-side:
packages/app-shell/src/views/metadata-admin/* (field/object config forms).
- Needs objectui to consume the
@objectstack/formula version that exports the validators (already a dep via core).
Acceptance
- Editing an object field in Studio, the three
*When inputs validate live and autocomplete field names.
- An invalid predicate blocks save (or warns) with a readable message.
- Round-trips: a rule authored in Studio persists and is honored at runtime (form + grid).
Context
B2 added field-level conditional rules authored as CEL:
visibleWhen/readonlyWhen/requiredWhen(+ deprecatedconditionalRequired). Today a low-code author can only type a raw CEL string into the field config — no validation, no field-name help.Goal
In Studio's metadata-admin field-config form, give each
*Whenproperty a proper CEL editor:record.*/previous.*/parent.*).Reuse (don't reimplement)
@objectstack/formulaalready exports the validators the server uses:validateExpression(...)— parse + semantic check.introspectScope(...)/expectedDialect(...)/CEL_STDLIB_FUNCTIONS.Wire these into the Studio form widget rather than writing a parallel checker. See the
objectstack-studio-adminskill for how metadata types map fields → form widgets and how to register a custom widget per property.Scope notes
packages/app-shell/src/views/metadata-admin/*(field/object config forms).@objectstack/formulaversion that exports the validators (already a dep via core).Acceptance
*Wheninputs validate live and autocomplete field names.