feat(spec,showcase): lookup record-picker authoring metadata + demo#2125
Merged
Conversation
The objectui record picker can present multi-column, scoped, dependent lookup results, but FieldSchema exposed none of the authoring surface for it — so the props were silently dropped by defineStack's Zod parse (cf. the FieldSchema property-liveness audit, which flags referenceFilters reaching the renderer under a different key). Authors had no supported way to curate or scope a picker. spec (FieldSchema, packages/spec/src/data/field.zod.ts): - Add forward record-picker props to the lookup/master_detail surface: `displayField`, `descriptionField`, `lookupColumns`, `lookupPageSize`, `lookupFilters` (structured, picker-honoured form of referenceFilters), and `dependsOn` (dependent/cascading lookups). All are genuinely wired — the objectui renderer reads them (camelCase + snake_case aliases). They flow through Field.lookup() automatically via FieldInput. - Tests: assert the props survive FieldSchema.parse (not stripped) and that Field.lookup() carries them through. showcase (examples/app-showcase): - Expand the account seed from 3 → 13 (varied industry / revenue / lifecycle, incl. churned) so the picker exercises search, sort, pagination and scoping. - Configure showcase_invoice.account with curated `lookupColumns` (name / industry / lifecycle / revenue), a `descriptionField`, and a `lookupFilters` rule that hides churned accounts — a rep can't invoice a churned customer. Demonstrates the new authoring surface end-to-end. Pairs with objectui PR #1860 (renderer: auto-derive columns + i18n + accept both key casings + apply lookupFilters in the popover). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 89 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
The spec liveness gate requires every authorable FieldSchema property to be classified. Mark displayField/descriptionField/lookupColumns/lookupPageSize/ lookupFilters/dependsOn as live (consumed by the objectui record picker, cited as prose per the ledger convention) and sharpen the referenceFilters authorHint to point at the structured lookupFilters key. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The objectui record picker can render multi-column, scoped, and dependent lookup results, but
FieldSchemaexposed none of the authoring surface for it. Anything an author set (e.g.lookupColumns) was silently dropped bydefineStack's Zod parse — so the picker always degraded to a single name column. This is the same class of gap the FieldSchema property-liveness audit flags (e.g.referenceFiltersreaching the renderer under a different key,lookup_filters).Companion to objectui #1860 (renderer: zero-config column derivation, i18n, accepts both key casings, applies
lookupFiltersin the popover).Changes
spec —
packages/spec/src/data/field.zod.tsAdd the forward record-picker props to the lookup / master_detail surface, all genuinely wired to the renderer:
displayField— candidate label fielddescriptionField— secondary line in the popoverlookupColumns— curated picker table columns (auto-derived when omitted)lookupPageSize— rows per pagelookupFilters— structured, picker-honoured scoping filters (the structured form ofreferenceFilters)dependsOn— dependent / cascading lookupsThey flow through
Field.lookup()automatically viaFieldInput. Tests assert the props surviveFieldSchema.parse(the pathdefineStackuses) and that the builder carries them through.showcase —
examples/app-showcaseshowcase_invoice.accountconfigured with curatedlookupColumns(name / industry / lifecycle / revenue), adescriptionField, and alookupFiltersrule hiding churned accounts — a rep can't invoice a churned customer.Verification
packages/specunit tests: 117 passed (incl. 2 new — props parse without being stripped; builder carries them through).app-showcasetypecheck: no errors in the changed files (invoice.object.ts,data/index.ts); remaining errors are pre-existing unbuilt-workspace-dep noise (connectors / objectql), unrelated to this change.