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

Commit 5a41ce7

Browse files
os-teslaclaudeos-tesla
authored
fix(types): judge the object-kanban handler keys the board reads (objectui#7804) (#9338)
* fix(types): judge the object-kanban handler keys the board reads `ObjectKanbanSchema` declares `onCardClick` and `onQuickAdd` as objectui#6124 RUNTIME SLOTS on both faces — callable on the TypeScript twin, refused BY NAME in the zod mirror. Until now neither was declared anywhere: `BaseSchema` is `.passthrough()`, so an authored `onCardClick: { "action": "toast" }` was not refused — it stopped being judged, the value was KEPT, and `KanbanRenderer` forwarded it to a call site expecting a function. Measured on this branch, that document parsed GREEN with the object surviving into the parsed output. Each disposition is measured at its own channel rather than shared across the prefix: `onQuickAdd` arrives at the board implementation BY IDENTITY through `ObjectKanban`'s schema spread, while `onCardClick` — substituted on that spread — arrives instead as the React prop `ObjectKanbanComponentProps` declares, which `ObjectKanban`'s own wrapper CALLS. The third key `KanbanRenderer` forwards, `onCardMove`, is deliberately NOT declared. Its authored value reaches neither channel, which is the `'retired'` disposition, and `check:handler-key-reads` refuses that spelling while the renderer still reads the key. It keeps its `KNOWN_UNDECLARED_READS` row; the two that landed are drained, because a row outliving its read reddens the gate. No renderer change and no runtime behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ * test(plugin-kanban): type the two untyped shared-script imports at their call sites `packages/plugin-kanban/tsconfig.test.json` compiles this package's tests, and `allowJs` is off, so importing `scripts/check-handler-key-read-sites.mjs` and `scripts/js-comment-mask.mjs` is TS7016 — measured by the repo-wide type-check, not guessed. The convention `ObjectKanban.titleFieldPrecedence-8308.test.tsx` already uses is applied here: `@ts-expect-error` on the import with the reason, and a locally annotated binding so the call sites stay checked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ * docs(changeset): lead the 7804 kanban note with the repo's BREAKING carrier The accept-set move was declared, but not in the spelling this repo's release notes are scanned in: `.changeset/7664-kanban-arm-plugin-dialect.md` and `.changeset/7742-kanban-arm-batch70.md` — the two nearest precedents, both on this same arm family — lead with `**BREAKING**`, and 7742 with the exact `(scored `minor` per this repo's version-alignment convention)` parenthetical. This note buried the same claim three paragraphs in as "breaking, shipped as `minor`", so a consumer scanning the release note for the token would have missed it. Prose only: the grade, the direction and every measurement are unchanged. 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 a5921a0 commit 5a41ce7

11 files changed

Lines changed: 731 additions & 44 deletions
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
'@object-ui/types': minor
3+
---
4+
5+
`ObjectKanbanSchema` now judges two of the three handler keys the kanban board reads off the
6+
authored document (objectui#7804, the `plugin-kanban` slice; director seat ruling of
7+
2026-09-07, decision batch #69): `onCardClick` and `onQuickAdd` are declared as objectui#6124
8+
RUNTIME SLOTS — callable on the TypeScript face, refused BY NAME in the zod mirror because
9+
JSON has no function value — and the message points at the node-type spelling an author can
10+
write instead.
11+
12+
Until now neither was declared anywhere. `BaseSchema` is `.passthrough()`, so a key no arm
13+
declares is not refused: it stops being judged and the value is KEPT, then reaches the
14+
renderer that reads it. Measured on this branch, `{ "type": "object-kanban", "objectName":
15+
"task", "groupBy": "status", "onCardClick": { "action": "toast" } }` parsed GREEN with
16+
`{"action":"toast"}` surviving into the parsed output, and `KanbanRenderer` forwarded it to a
17+
call site expecting a function. That is objectui#7664's measured transition, inherited by
18+
this face when objectui#8802 retired the sibling `kanban` arm that used to carry all three as
19+
runtime slots.
20+
21+
**BREAKING (scored `minor` per this repo's version-alignment convention, majors track
22+
`@objectstack`)** — the accept set on the published zod mirror moves. A declared key is validated
23+
even under `.passthrough()`, so two documents that parsed green yesterday are refused today,
24+
each at its own path: `onCardClick` and `onQuickAdd` carried at all. Neither is authorable
25+
in JSON by construction (a function has no JSON value), and `@objectstack/spec`'s
26+
`ObjectKanbanPropsSchema` — fourteen keys on the installed 17.4.0 pin — already refuses both
27+
by `unrecognized_keys`, so this narrows toward the protocol rather than away from it. Every
28+
other key parses exactly as before, and an undeclared key still passes through unchanged.
29+
30+
**No renderer change; no runtime behaviour changes.** The registration, its `inputs` and
31+
`ObjectKanban` are untouched. On the TypeScript face both keys become typed members where
32+
`BaseSchema`'s index signature used to absorb them, so a wrong-typed value is now a compile
33+
error at the key.
34+
35+
**The third key, `onCardMove`, is deliberately NOT declared, and that is a measurement rather
36+
than an omission.** Its authored value reaches nothing on this face — `ObjectKanban`
37+
substitutes its own mover on the schema it hands down and declares no `onCardMove` React
38+
prop — which is the objectui#6124 `'retired'` disposition; `check:handler-key-reads` refuses
39+
that spelling while `KanbanRenderer` still reads the key, printing `declares it RETIRED, but
40+
a renderer still reads it`. The two spellings that would make the gate green are both worse:
41+
`'runtime-slot'` would publish a callable key the object-bound board drops, and deleting the
42+
read would narrow `KanbanRenderer`'s published props — a ruling, not a repair. The key keeps
43+
its `KNOWN_UNDECLARED_READS` row naming objectui#7804, which stays open and stays the parent.

‎content/docs/api/schema-reference.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,9 @@ A drag-and-drop Kanban board. The `object-kanban` type key validates the shape t
950950
>
951951
> ⚠️ The **bare-string array applies only to a board with no `groupBy`.** It is declared so this package does not refuse an authoring the protocol allows. The renderer reads a bare-string lane list only when a board has no `groupBy` — so on a board that *does* declare one the strings are ignored and the lanes come from the group field's picklist options or from the data. Since objectui#8990 made `groupBy` optional, a lane-less board is a valid authoring and this arm is live on it: the lanes are drawn, titled by the **raw strings** (a grouped board titles its lanes with the picklist *labels* instead). ⚠️ Such a board holds **no cards** — with no lane key the records are never distributed — and dragging a card writes nothing back. It is lane headings, not a populated board; to control the lanes of a working board, declare `groupBy` and write the `{ id, title }` array.
952952
>
953-
> The other keys the retired `kanban` arm alone declared — `cardTitle`, `swimlaneField`, `grouping` and `navigation` — are still undeclared on this face. The renderer reads them, so a board may carry them; they are simply not judged. The board's React host supplies `onCardMove` / `onCardClick` / `onQuickAdd` as props; none of the three is authorable in JSON.
953+
> The other keys the retired `kanban` arm alone declared — `cardTitle`, `swimlaneField`, `grouping` and `navigation` — are still undeclared on this face. The renderer reads them, so a board may carry them; they are simply not judged.
954+
955+
> **Handler keys are not authorable in JSON, and two of the three now say so by name.** Since objectui#7804 this face declares `onCardClick` and `onQuickAdd` as objectui#6124 **runtime slots**: a React host supplies the function through the TypeScript interface or as a React prop, and this validator **refuses the key by name** with a message pointing at the node-type spelling (`{ "type": "toast", … }`, an `action:button` node). Until then an authored `onCardClick: { "action": "toast" }` parsed **green** — `BaseSchema` is `.passthrough()`, so a key no arm declares is not refused, it stops being judged and the value is kept, then reaches a call site expecting a function. ⚠️ `onCardMove` is the third key the board component reads and it is **still undeclared**: an authored one is accepted and dropped, because on an object-bound board the renderer substitutes its own mover. That gap is open on objectui#7804.
954956
955957
> `data` and `bind` are [`BaseSchema`](#baseschema) members, not narrowed here, but this face requires **one of** `bind`, `data`, `objectName` — the renderer's own record-source ladder (an external `data` prop → `bind` via `useDataScope` → this schema's own `data` → a fetch keyed by `objectName`). A purely static board (lanes carrying their own cards, no record source) authors `"groupBy"` and `"data": []`. ⚠️ The record-source rule is **separate** from the lane key and is unaffected by objectui#8990: omitting `groupBy` is fine, omitting all of `bind` / `data` / `objectName` is still refused, at the refinement rather than at `groupBy`.
956958

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ const onCardMove = (cardId: string, fromCol: string, toCol: string, index: numbe
8282
has no function value), never a member of the schema object below —
8383
`packages/plugin-kanban/README.md` documents this the same way.
8484

85+
Neither are `onCardClick` and `onQuickAdd`, and since objectui#7804 the
86+
`object-kanban` validator **says so by name**: both are declared as
87+
objectui#6124 **runtime slots**, so an authored `onCardClick: { "action":
88+
"toast" }` is now refused with a message pointing at the node-type spelling,
89+
where before it parsed green and was handed to a call site expecting a function.
90+
A React host still supplies either function through the TypeScript interface or
91+
as a React prop; only the JSON face refuses them. ⚠️ `onCardMove` itself is
92+
still *undeclared* on that validator — an authored one is accepted and silently
93+
dropped, because an object-bound board substitutes its own mover — and that gap
94+
is open on objectui#7804.
95+
8596
`columns` are the board's **swimlanes**, not a field projection — the fields drawn
8697
on a card are `cardFields`. It is **one of two array shapes**, the pair
8798
`@objectstack/spec` declares: an array of `{ id, title }` lanes (one per `groupBy`

0 commit comments

Comments
 (0)