Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit a984600

Browse files
os-teslaclaudeos-tesla
authored
fix(plugin-calendar,plugin-map): honour filter, sort and the row ceiling on inline value data (#9138)
* fix(plugin-calendar,plugin-map): honour filter, sort and the row ceiling on inline `value` data Ports objectui#8769's repair off `ObjectGantt` to the two siblings that carry a hand copy of the same short-circuit. Their fetch effect exited on `provider: 'value'` with `setData(dataItems)` BEFORE the adapter query, which is the one site in each file that lowers `schema.filter` onto `$filter`, `schema.sort` onto `$orderby` and the objectui#7210 ceiling onto `$top`. An authored `filter` therefore reached nothing and every authored row was drawn — the fail-OPEN direction, because the key that was dropped is the key that NARROWS. Not a literal transplant: `ObjectGantt` resolves ONE adapter for every provider and could delete the branch and fall through, while these two call `find` inside their `dataProvider === 'object'` arm, behind an `$expand` projection an inline set has no metadata to build. So each resolves `ValueDataSource` for the inline provider only, leaving the `api` arm exactly as it was, and no dependency array moves. Part of objectui#9061. ⚠️ BLOCKED on a decision — see the PR body: routing the inline rows through `ValueDataSource` makes them pass through that adapter's `JSON.parse(JSON.stringify(...))` constructor clone, which retires objectui#6018's pinned guarantee that a map's inline rows never have to be serializable. Three standing assertions are left RED and untouched on purpose. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ * docs(plugin-calendar,plugin-map): state that the provider does not change which query keys apply The changeset and both docs sets for objectui#9061: an authored `filter` / `sort` narrows and orders inline rows on every provider, the objectui#7210 ceiling applies to inline rows and is applied to the FILTERED set, and the two consequences of routing inline rows through the in-memory adapter — deep-copied row identity, and the JSON round-trip that makes inline rows have to be serializable. Part of objectui#9061. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ * test(plugin-calendar,plugin-map): spell each block's inline rows on the arm its published `data` row declares The nine reds on this branch were fixture-side, not a production defect, and eight of them were one cause seen at two altitudes. Rung 1 of the record-source ladder is judged against the BLOCK's own published `data` row (objectui#8348, decision batch #83 — "the row decides"): - `object-calendar`.data is `z.array(z.unknown()).optional()` -> arm 'array', so a `{ provider, items }` CONFIG OBJECT is refused by kind. - `object-map`.data is `ViewData` -> arm 'view-data', so a BARE ARRAY is refused by kind, and the objectui#5305 normalizing head is gone. Both new pin files used the other block's spelling. Refused by kind, the ladder fell through `staticData` and `objectName` to null, so the view had no record source at all and hit `DataSource required for object/api providers`. The calendar helper reads that through `getByTestId` ("unable to find calendar-view"); the map helper reads it through `queryAllByTestId`, which counts an error screen as '0' — the same failure, two altitudes. - calendar: the six inline rows now use `staticData`, the one rung that wraps into `{ provider: 'value', items }` on this block. Every assertion is unchanged. - map: `arrayShorthandSpelling` asserted the retired bare-array rung. Replaced by `offArmDataSpelling`, the mirror image of the calendar's new row of the same name; each carries a lit control, so the absence half is a reading about the SPELLING and not about the harness. `ObjectMap.filterConfig.test.tsx` is a second, genuinely different cause: it grades map CONFIG resolution and authored `filter` values purely as a vehicle. Those filters were inert on an inline set before this branch — the fail-OPEN bug #9061 repairs — and now correctly select nothing. - describe (d)'s ordinary `[['owner','=','me']]`: the row now satisfies it, so the case reads BOTH that the filter is honoured and that it did not eat `schema.map`. - describe (a)'s legacy `filter.map` stash is a query filter that no row can satisfy, so its two marker-counting rows take the exempt host `data` prop. This also repairs a phantom green: the `toHaveLength(0)` row had started passing because the set was empty, and would have gone on passing with config resolution completely broken. No production byte is changed by this commit. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: os-tesla <yinlianghui@steedos.com>
1 parent 7cbc724 commit a984600

10 files changed

Lines changed: 912 additions & 21 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
'@object-ui/plugin-calendar': minor
3+
'@object-ui/plugin-map': minor
4+
---
5+
6+
Honour `filter`, `sort` and the platform row ceiling on a calendar's and a map's
7+
inline (`provider: 'value'`) data (objectui#9061) — the port of objectui#8769's
8+
repair off `ObjectGantt`.
9+
10+
**The defect was fail-open.** Both renderers' fetch effect short-circuited the
11+
inline provider: it set the authored rows and returned BEFORE the adapter query,
12+
which is the one site in each file that lowers `schema.filter` to `$filter`,
13+
`schema.sort` to `$orderby` and the objectui#7210 ceiling to `$top`. So an
14+
inline calendar or map that declared a `filter` drew **every** authored row, with
15+
no diagnostic. The key that was dropped is the key that NARROWS, which is why
16+
this matters: the view answered a wider question than the author asked. Nothing
17+
was exposed that was not already in the authored schema — this is a correctness
18+
defect, not a data-access one.
19+
20+
**What changed.** Each renderer resolves a `ValueDataSource` for the inline
21+
provider and issues the same query the `object` arm issues. The `api` arm is
22+
untouched, and no dependency array moves. `ValueDataSource` already implements
23+
`$filter` / `$orderby` / `$skip` / `$top` / `$select` over its own array, so no
24+
filter combinator was written for this change.
25+
26+
**Behaviour you may notice.**
27+
28+
- An authored `filter` / `sort` now narrows and orders inline rows. Every
29+
spelling reaches it: `data: { provider: 'value', items }` and `staticData` on
30+
both renderers, plus the map's bare-array `data` shorthand.
31+
- The row ceiling now applies to inline rows: past 2,000 drawn rows the view
32+
draws 2,000 and shows the footnote naming both numbers, as it already did for
33+
fetched rows. It is applied to the **filtered** set, so a large inline array
34+
that a `filter` cuts below the ceiling draws every matching row and stays
35+
quiet. Rows a host passes down through the `data` React prop are still never
36+
capped — those are not ours to cap.
37+
- Inline rows now reach the view as the adapter's own deep copy rather than as
38+
the authored array's object identities. Code comparing a row handed to
39+
`onEventClick` / `onMarkerClick` against the authored array with `===` needs
40+
`id` equality instead.
41+
- That copy is a JSON round-trip, so inline rows must be JSON-serializable.
42+
A record graph carrying a back-reference, or a `BigInt` id, now renders an
43+
error panel instead of the view. `ObjectGantt` has refused the same input
44+
since before objectui#8769; `ObjectMap` did not, and pinned that it need not
45+
(objectui#6018). ⚠️ That pin is left RED and untouched in this change — see
46+
the pull request body.

‎content/docs/plugins/plugin-calendar.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,16 @@ const schema: ObjectCalendarSchema = {
255255
}
256256
```
257257

258+
`filter` and `sort` are not object-only keys (objectui#9061). They narrow and
259+
order inline records — `staticData` or `data: { provider: 'value' }` — exactly as
260+
they narrow and order fetched ones, and the platform row ceiling (2,000 drawn
261+
records with a footnote naming both numbers) applies to inline records too. The
262+
ceiling is applied to the **filtered** set, so a large inline array that a
263+
`filter` cuts below the ceiling draws every matching record and shows no
264+
footnote. Inline records reach the calendar as the in-memory adapter's own deep
265+
copy, so they must be JSON-serializable and a record handed to `onEventClick` is
266+
not `===` the authored object.
267+
258268
### CalendarConfig
259269

260270
```plaintext

‎content/docs/plugins/plugin-map.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ const schema: ObjectMapSchema = {
119119
}
120120
```
121121

122+
`filter` and `sort` are not object-only keys (objectui#9061). They narrow and
123+
order inline rows — `staticData`, a bare array under `data`, or
124+
`data: { provider: 'value' }` — exactly as they narrow and order fetched ones,
125+
and the platform row ceiling (2,000 plotted rows with a footnote naming both
126+
numbers) applies to inline rows too. The ceiling is applied to the **filtered**
127+
set, so a large inline array that a `filter` cuts below the ceiling plots every
128+
matching row and shows no footnote. Inline rows reach the map as the in-memory
129+
adapter's own deep copy, so they must be JSON-serializable and a record handed
130+
to `onMarkerClick` is not `===` the authored object.
131+
122132
### ObjectMapConfig
123133

124134
```plaintext

‎packages/plugin-calendar/README.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,24 @@ const schema: ObjectCalendarSchema = {
356356

357357
Pass the adapter to `SchemaRendererProvider` to wire the fetch up.
358358

359+
**The provider does not change which query keys apply** (objectui#9061, the port
360+
of objectui#8769). An authored `filter` and `sort` narrow and order the records
361+
on **every** provider, inline ones included — both `staticData` and
362+
`data: { provider: 'value', items }` reach the same in-memory adapter the
363+
`object` provider goes through, so `filter` is evaluated with the same matcher.
364+
Before objectui#9061 the inline provider skipped that query and drew every
365+
authored record with an authored `filter` silently dropped. The platform row
366+
ceiling (2,000 drawn rows, with a footnote naming both numbers — objectui#7210,
367+
ruling a′) applies to inline records too, and it is applied to the **filtered**
368+
set, never to the raw one: a large inline array that a `filter` cuts below the
369+
ceiling draws every matching record and shows no footnote.
370+
371+
⚠️ Two consequences of routing inline records through the adapter. They reach the
372+
calendar as that adapter's own deep copy rather than as the authored array's
373+
object identities, so code comparing a record handed to `onEventClick` against
374+
the authored array with `===` needs `id` equality instead; and the copy is a JSON
375+
round-trip, so inline records must be JSON-serializable.
376+
359377
## Customization
360378

361379
Style the calendar with Tailwind classes:

0 commit comments

Comments
 (0)