Hide list
:hide-list t, a form-level key sibling of :fields, suppresses the list while the form that declares it is open — the public reader of a post has no business seeing the table. Legal on :view-form, :update-form, and :add-form (there is no :new-form); compile error on :list-form. Omitted means show — Books stays as it is, and the writing-aid default keeps the table under an open form (the shape of an ISBN, a date, the last post is guidance). While the carrying form is open, the table, the pagination, and the record count are not rendered (half-hidden chrome would look broken); the tab with no record open still shows the list — that is what keeps a :posts type a list type rather than a page type. Per form, not per type, and not view-only: view and edit of the same type can disagree, and an author adding a post may want the last one underneath — forbidding the key on add/update would make a focused editor unspellable. A page type does not use it; it has no list.
Implemented per the plan end to end:
- Compiler (
lisp/model.lisp):*form-keys*= '(:fields :hide-list)= beside*forms*(closed set, the*ui-keys*precedent);valid-hide-listbesidevalid-form-fields— plist gate, closed key walk, key-membership presence(member :hide-list (u:plist-keys form-def))(never rawmemberon the plist — it scans values too),t=/=nilvalue rule,:list-formrejection even as explicit nil; called onfinal-deffrom both compile paths (rollupcompile-rollup-type-defaftervalid-form-fields— required enforcement there, sincevalid-rollup-matrixpermits extra keys inside:list-form; basecompile-base-type-deflikewise).valid-field-namesreserves:hide-listbeside:update/:delete=(the wire-collision guard; docstring and message rewritten to name both collision classes), covering rollups too throughvalid-rollup-fields. - Wire (
lisp/plist-json.lisp,lisp/backend.lisp):(register-json-boolean-key :hide-list)beside:hide-label(t → true, declared nil → false, never the truthy-in-JS[]);fe-fieldsappends(list :hide-list value)after the field loop only under key membership —appendof a nil tail is a no-op, so an undeclared form stays byte-identical (neveradd-to-plist; its(or new old)overlay cannot pin a new nil, the stage-3:page-description-opentrap)./api/itempicks the flag up for free (recreturnsfe-fieldsverbatim under:fields).list-result's splice andadd-roles-to-viewwere untouched; present-nil survives the pipeline (pinned by tests, incl. theaugment-update-formbutton-status rewrite with bothtandnil). - Frontend (
web/src/App.tsx): module-levelformFieldKeys(Object.keysminus'hide-list',Record<string, any>so theField-typed wire value assigns structurally) now feeds every form key walk —buildChipFieldMeta,openEditForm's enabled-when walk,handleAction/submitFormpassword + actionData + file-field loops, the multipart POST 1 loop, and the two submission whitelists (own-propertySetmembership replaceshasOwnProperty.call, keeping the prototype-chain protection while excluding a seededformValues['hide-list']from ever riding to the server); the label-gutterformMetawalk, the field.mapkey set, and the:file-pathsibling lookup route through it too. One derivedhideListbesideopenFormNameresolves the open form with the renderer's own precedence (isEditModebeforeshowAddForm) and reads the flag with strict=true (absent,false, legacy[]all mean show); exactly two render gates — the<table>and the<div className"list-footer">= (pagination + record count together, the no-half-hidden-chrome rule). Chrome rows untouched (their!(showAddForm || isEditMode)gate already covers View viaisViewMode→isEditMode). List fetch untouched (render-only).tsc+vite buildclean (354.85 kB). - Fixture + tests:
models/test/hide-list-test.lisp(:postsdeclares:hide-list ton view/add and an explicit nil on update — the disagree-forms case;:draftsdeclares nothing — the byte-safety control;:bodycarries:searchable tfor the browser pass);tests/hide-list-tests.lisp(compile suite bare, wire suite in(with-model "hide-list-test" #'hl-seed-fixture)— the seeder lives in the test file, 21 posts + 1 draft);data-ui.asdregistration,run-hide-list-testsintests/helpers.lisp+ therun-teststable. Rollup tests build on a proven-valid:wt-notesfact-table rollup (positive control) with message-matched assertions; the:view-form tmalformed-shape test pins the live-probed error class (valid-form-fields'tree-getdies inside u:tree-get with "Expected a plist." before valid-hide-list runs). - Docs:
docs/model-reference.md— forms section rewritten around the two-key closed set with the full:hide-listparagraph, the reserved-field-name note built from scratch near Core field keys, and a new ****Form:**** line in the quick key index;docs/rest.md—GET /api/listdocuments thehide-listJSON boolean and its/api/itemride. - Verification: full suite via
scripts/data-ui tests: 2320 checks, 45 groups, all passed. Live dev-REPL probes confirmed emission on both types and thefalseJSON spelling. The plan's browser-smoke pass (View a post → table/pagination/count gone, search row visibly absent via the searchable body field, Close → back without refetch, View→Edit transition, drafts' omitted-means-show under an open Add form, page-2 footer) is not machine-executable — no JS test harness exists; the fixture is loaded in the development image for it.
Notes: hide-list-notes.org
Plan: hide-list-plan.org
- Slot
- 3600
- Status
- 60 Done
- Tags
- mvp, frontend, model, compiler
- Contributors
- Donnie, Rose, Grok
- Plans
- Hide list — implementation plan (2), Hide list — implementation plan (synthesized), Hide list — implementation plan