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
spec(ui): constrain object-grid / object-calendar sort to the SortItem array
`ComponentPropsMap` declared `sort` as `z.unknown()` on both blocks, so an
array, the legacy string clause and a bare number all returned `success: true`
while `bogusProp` was refused by name on the same call. objectui#8221 decision
batch #77 (2026-09-07, option B) rules one `sort` spelling platform-wide — the
array — and its item 4 names these two doors as the spec-side half.
Both now declare `z.array(SortItemSchema)`, the shared schema
`ElementDataSourceSchema.sort`, `ListPageSchema.sort` and
`element:record_picker` already import. `record:related_list`'s string arm is
deliberately untouched: it is the `'field'` / `'-field'` dialect read by
`RelatedList.normalizeSortSpec`, never reaching `convertSortToQueryParams`, and
retiring it was not ruled.
Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH
Co-authored-by: Claude <noreply@anthropic.com>
it('the census: no `sort` door in ComponentPropsMap takes a string except `record:related_list`, whose string is a DIFFERENT dialect and was not ruled',()=>{
2089
+
// Asked over the WHOLE map by shape rather than by the two names above, so
2090
+
// a future entry declaring `sort` as `z.unknown()` is caught here by name.
2091
+
// Guarded the same way as its `filter` twin: the doors pinned above must
2092
+
// be found, or the shape read has gone wrong and the loop is vacuous.
.describe('Base query filter — the ViewFilterRule array form `[{ field, operator, value }, ...]`, the one filter orthography every `filter` door in this map shares; lowered to the wire `$filter`. THE key, singular — not the plural misspelling. The MongoDB-style record form is refused — see migration `element-data-source-and-object-block-filter-rule-array`'),
2486
2486
defaultFilters: z.unknown().optional()
2487
2487
.describe('Legacy base-filter fallback, read only when `filter` is absent. Prefer `filter`'),
2488
-
sort: z.unknown().optional().describe('Initial sort (array of { field, order })'),
2488
+
/**
2489
+
* Initial row order — the `SortItem` ARRAY form, `[{ field, order }, ...]`,
2490
+
* the one sort orthography every DECLARED `sort` door on this platform
2491
+
* carries: `ElementDataSourceSchema.sort` and `ListPageSchema.sort`
2492
+
* (page.zod.ts) and `element:record_picker`'s flat shorthand above. One
2493
+
* shared schema rather than a third copy — all of them are
2494
+
* `SortItemSchema`, already imported at the top of this file for the picker.
* 「其他同意」, option B: one `sort` spelling, the array; the legacy string
2498
+
* clause is retired from `@object-ui/core`. Item 4 of that ruling is this
2499
+
* declaration and `object-calendar`'s below — 「`ComponentPropsMap` for
2500
+
* `object-calendar` and `object-grid` constrains the `sort` value to the
2501
+
* array shape (today it accepts anything), so the spec, the registrations
2502
+
* and the helper agree; that is a pull-back to the declared contract,
2503
+
* ordinary tier」.
2504
+
*
2505
+
* The `z.unknown()` this door carried was a read-point record (#7751), the
2506
+
* same vintage as its `filter` neighbour above and not an exception to the
2507
+
* ruling: it receipted an array, a string and a bare NUMBER alike with
2508
+
* `success: true`, while `plugin-grid/src/index.tsx:222` has published
2509
+
* `type: 'array'` all along — so the html tier answered `type-mismatch` on a
2510
+
* value this schema had just accepted.
2511
+
*
2512
+
* Sequenced measurement-first, as this family has to be. Measured at the
2513
+
* objectui pin `53ded82b`: `ObjectGrid.tsx:1457` reads `schema.sort` and the
2514
+
* fetch path at `:1844-1851` carries an explicit `typeof === 'string'` arm
2515
+
* putting the clause on `$orderby` verbatim, beside the array arm that folds
2516
+
* `[{ field, order }]` onto the same parameter. ⚠️ At THIS pin the string is
2517
+
* therefore still lowered, and this door refuses a spelling the pinned
2518
+
* renderer honours — the ruled sequence, not an oversight: objectui#8221's
2519
+
* PR #8758 (merged 2026-09-09, after this pin) drops the string arm from
2520
+
* `convertSortToQueryParams`, and the next pin bump carries it in. The array
2521
+
* is the spelling both ends already agree on today; the header-arrow read at
2522
+
* `:3998` hands `schemaSort` to `parseSchemaSort` as `TableSortItem[]`, the
2523
+
* array shape and not the string.
2524
+
*/
2525
+
sort: z.array(SortItemSchema).optional()
2526
+
.describe('Initial row order — the SortItem array form `[{ field, order }, ...]`, the one sort orthography every declared `sort` door on this platform shares; lowered to the wire `$orderby`. The legacy string clause (`name desc`) is refused — objectui#8221 decision batch #77, option B, retired it'),
.describe('Base query filter — the ViewFilterRule array form `[{ field, operator, value }, ...]`, the one filter orthography every `filter` door in this map shares. The MongoDB-style record form is refused — see migration `element-data-source-and-object-block-filter-rule-array`'),
2839
-
sort: z.unknown().optional().describe('Sort for the fetched events'),
2877
+
/**
2878
+
* Row order for the fetched events — the same `SortItem` ARRAY form
2879
+
* `object-grid` declares above, and for the same ruling (objectui#8221,
2880
+
* decision batch #77, option B; the `object-grid` entry carries the verbatim
2881
+
* text). One sort orthography, one shared `SortItemSchema`.
2882
+
*
2883
+
* Measured at the objectui pin `53ded82b`: `ObjectCalendar.tsx:431` hands
2884
+
* `schema.sort` to the shared sink `convertSortToQueryParams`
2885
+
* (`core/src/utils/sort-query.ts`) as the fetch's `$orderby`. ⚠️ That sink
2886
+
* still honours the legacy string clause at this pin — `sort-query.ts:66-70`
2887
+
* — so, exactly as on `object-grid`, this declaration lands ahead of the
2888
+
* consumer-side retirement (objectui#8221's PR #8758, merged 2026-09-09) and
2889
+
* refuses a spelling the pinned helper still lowers. The array arm is
2890
+
* unaffected: the sink folds `[{ field, order }]` into the field-direction
2891
+
* map either way. Unlike the grid, `plugin-calendar/src/index.tsx` declares
2892
+
* no `sort` input at all, so nothing on the registry side moves.
2893
+
*/
2894
+
sort: z.array(SortItemSchema).optional()
2895
+
.describe('Row order for the fetched events — the SortItem array form `[{ field, order }, ...]`, the one sort orthography every declared `sort` door on this platform shares; lowered to the wire `$orderby`. The legacy string clause (`name desc`) is refused — objectui#8221 decision batch #77, option B, retired it'),
2840
2896
data: z.array(z.unknown()).optional().describe('Pre-fetched records — skips the internal fetch'),
0 commit comments