Repository navigation
feat(plugin-detail): record:related_list reads its parent record from parentDataSource - #12407
Conversation
… parentDataSource The spec row's parentDataSource (ruling B on objectui#12296) binds the PARENT record of a related list by a query of its own. The block now reads it through the one-record read the other three record blocks take (ParentRecordBinding in renderers/recordBinding.tsx: the gate, the first row by sort with $top: 1, the invalidation bus, RecordContextProvider). No row, or a refused read, draws a loud absence in the block's place instead of an empty list; a failed read draws the family's data-source error panel. With the key absent the record page's record context is the parent, as before. The node-level dataSource keeps its child-row meaning. The TypeScript mirror declares parentDataSource by reference to the spec, the registration publishes it as an input, and objectui validate's limit: 1 warning covers properties.parentDataSource. Claude-Session: https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB Co-authored-by: Claude <noreply@anthropic.com>
…d-key booking The data-source guide and the plugin-detail README document the related list's parent binding; the console registry ledger strikes the objectui#12370 booking of record:related_list.parentDataSource (the key is now read and declared) and pins its members; a changeset declares the release. Claude-Session: https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB Co-authored-by: Claude <noreply@anthropic.com>
…props bag Claude-Session: https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB Co-authored-by: Claude <noreply@anthropic.com>
…de casts Claude-Session: https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB Co-authored-by: Claude <noreply@anthropic.com>
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Face: the Read for this record:
Nothing was built or re-run. ① Derived judgments
② Semver level
③ Boundary flags
Out of scope, routed: the spec's Implemented-by: VERDICT: PASS Generated by Claude Code |
Seat ACCEPT: objectui PR #12407 at
|
Fixes #12294
Clause-②: yes (widening)
The remaining leg of objectui#12294:
record:related_listreads its PARENT record fromparentDataSource, the key ruling B on objectui#12296 (ruling comment 6137226306) added to the spec'srecord:related_listrow. The other three record blocks landed in PR #12299. With this leg the card's acceptance holds for all four blocks, so this PR carries the closing line.What changed
packages/plugin-detail/src/renderers/recordBinding.tsx). A newParentRecordBindingreuses the first half's one-record read unchanged:ElementDataSourceGate(the filter and sort mapping, plus the family's panels for a view that does not resolve, a refused filter, or no adapter), thenBoundRecordProvider($top: 1under the binding's$orderby, the invalidation bus on the bound object,RecordContextProvider).BoundRecordProvidergains two optional props,absentanderrorTitle. Withabsentset, a settled read with no row (or a 403, which reads the same) drawsabsentinstead of an empty record context. The three one-record blocks pass neither prop, so their path is unchanged.dataSource, and never the block's schema. With the schema, the gate's filter and sort mapping would compose the CHILD list's ownfilterandsortinto the parent's query.record-related-list.tsx).RecordRelatedListRendereris still the oneelementDataSourceBlock-wrapped export. It now nestsParentRecordBindingoutside the existing child gate (RecordRelatedListChildRows). The child gate and the body read the parent's record context (recordId,data,dataSource), so a bound parent reaches them exactly as a record page's record does.ParentRecordBindingrenders its children as they are.role="status"notice in the block's place, naming the object, and no list.ElementDataSourceErrorPanel, under the stemrecord-related-list-parent.RecordRelatedListComponentProps(@object-ui/types) declaresparentDataSource?: ElementDataSource, the spec's own input type, by reference; anEqualpin holds it toComponentPropsInputof the row. The registration publishes aparentDataSourceinput (typeobject), so the html tier stops reportingunknown-propon it. Its description states the renderer's behaviour; the spec describe's[PLANNED — not yet rendered]marker is not copied.objectui validate. The existinglimit: 1warning now also coversproperties.parentDataSourceonrecord:related_list. The call: the spec's own describe tells the author to "declarelimit: 1to say one row is meant", and the card's item 2 asks the hint of record-block bindings. This is the same single-record rule on one more carrier, with its own sentence naming the key. ⛔ No other finding was added: nothing compares a parent binding with a sibling block's, per the ruling.record:related_list.parentDataSourceunpublished-key booking that objectui#12370 made while nothing read the key, and registers its member pin. The data-source guide gets a subsection, and the plugin-detail README and the types zod README get one paragraph and one sentence. The related-list arm'sdataSourcedescribe now names the parent binding. A changeset declaresminorfor@object-ui/plugin-detail,@object-ui/typesand@object-ui/cli.Premise readings (dispatch A1 to A5, on
origin/main3f20d5aa2, installed@objectstack/spec18.0.0-next.1)RecordRelatedListProps.parentDataSourcematches the summary: the first row bysort, a loud absence when no row answers, and the record context when the key is absent. It also says the key lives in the row (properties), not on the node, and thatrelationshipValueFieldis read on the bound row. Both are followed here.liveness/page.json's_notecarries thePLANNED RECORD (#23134 …)sentence, and the describe opens with[PLANNED — not yet rendered]. Both are objectstack's to rewrite after this lands; they are not touched here.ctx.dataSource.objectui validatealready ACCEPTEDproperties.parentDataSource(exit 0): the arm'spropertiesis the spec row by reference. It REFUSED the node-level spelling towardproperties.parentDataSource(exit 1), which is correct and is now pinned. What still refused the key was the TypeScript mirror (TS2353 onRecordRelatedListComponentProps) and the registrationinputs(html-tierunknown-prop). The widening the claim declares is those two.dataSourcebinding. The parent binding is a prose subsection.objectname-binding-required-11605still passes.Tests
The renderer suite
record-related-list.parentDataSource-12294.test.tsxmounts the block through the realSchemaRenderer, the real registration and the realRelatedList, with the binding authored inproperties. It covers:sortis the parent: read with$top: 1and$orderby, with the binding's filter. Every child query is$filter: { environment_id: 'env-1' }, and only that parent's child is drawn.relationshipValueFieldis read on the bound row.record-related-list-parent-datasource-errorwith the message, and no child query is sent.The CLI suite
validate-related-list-parent-binding-12294.test.tsis pin 5. It accepts the bag form at the root, beside the child binding, and in a page region. It warns, naming the key, withoutlimit: 1, and the child binding alone draws no warning. It refuses the node-level spelling.record:detailsis still refused the key, with a no-key control.The types suite
record-related-list-parent-binding-12294.test.tsholds theEqualpins and a@ts-expect-errorrefusal (compiled bytsc -p tsconfig.test.json). It also pins the full parse in the bag, the value refused AT the key, and the node spelling refused.Runs, through the shared verify lock, from the repo root:
pnpm exec vitest run packages/plugin-detail/ packages/types/ packages/cli/at36e13d0d8:Test Files 681 passed | 1 skipped (682),Tests 13358 passed | 14 skipped.git grepover test files namingrecord:related_list,data-source.md, the manifest emitter or the injected input, plus the console injection, intrinsics and html-tier manifest suites. They includeregistry-inputs-spec-parityandobjectname-binding-required-11605. Result:28 passed,843 passed.8871bde2a, which only types the renderer suite's casts: that suite10 passed, and plugin-detailtype-checkexit 0.type-check(script names echoed) exit 0 on@object-ui/types,@object-ui/plugin-detailand@object-ui/cli, after building their closure (turbo run build, 11 tasks).Ablation (pin 6, one time). objectstack
scripts/ablation-replace.mjsreplacedbinding={parentBinding}withbinding={undefined}inrecord-related-list.tsx(anchor x1 to x0). Blobd059ff82694abecameb32314b42c58. Result: 8 failed, 2 passed. Pin 1 is red, as are the absence, error, view, bus and record-page-binding rows. The two that stay green are the unbound record page and the registration input. Restored: the blob equals HEADd059ff82694a, andgit diff HEADis empty. The suite reaches plugin-detail through relative source imports, so there is nodist/leg.Cross-package reverse verification (one time). In
@object-ui/typesthe mirror member was renamedparentDataSourceRenamed, the types package rebuilt, and the new name counted in 1dist.d.tsfile. plugin-detailtype-checkthen exited 2 witherror TS2339: Property 'parentDataSource' does not existat the renderer's read. Restored: the blob equals HEAD7968b6d5c5a0, the types package rebuilt, the renamed key is in 0distfiles, andtype-checkexits 0. So plugin-detail's check reads the rebuilt declarations.Record page, byte-identical (one time, not committed). A scratch suite rendered three unbound related lists on a record page through the real
SchemaRenderer: a plain one, one with a childdataSource, and one with a title and limit. It hashedinnerHTML. With BASErecord-related-list.tsxandrecordBinding.tsxagainst HEAD, the sha256 prefixes were equal on all three (792278163403c2c6×2,e83cad5fc063f816). The files were restored withgit checkout HEAD --, each blob equals HEAD, andgit diff HEADis empty.Gates (local, at
8871bde2a, exit captured before any pipe)Exit 0: control-bytes, vi-mock-specifiers, vi-mock-inherit, vi-mock-override-shape, test-path-roots, doc-links, doc-example-ids, doc-component-types, element-data-source-declaration (16 files reach the seam), i18n-call-site-keys, i18n-en-drift, new-line-citations (0 new), changeset presence / no-major / claims / pending-literals / fixed / overwrite, doc-fence-languages, shell-escape-residue, action-ref-convention, doc-json-fences (judged against the rebuilt types
dist; the two new JSON fences are accepted), docs-route-eager-closure, phantom-deps, unused-deps, self-import, unreferenced-sources, spec-symbols, handler-key-reads, metadata-write-doors, published-tsconfig-exclude, side-effects-array, designer-field-key-parity, action-forward-parity, registry-bare-names, component-surface-parity, doc-example-readers, prompt-keys.pnpm check(the CLI self-check, afterpnpm --filter @object-ui/cli build) exits 0, andcheck-governed-queue-guard --testreads NOT GOVERNED (15 paths).Left to CI, which runs the full farm:
pnpm lint(repo-wide), and the gates that read every package'sdist(doc-snippets, doc-examples, readme-exports).Acceptance notes
[PLANNED — not yet rendered]marker onRecordRelatedListProps.parentDataSource, and thePLANNED RECORD (#23134 …)sentence inliveness/page.json's_note. Both become false once this lands. Per claim 6181764745, the follow-up goes to the spec seat at landing.dataSourcebinding it describes, so it is not edited. This changeset adds the parent key.Generated by Claude Code