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

Commit 669d71b

Browse files
os-justinclaude
andauthored
feat(types): declare ObjectKanbanSchema.groupBy and .limit, retire groupField on both faces (#7774)
The object-kanban renderer reads schema.groupBy (thirteen sites) and schema.limit (the $top row cap); groupField had zero read sites under packages/plugin-kanban yet was the REQUIRED lane key on both published faces, so the documented working node failed validation and a node authored from the declaration grouped nothing, with no diagnostic. - objectql.ts: groupBy: string (required), limit?: number, and a groupField?: never tombstone in the TimelineSchema.timeScale shape; node-local — the view-level kanban.groupField alias is untouched - objectql.zod.ts: groupBy / limit declared and validated; groupField is a retirementTombstone() whose message names groupBy - docs: the row-cap block on plugin-kanban.mdx is annotated ObjectKanbanSchema and imports it from @object-ui/types - fixture: kanban-conditional-formatting.test.ts authors groupBy - pin: object-kanban-group-by-limit-7322.test.ts - changeset: @object-ui/types minor, breaking for authored metadata Card: objectui#7322, item 1 of 2 (item 2 is the plugin's prop type and lands separately). Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s Co-authored-by: Claude <noreply@anthropic.com>
1 parent 16a725f commit 669d71b

6 files changed

Lines changed: 537 additions & 6 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
'@object-ui/types': minor
3+
---
4+
5+
**Breaking for authored metadata:** `ObjectKanbanSchema.groupField` is RETIRED
6+
(objectui#7322, ADR-0049 enforce-or-remove), and the two keys the `object-kanban`
7+
renderer actually reads — `groupBy` and `limit` — are now DECLARED and validated
8+
on both published faces: the TypeScript interface in `objectql.ts` and the Zod
9+
mirror in `zod/objectql.zod.ts`.
10+
11+
**What was measured, on this branch's base (`53ded82b`).**
12+
`packages/plugin-kanban/src/ObjectKanban.tsx` reads `schema.groupBy` at thirteen
13+
sites (lane materialisation at `:601` / `:625` / `:640`, card moves at `:747` /
14+
`:865`, and their effect deps) and `schema.limit` at two (`:264`,
15+
`$top: schema.limit ?? DEFAULT_KANBAN_LIMIT`, and the effect deps at `:291`).
16+
`groupField` has ZERO read sites anywhere under `packages/plugin-kanban/` —
17+
against a control of those thirteen `groupBy` reads in the same query, so the
18+
zero is a reading, not a blind grep. Yet the declaration REQUIRED `groupField`
19+
and declared neither `groupBy` nor `limit`. Measured from source: the
20+
documented, tested, working shape — `{ type: 'object-kanban', objectName,
21+
groupBy, limit }` — failed `ObjectKanbanSchema.safeParse` and
22+
`safeValidateSchema` on the missing `groupField`, and only ever reached the
23+
renderer through `BaseSchema`'s `[key: string]: any` and `.passthrough()`,
24+
admitted unexamined. An author who followed the declaration wrote `groupField`
25+
and got a board that grouped nothing, with no diagnostic on either face.
26+
27+
**Who is affected — an `object-kanban` node authoring `groupField`:**
28+
29+
```json
30+
{ "type": "object-kanban",
31+
"objectName": "task",
32+
"groupField": "status" } // ← validated, compiled, grouped nothing
33+
```
34+
35+
now fails validation at `groupField` with:
36+
37+
> RETIRED (objectui#7322) — `groupField` is not read by the object-kanban
38+
> renderer; author `groupBy`. (The view-level `kanban.groupField` alias is
39+
> unaffected.)
40+
41+
and is refused at compile time: `groupField?: never`. The tombstone is
42+
load-bearing rather than decorative — `BaseSchema` carries `[key: string]: any`,
43+
so DELETING the member would let the retired spelling type-check green and go on
44+
doing nothing. **Migration:** rename the key to `groupBy`; the value — the field
45+
whose value places a record in a lane — is unchanged.
46+
47+
**What now validates that did not before:** the documented shape. `groupBy` is
48+
REQUIRED (the retired contract required a lane field too; the renderer's
49+
`if (!schema.groupBy)` branches are defensive early-returns, not a lane-less
50+
mode, and every documented and tested `object-kanban` node authors the key) and
51+
must be a string; `limit` is an optional positive integer. A wrong-typed
52+
`groupBy: 42` or `limit: "twenty"` — previously admitted unexamined — is now
53+
refused at its own path.
54+
55+
**Who is NOT affected.** The VIEW-LEVEL kanban config is untouched:
56+
`kanban.groupField` there is a live legacy alias of the spec's `groupByField`
57+
(`packages/core/src/utils/normalize-list-view.ts` maps it; `plugin-list`'s
58+
`ListView` and `plugin-view`'s `ObjectView` still read it). `groupField` is dead
59+
only on the `object-kanban` NODE. The declarative `kanban` node (`KanbanSchema`)
60+
is untouched, `BaseSchema`'s unknown-key policy is byte-identical (an undeclared
61+
key still passes through), and the renderer is unchanged — boards authored the
62+
documented way rendered before and render now. One in-repo fixture authored
63+
`groupField` on this node (`packages/types/src/__tests__/kanban-conditional-formatting.test.ts`);
64+
it now authors `groupBy`. No doc snippet, catalog entry, skill or app in this
65+
repository authored `groupField` on an `object-kanban` node.
66+
67+
Graded `minor`, not `patch`: this narrows the accepted input set, which is
68+
breaking for any author who wrote the retired key. It is not `major` per this
69+
repo's fixed-group convention (objectui's own breaking changes ship as `minor`;
70+
the group's major tracks `@objectstack` — AGENTS.md 版本号策略, mechanically
71+
enforced by `scripts/check-changeset-no-major.mjs`).

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ board renders every fetched record into a lane and offers no pagination control,
155155
so this is the author's window on the object rather than a page size:
156156

157157
```tsx
158-
const board = {
158+
import type { ObjectKanbanSchema } from '@object-ui/types'
159+
160+
const board: ObjectKanbanSchema = {
159161
type: 'object-kanban',
160162
objectName: 'opportunity',
161163
groupBy: 'stage',

‎packages/types/src/__tests__/kanban-conditional-formatting.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ import { ObjectKanbanSchema } from '../zod/index.zod';
1919
import type { KanbanConditionalFormattingRule } from '../objectql';
2020

2121
describe('kanban conditionalFormatting — zod contract', () => {
22-
const base = { type: 'object-kanban', objectName: 'task', groupField: 'status' };
22+
// `groupBy`, not `groupField`: the lane key the renderer reads, declared on
23+
// both faces by objectui#7322 (which retired `groupField` on this node).
24+
const base = { type: 'object-kanban', objectName: 'task', groupBy: 'status' };
2325

2426
it('accepts the native { field, operator, value } rule (back-compat)', () => {
2527
const parsed = ObjectKanbanSchema.safeParse({

0 commit comments

Comments
 (0)