You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
/** Optional explicit columns for the detail-page related list (derived from the child object when omitted). */
446
446
relatedListColumns: z.array(z.any()).optional().describe('Explicit columns for the detail-page related list (derived from the child object when omitted)'),
447
447
448
+
/**
449
+
* LOOKUP PICKER (forward) config — how THIS lookup/master_detail field's
450
+
* record picker presents and scopes candidate records when the user selects a
451
+
* related record. Read-side mirror is relatedList* (the PARENT's detail-page
452
+
* list of children); these configure the CHILD-side picker that chooses the
453
+
* parent. All optional: the renderer auto-derives a sensible multi-column
454
+
* result from the referenced object's schema when omitted (objectui
* which read both these camelCase keys and their snake_case aliases).
457
+
*/
458
+
displayField: z.string().optional().describe("Field shown as each candidate's label in the picker/popover (defaults to the referenced object's name/title)."),
459
+
descriptionField: z.string().optional().describe('Secondary field shown under the label in the quick-select popover.'),
})).optional().describe('Base filters restricting which records are selectable (e.g. only active). Structured, picker-honoured form of referenceFilters.'),
472
+
dependsOn: z.array(z.union([z.string(),z.object({
473
+
field: z.string(),
474
+
param: z.string().optional(),
475
+
})])).optional().describe('Dependent lookup: restrict candidates by the value of other field(s) on the same record. String = same local/remote key; {field,param} when the remote filter key differs.'),
476
+
448
477
/** Calculation — CEL formula. Plain string accepted for back-compat; build emits canonical envelope. */
449
478
expression: ExpressionInputSchema.optional().describe('Formula expression (CEL). e.g. F`record.amount * 0.1`'),
0 commit comments