Embedded child region
The blog/forum gap. A parent type's :view-form declares :children ((:type :comments :via :post :sort (:created-at :asc))) — child type, the child's FK back to the parent, fixed sort. :type and :via are required; :sort defaults to (:created-at :asc), document order, and is not inherited from the child's :default-sort. :via must be a :target field aimed at the declaring type. :children is legal only on :view-form, and it requires :hide-list t on that same form. The frontend renders the region under the parent's view form as a mini list page: chopped markdown rows, its own pager, row click expands in place to the child's view-form fields, an inline Add form gated on the child's create flag with the FK preset to the parent's id and hidden, and a Reply control inside the expansion that opens that same Add with the quoted comment pre-filled (one quote level, attribution composed from the record). Reply and Add write byte-identical rows. Reply context is prose, never a stored reply-to link.
The region reads; the comments tab finds. The region is oldest-first and has no search. The tab is newest-first (:default-sort (:created-at :desc)) and owns search, sort, and chips. The region's "All N comments »" is committed v1 scope: it lands on the comments tab scoped to this post, in its own URL dimension — not in listFilters, which emits display-column has-all and cannot say child-of-this-row. That scope needs the one backend addition, the fk-eq filter operator, which compares the FK's storage column. Empty and no create renders nothing; a failed fetch renders an error, never silence.
Comments have no title and no :identity t field (a unique index would make "Nice post!" exist once). body is :widget :markdown and :searchable t. Permission recipe: :new-roles (:comments-user ("create" "read")) with :type-roles ("public" "comments-user") on :comments and :type-roles ("public") on :posts / :tags — flat role-name strings only (amended 2026-11-01 after plan review: ensure-model-roles forwards :type-roles entries to RBAC and list-result emits them verbatim onto the wire, so the nested (role :create :read) spelling both breaks the RBAC attach and leaks into insert payloads; permissions ride :new-roles, the new-roles-test pattern). Guests read, members post, creator edit/delete is row-only. Author filtering on the tab is "Reference-field chip picker" (DONE); no dependency either direction. Threading is parked.
Hard dependencies, all DONE: "Type-level check on row writes", "Row click replaces View/Edit icons", "Hide list", "Timestamp field overrides".
Restructured 2026-11-01 into four numbered children, one per stage of the plan's Steps; its step 3 (renderer plus escape hatch) is divided between children 3 and 4 because the two halves touch disjoint risk surfaces — region-local state vs the URL grammar. Ordering constraint: (1) → (2) → (3) → (4). Do not start (3) before (1) and (2) exist, or the region will invent a second filter spelling. (4)'s scope machinery is tab-side and needs only (1), but its footer link and its acceptance script both need (3), so it stays last. Amended 2026-11-01 when the plan was split: each child carries its own plan file (linked below), and the original plan file is now the overview only — ordering and the shared-contract index; the spec text lives in the per-item plans, not here. The cross-item contracts sit in those files: the fk-eq spelling in 01, the be-rec attachment and the blog-test fixture in 02. Between (2) and (3) a :children spec rides be-rec's :view-form payload with no consumer: inert by design, no model declares it yet, harmless. rec stays clean.
Notes: blog-surface-notes.org — history only; the plan is complete without it. Plan: blog-surface-plan.org — overview only since the 2026-11-01 split: ordering and the shared-contract index; the spec text lives in the per-child plan files linked below.
Implemented across the four children above (each DONE with its own plan link and summary), plus a review-driven reply-quote overhaul from the 2026-11-03 manual pass: nested quote depth (each reply generation one level deeper, quoteLine depth+1 — depth is speaker identity), a bare > separator after attribution, a trailing blank line + caret-at-end focus + =separateQuotes submit normalization against CommonMark lazy continuation, blockquote CSS, and stripMarkdown widened to strip the whole marker run so nested tooltips carry zero sigils; test:region grew 37 → 49. The plan's six-step browser acceptance script ran 2026-11-03 on the live blog-test image with a 200-row controlled setup and a private post: steps 1–4 and 6 verified in-browser (including the scope-only filter-bar check via a temporary blog-test-scope-only variant in models/local/, deleted after), and step 5's title-session races spot-verified by Donnie in earlier passes and skipped in the final run by his call. Gates at completion: test:url-state 60, test:region 49, npm run build clean (index-DNUA7Nca, the browser-tested bundle), full suite 2667 checks across 49 groups PASS.
- Slot
- 4000
- Status
- 60 Done
- Tags
- mvp, backend, frontend, model, blog
- Contributors
- Donnie