Static drop-down list :ui hint
Add a :ui hint (e.g. :widget :select with a static
:options list) that lets model authors define a fixed set of
dropdown values without needing a separate type or database table.
Useful for fields like status, priority, category, etc.
Commit: 2eea9a1 Static dropdown.
Files changed:
lisp/model.lisp— 4 additions:valid-options-value— validates:optionsshape (non-empty list of non-empty strings) and widget compatibility (:selectonly)v-options— runtime validation function; rejects values not in the options list (skips nil/=:null=)compile-validations— pushes#'v-optionswhen:ui :optionsis presentcompile-fieldfinally block — exclusivity check (:options+:target=/:join-table= → error) and bare-select check (:selectwithout:optionsor:target→ error)preliminary-model-check— allows:options(a list value) under:ui
lisp/backend.lisp— 2 changes:allowed-values-for-field— short-circuits with static options when present (no DB lookup)allowed-valuesgate — includes fields with:ui :optionsalongside:target=/:join-table=
tests/static-options-tests.lisp— new suite, 17 tests covering compile (happy + 7 reject cases), read path (3), and write path (6)tests/helpers.lisp—run-static-options-tests+ added torun-testsdata-ui.asd— registeredstatic-options-testsdocs/model-reference.md+AGENT.md— documented:options, both:selectmodes, exclusivity rules
Test results: 20/20 static-options checks pass. Backend (346), predicates (77), widget (31), and action (20) suites all green — no regressions.
Zero frontend changes needed — the existing allowed-values[fieldKey] → <option> mapping in App.tsx handles static options out of the box, exactly as the plan predicted.
- Slot
- 23900
- Status
- 60 Done
- Tags
- mvp, frontend, model
- Contributors
- Donnie