Page type (editable content pages)
Prose an app user is meant to edit — About page, house style guide, landing blurb — as data, not model text: a content type holds one row per page (markdown body, :identity t slug, edited in-app under RBAC), and a :page t projection type renders one selected row as a full page in the type selector — no list chrome, always expanded, empty state when the row does not exist yet. Static :page-description (above) stays the author-prose counterpart; tabs remain model-declared — a page without a tab is just a row. v1 is a read-only projection; in-page editing waits on the per-field editability machinery. Naming settled 2026-10-21: :page t survives the collision check — pagination's page lives only in query-param / wire namespaces, never a model keyword (keep any future types-payload wire key from being named page). :page-description on a :page t type is a compile error: the page's content is the description, and a collapsible intro on top of a full page is noise. Amended 2026-10-21 after the View form discussion: a page type requires :view-form (compile error, the rollup-requires-:list-form precedent) and renders it as the page — the reader may not hold read on the content type, so the page cannot borrow its forms. A page type declares no :list-form (compile error if it does; absent :list-form is already structurally list-less today, so no suppression mechanism is needed), does not use :hide-list, and has no list to hide.
Notes: page-type-notes.org Plans: page-type-plan-kimi.org, page-type-plan-grok.org
Plan: page-type-plan.org
Implemented from the plan (all of it; every step). Compiler: compile-type-def dispatches :page t (sole declaration; :page nil and :page=+:rollup= are errors) to the new compile-page-type-def; valid-page-matrix rejects the incompatible-key set by membership (including author copies of the compiler-owned :page-table / :page-columns / :page-where / :page-params — the add-to-plist :page-params nil-merge trap — and :page-description on a page); the :filter contract is the shared 4-tuple validator with a page storage check (stored scalar columns only — declared type is not storage) plus the identity-set rule: the :eq-pinned fields must be exactly the content type's whole :identity t set, so one pinned column of a composite index is an error and a :target identity field is unpinnable (message names the field); :eq on non-identity columns and :ne / :last-days / :calendar are ride-alongs (the plan's canonical fixture and mixed-numbering probe require them). Fields are hand-built presentation overlays (no compile-field), finalized through finalize-ui with a positive widget allowlist and content-type rules; :view-form required, :list-form / :add-form / :update-form forbidden; the :id pass-through is injected (no :ui, so fe-fields never emits it). Stage-2 fully widened (one page binding in every unless — the six-key remove-null-value-pairs filter cannot rescue the non-nil phantom rt_about DDL the unwidened builders emit) and computes the runtime query parts: :page-where is parameterized ($n binds, never embedded quotes; booleans as the four truthiness forms; clock shapes for :last-days / :calendar), :page-columns is the View-form projection + id capped, aliased via to-sql-identifier. Backend: page-be-list (one select, limit 2 backstop, two rows report-e, ignores its form argument on purpose — rest-list's :init-form "list-form" default is why), be-list page arm beside measure-p (the already-landed authorization arm is now true), list-result with :skip-allowed-values t and :page-type :true by append; valid-non-rollup-type-key widened to reject :page (write / item / validate / action endpoints), a page-only guard in be-list-column (rollup /api/column stays legal — pinned by existing tests), rest-upload invokes the guard right after parse-type (deterministic 400 before nil-field work), public-type-p excludes pages (the /p/ renderer reads :views :main :sql, which a page has none of). Wire: be-types / rest-types emit page-type keyword-encoded, only when true. Frontend (App.tsx only): pageType on TypeInfo, the bare-URL fetchList branch (skips the whole request build — URL-seeded filters would 400), the page body in the dead shell (Loading / error / "This page has not been written yet." / FieldRow +=renderReadOnlyField= with isViewForm, gated on the envelope's type-key), the record-arrival effect's page guard, and ListResponse's list-form made optional (two non-null assertions at list-render sites). Fixture models/test/page-type-test.lisp (worked :pages / :about pair + :other-page NULL-exclusion + :draft-page not-form + :guide clock/empty + :blurb public-eligible control, :guest-allowed t + widened :api-roles + :landing-page :about); suite tests/page-type-tests.lisp (compile-error / compile-success / behavior groups, 136 checks, including the rest-upload 400 via the atr-style stub harness and the form-ignore pin through a parameterless fake request). Deviations from the plan, all forced by the code: the fixture's content fields need the house :column t / :source idiom (the plan's sketch omitted it; a field without :column t is genuinely virtual and the storage check correctly rejects it), the :guide :last-days value is 1825 (the shared validator caps at 1825; the plan's 3650 would not compile), and the identity rule allows :eq ride-alongs on non-identity columns (the plan's own worked model (:pages :published :eq t) requires it; the ":eq on a non-identity column" error pin is probed as a filter whose every :eq is a ride-along). Docs: model-reference "Page types" section + type-key rows + index, rest.md (/api/types page-type, /api/list page behavior, column / upload rejections), roles.md (page paragraph under "Tab visibility is a reuse"). Verified: 136/136 page-type checks in-image, the eight neighbor suites green, npm run build clean, browser smoke as guest (landing :about paints, markdown renders, no list chrome; guide shows the empty state) and as editor (edit :pages → fresh :about read shows it), clean console; final gate scripts/data-ui tests — all 3898 checks across 57 groups.
- Slot
- 6100
- Status
- 60 Done
- Tags
- mvp, frontend, model, compiler
- Contributors
- Donnie