Skip to content

Commit dfeba25

Browse files
os-billclaude
andauthored
docs(spec): state what the object-* blocks declare on record_picker's filter docblock (#17657)
The `filter` docblock on `ElementRecordPickerPropsSchema` (anchor: `Filter rules narrowing which records the picker offers`) claimed that "the four `object-*` blocks declare `filter` as `z.unknown()`, no orthography at all". Measured on `packages/spec/src/ui/component.zod.ts`: zero occurrences of a `filter` key declared `z.unknown()`, against 61 occurrences of `z.unknown()` in the same file on the same instrument. All eight Zod `filter` declarations in the file are `z.array(ViewFilterRuleSchema).optional()`. The `object-*` family in `ComponentPropsMap` has six entries, not four. Four of them carry a `filter` door -- `object-grid`, `object-metric`, `object-kanban`, `object-calendar` -- and each declares `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, names all six and keeps the existing provenance citation unchanged. Prose only: no declaration moves and no accept set changes. Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH Co-authored-by: Claude <noreply@anthropic.com>
1 parent 132dd13 commit dfeba25

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
`element:record_picker`'s `filter` docblock now says what the `object-*` blocks actually declare
6+
7+
The docblock on `ElementRecordPickerPropsSchema.filter` (anchor:
8+
`Filter rules narrowing which records the picker offers`) carried a
9+
parenthetical claiming *"the four `object-*` blocks declare `filter` as
10+
`z.unknown()`, no orthography at all"*. Measured on the file itself: there is no
11+
`filter` key anywhere in `packages/spec/src/ui/component.zod.ts` declared
12+
`z.unknown()` — zero occurrences, against 61 occurrences of `z.unknown()` in the
13+
same file on the same instrument, so the zero is a reading and not a broken
14+
matcher. All eight Zod `filter` declarations in the file are
15+
`z.array(ViewFilterRuleSchema).optional()`; the one remaining `filter:` line is a
16+
`KeySetGuidance` prose entry, not a declaration.
17+
18+
The `object-*` family in `ComponentPropsMap` has **six** entries. **Four** of
19+
them carry a `filter` door — `object-grid`, `object-metric`, `object-kanban`,
20+
`object-calendar` — and all four declare `z.array(ViewFilterRuleSchema)`. The
21+
other two, `object-form` and `object-master-detail-form`, declare no `filter`
22+
key at all. The corrected parenthetical states both numbers and names all six,
23+
and keeps the `#15449` citation, which is accurate as provenance for when those
24+
four doors moved onto the array form.
25+
26+
**Why this is worth a patch rather than a silent tidy.** The sentence sat in the
27+
one docblock that tells an author what the sibling `filter` doors accept, and it
28+
told them those doors accept anything. The record form it thereby invited —
29+
`{ field: { $eq: ... } }`, the MongoDB-style shape this very docblock says the
30+
picker moved OFF — is refused at parse by all four. Prose only: no declaration
31+
moves and no accept set changes.

packages/spec/src/ui/component.zod.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,8 +2200,12 @@ export const ElementRecordPickerPropsSchema = lazySchema(() => strictObject({
22002200
* `ViewFilterRule` ARRAY form, `[{ field, operator, value }, ...]`, the one
22012201
* filter orthography the map's array-declared `filter` doors share
22022202
* (`record:related_list`, its nested Add-affordance picker, and — since
2203-
* #12039 Key 2 — `element:number`; the four `object-*` blocks declare
2204-
* `filter` as `z.unknown()`, no orthography at all — #15449). Until #14406
2203+
* #12039 Key 2 — `element:number`; and, since #15449, the four `filter`
2204+
* doors of the six-entry `object-*` family — `object-grid`,
2205+
* `object-metric`, `object-kanban` and `object-calendar` — each of which
2206+
* declares this same `z.array(ViewFilterRuleSchema)`, while that family's
2207+
* remaining two entries, `object-form` and `object-master-detail-form`,
2208+
* declare no `filter` key at all). Until #14406
22052209
* this entry alone still said `FilterConditionSchema`, the MongoDB-style
22062210
* record form: the last record-form `filter` in `ComponentPropsMap` after
22072211
* the ui#6206 ruling (2026-08-25, Option B, verbatim 「同意」: one filter

0 commit comments

Comments
 (0)