Type-level :page-description
New type key :page-description "<markdown>": explanatory text at the top of a type's page. Not just for blogs — a user landing on a rollup board often needs a sentence about what they are looking at. Renders with the shared markdown renderer (Markdown widget item, DONE 2026-10-21).
- List mode only (settled 2026-10-21, revising "all modes"): add / edit / view forms drop the block entirely. The description orients at the collection entry point; forms are about one record, and per-field guidance is the Field help text item's job (
:help). Shared links seed a type, never a form, so no deep-link arrives missing list-mode context. - Default state collapsed, with a clearly visible expand affordance (hint / button, e.g. an info glyph — no field-name label). Companion key
:page-description-open t(name settled 2026-10-21 — collision check clean) defaults the block to expanded for pages where the text should be read first.:page-description-openwithout:page-descriptionis a compile error; non-string or empty-string:page-descriptionis a compile error. - Placement: top of the type's list page — above the Add / Delete-Selected row, which sits above the search / filter toolbar (page intro precedes transient controls). Toggle state is React state only: resets to the model default on reload, no persistence.
- Transport: static per-type model text rides the type entry in the
/api/typespayload, not the records. Minimal payload: keys emitted only when the author declared them. RBAC scoping free — a user without read on the type sees no entry at all.
Plan: page-description-plan.org
Implemented per the plan (rev 5) end to end:
- Compiler (
lisp/model.lisp):valid-page-descriptionbesidevalid-default-sort— blank test is(> (length (string-trim …)) 0)(the plan'spluspapplies to strings, not lengths; caught in the first live probe); rejections for:user-setting,:display nil, base types omitting:display, and:internal t(the can-never-render / never-reaches-wire bucket), each with its own message;memberpresence tests throughout (present-nil is an error on:page-description, a legal explicit false on:page-description-open). Called fromcompile-base-type-def(before thelet*, raw author def) andcompile-rollup-type-def(right aftervalid-rollup-matrix, raw def) — the rollup path is a first-class consumer. Stage-3 re-emits declared keys after the last merge (remf + re-emit; values captured before the remf — type-def and the model entry are the same object there, a bug the plan's snippet had and the first stage-3 probe caught);stage-3'sfor type-def in (cdr model)became(getf model type-key)for that purpose. - Wire:
be-typesemits:page-descriptionundergetf(safe by validator contract) and:page-description-openundermember(explicit nil rides);rest-typeskeyword-encodes the companion:true=/:false(the []-is-truthy rule);(register-json-boolean-key :page-description-open)inplist-json.lisp. Verified live:/api/typesshowsnotes→"page-description-open":true,collapsed→ presentfalse,plain→ neither key, display-less rollupboard→ description rides. - Frontend: new
web/src/PageDescription.tsx(bordered pill "ℹ️ About this page",aria-expanded, sharedMarkdown);TypeInfogainspageDescription/pageDescriptionOpen(=true= split preserves declared false); App-level per-typepageDescOpenmap (survives list refetches, cleared byresetSessionState); rendered above the Add row in the main list return and in the "No records" early-return shell (the empty list is the page the description orients), guarded!(showAddForm || isEditMode)at both sites.tsc+vite buildclean (352.76 kB bundle). - Fixture
models/test/page-description-test.lisp(:notes open-t, :collapsed explicit-nil, :plain bare, :board display-less rollup — :notes/:collapsed/:plain share the markdown-test :posts shape; the board needed a :user :target field for the grain→fact xref path);tests/page-description-tests.lisp(35 checks: validator probes, both compile paths throughcompile-modelasserting the stage-3 splice,be-typesmember checks, the rest-types keyword shape,plist-to-jsonfalse serialization). Two test-side stumbles worth noting: compile probes must pass the:typesplist itself tocompile-model, and a rollup probe's fact table may not be the grain. Registered indata-ui.asd;run-page-description-testsintests/helpers.lispadded torun-tests. - Docs:
:page-description/:page-description-openrows in the type-key table (+ the:category :settingsboundary and visibility rule), both keys in the Quick key index;GET /api/typesentry indocs/rest.mdnow describes the whole payload. - Full suite via
scripts/data-ui tests: 2134 checks, 40 groups, all passed.
- Slot
- 2900
- Status
- 60 Done
- Tags
- mvp, frontend, model, compiler
- Contributors
- Donnie