:ui key whitelist and :filter-with :boolean list filter
Implemented per ~/workbench/filter-with-plan.org (no deviations):
Compiler (
lisp/model.lisp):*ui-keys*closed set (= :label :widget :read-only :precision :options :table :filter-with=);valid-ui-keyskeeps the dead-alias hint ("Use:widgetinstead.") ahead of the generic unknown-key error naming the legal set. Newreport-vevalue checksvalid-label-value(string),valid-precision-value(number, no type gate),valid-table-value(keyword;:tablestays authorable,fe-fieldsoverwrites on the wire),valid-filter-with-value(:boolean), all called fromfinalize-ui.compile-fieldgate (beside:searchable)::filter-withrequires value:boolean,:type :boolean, and:column t(resolvedcolumnbinding, so a:targetfield fails the type check).REST (
lisp/rest.lisp,parse-filtersonly): the strings":true"/":false"coerce to keywords when the field is:type :boolean; non-boolean fields keep the raw string. Yes/No filters now return 200 (verified live via curl: total 1 each on seeded true/false todos; was 400 for every encoding before).Frontend (
web/src/App.tsx):filter-with?: stringonField;boolFiltersstateRecord<string,'yes'|'no'>(absence = Any); discovery scans the wholelist-form(notlistFields); rows append[type,field,"eq",":true"|":false"]infetchList; one labeled Any/Yes/No<select>per field on the toolbar (render condition gainsboolFilterFields.length > 0);resetListQueryclears them;anyFilterActiveand Clear filters include them;useEffectdep added.npm run buildran via directtsc+viteinvocations (npm binary is absent on evo-x2; same commands as thebuildscript).Tests (
tests/widget-tests.lisp): unknown:uikey, keyword:label, string:precision, string:table,:filter-with :select,:filter-with :booleanon:text/ no-:columnrejected;:filter-with :booleancompiles and survives into the compiled:ui;filter-with-wire-valuetripwire (parse-filterscoercion +valid-filtersfinishes). Suite: 57/57 pass,widget-all-models-compileincluded (all models- fixtures clear the whitelist). Sortable + searchable suites
re-run green (adjacent compile-field territory).
Docs (
docs/model-reference.md)::uisubkeys section — closed-set language, per-key value rules,:filter-withrow,:tablerewritten (authorable keyword, overwritten on the wire).
Wire verified live: fe-fields emits "filter-with":"boolean" on the :done field of an in-memory todos variant; plist-to-json renders the same. Browser pass (Verification step 5) still owed — needs a real model carrying a :filter-with :boolean field; none exists yet.
Closes "Validate :ui hints" (that item's scope for known keys is now implemented; leaving its heading for Donnie to confirm and retire).
Plan: filter-with-plan.org.
- Slot
- 1100
- Status
- 60 Done
- Tags
- mvp, backend, frontend, model, compiler, bug
- Contributors
- Donnie