diff --git a/.changeset/17475-record-picker-filter-docblock.md b/.changeset/17475-record-picker-filter-docblock.md new file mode 100644 index 0000000000..bc9a24292c --- /dev/null +++ b/.changeset/17475-record-picker-filter-docblock.md @@ -0,0 +1,31 @@ +--- +'@objectstack/spec': patch +--- + +`element:record_picker`'s `filter` docblock now says what the `object-*` blocks actually declare + +The docblock on `ElementRecordPickerPropsSchema.filter` (anchor: +`Filter rules narrowing which records the picker offers`) carried a +parenthetical claiming *"the four `object-*` blocks declare `filter` as +`z.unknown()`, no orthography at all"*. Measured on the file itself: there is no +`filter` key anywhere in `packages/spec/src/ui/component.zod.ts` declared +`z.unknown()` — zero occurrences, against 61 occurrences of `z.unknown()` in the +same file on the same instrument, so the zero is a reading and not a broken +matcher. All eight Zod `filter` declarations in the file are +`z.array(ViewFilterRuleSchema).optional()`; the one remaining `filter:` line is a +`KeySetGuidance` prose entry, not a declaration. + +The `object-*` family in `ComponentPropsMap` has **six** entries. **Four** of +them carry a `filter` door — `object-grid`, `object-metric`, `object-kanban`, +`object-calendar` — and all four declare `z.array(ViewFilterRuleSchema)`. The +other two, `object-form` and `object-master-detail-form`, declare no `filter` +key at all. The corrected parenthetical states both numbers and names all six, +and keeps the `#15449` citation, which is accurate as provenance for when those +four doors moved onto the array form. + +**Why this is worth a patch rather than a silent tidy.** The sentence sat in the +one docblock that tells an author what the sibling `filter` doors accept, and it +told them those doors accept anything. The record form it thereby invited — +`{ field: { $eq: ... } }`, the MongoDB-style shape this very docblock says the +picker moved OFF — is refused at parse by all four. Prose only: no declaration +moves and no accept set changes. diff --git a/packages/spec/src/ui/component.zod.ts b/packages/spec/src/ui/component.zod.ts index e44bfabbd2..d81a58da6c 100644 --- a/packages/spec/src/ui/component.zod.ts +++ b/packages/spec/src/ui/component.zod.ts @@ -2200,8 +2200,12 @@ export const ElementRecordPickerPropsSchema = lazySchema(() => strictObject({ * `ViewFilterRule` ARRAY form, `[{ field, operator, value }, ...]`, the one * filter orthography the map's array-declared `filter` doors share * (`record:related_list`, its nested Add-affordance picker, and — since - * #12039 Key 2 — `element:number`; the four `object-*` blocks declare - * `filter` as `z.unknown()`, no orthography at all — #15449). Until #14406 + * #12039 Key 2 — `element:number`; and, since #15449, the four `filter` + * doors of the six-entry `object-*` family — `object-grid`, + * `object-metric`, `object-kanban` and `object-calendar` — each of which + * declares this same `z.array(ViewFilterRuleSchema)`, while that family's + * remaining two entries, `object-form` and `object-master-detail-form`, + * declare no `filter` key at all). Until #14406 * this entry alone still said `FilterConditionSchema`, the MongoDB-style * record form: the last record-form `filter` in `ComponentPropsMap` after * the ui#6206 ruling (2026-08-25, Option B, verbatim 「同意」: one filter