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

Commit d89492c

Browse files
docs(types): ObjectChartSchema.series says its copy omits the per-series type and names chartType (objectui#10584) (#10768)
Fixes #10584 Clause-②: no. The accept set does not move; this is a `.describe` and docblock wording fix. `yes` would be owed only if a named producer turned the card to widening, and then the dev stops and reports. ## What changed - `packages/types/src/zod/objectql.zod.ts`, the `series` member of `ObjectChartSchema`: the `.describe()` no longer calls the element "the arm ChartRendererProps declares". It now says the copy is that `{ dataKey }` arm minus the arm's per-series `type`, which this copy does not declare, and that this copy's per-series family override is `chartType` (`bar` | `line` | `area`). A short comment above the member points at the TS twin for the ground. - `packages/types/src/objectql.ts`, the `series` member docblock: "this copy has not taken up" (which read as a lag) now says the omission is deliberate. Taking `type` up widens a published accept set and waits for a named producer that writes it on an `object-chart` node. The docblock also states what a `type` written anyway meets on each face (measured below). - `.changeset/10584-object-chart-series-describe.md`: `@object-ui/types` `patch`, since the `.describe()` string is published text. Both edits stay inside the `ObjectChartSchema` block, which is the file surface the claim names. No member, type or schema node changes. ## Premise check on `origin/main` at `0896838deb` - **H1 holds.** The zod `.describe()` said "the arm ChartRendererProps declares", while both arms of `ChartRendererProps.schema.series` carry `type?: string` (objectui#8086). The TS docblock already named the omission ("every member of it except `type` ... this copy has not taken up"). It now says the omission is deliberate. - **H2 holds.** PR #10734 (objectui#10608) and PR #10601 (objectui#10518) are both on `main`, so this card's serial predecessors on the block have landed. The text was re-read on `main`; the card's line numbers were not used. - **H3: no pin.** `git grep` for the old describe text ("ChartRendererProps declares", "plotted series in the renderer", "has not taken up") matches only the two source files. No test, generated artifact or doc asserts the string, and no describe-verdict pin (`INTERNAL` / `AUTHORABLE` prefix) reads it. ## Stop condition: producer census for a per-series `type` on `object-chart` No producer found, so the work did not stop. Each reading has a control that hits: - **objectui (in-repo):** every `type: 'object-chart'` literal outside tests is in one of the relays: app-shell `ObjectView`, plugin-view `ObjectView`, plugin-list `ListView`, plugin-dashboard `DashboardRenderer` and `DashboardGridLayout`. Each writes `series` as `{ dataKey, label }`, and none writes `type`. app-shell forwards `viewDef.chart.series` verbatim, but the spec's `ListChartConfigSchema` is a `strictObject` with no `series` member, so no conforming stored view carries one. `chartConfigPresentation` emits no `series`. The only `{ dataKey, type }` literals are in `plugin-charts` tests of the `chart` renderer. - **objectstack showcase (at `16c5a33`):** `command-center.page.ts` writes `object-chart` nodes with no `series`. `renewals-pipeline.page.ts` writes `series={[{ name: 'total', label: 'Invoice value' }]}` on the ObjectChart react block: the `{ name }` arm, with no `type`. - **hotcrm (shallow clone at `2f7b232`):** zero `object-chart` / `ObjectChart` hits, and zero `series` in the 15 files under `src/**/dashboards` and `src/**/reports`. Control: 34 chart `type:` literals across those files (five dashboards and two reports). ## What each face does with a per-series `type` (measured, unchanged by this PR) Measured on the rebuilt `dist` at HEAD `5dc9a71e02`, with the same readings on the base build: - **zod mirror:** `ObjectChartSchema.safeParse` of `series: [{ dataKey: 'margin', type: 'line' }]` gives `success: true`, and the parsed series is `[{"dataKey":"margin"}]` (the plain `z.object` element strips `type`). `{ dataKey, chartType: 'line' }` keeps `chartType`. `{ label }` alone is still `invalid_type` at `series.0.dataKey`. The base build gives the same result for each. - **TS face:** `tsc --strict` on a literal typed `ObjectChartSchema` gives `TS2353` ("'type' does not exist in type ...") for `{ dataKey, type }` and compiles `{ dataKey, chartType }`. - **`dist` diff, base vs head:** the non-comment lines of `objectql.d.ts` are byte-identical. `zod/objectql.zod.d.ts` and `zod/index.zod.d.ts` differ only in union-member emission order on members this PR does not touch (`"json" | "csv" | "xlsx"` versus `"json" | "xlsx" | "csv"`, `position` and `operator` unions). `zod/objectql.zod.js` differs only in the comment and the describe string. ## Verification (all on HEAD `5dc9a71e02`, working tree clean) - `pnpm --filter @object-ui/types build`: `VERDICT command-exit 0`. The dependency closure `@object-ui/types^...` has no build script, so it is empty. - `pnpm --filter @object-ui/types type-check`: `VERDICT command-exit 0` (the script name is echoed as `type-check`). - `pnpm exec vitest run --maxWorkers=2 packages/types/`: `Test Files 245 passed (245)`, `Tests 5327 passed (5327)`, exit 0. - `pnpm exec vitest run --maxWorkers=2 packages/plugin-charts/`: `Test Files 82 passed (82)`, `Tests 964 passed (964)`, exit 0. Direction: the downstream consumer of `@object-ui/types` named in the dispatch, run to confirm no fixture reads the describe string. - Out-of-package tests that parse `objectql.ts` / `objectql.zod.ts` from disk (app-shell `relayRungCensus-7559`, `chartConfigForward-7891`; plugin-grid, plugin-kanban, plugin-tree and react census pins; and eight `scripts/__tests__` suites): `Test Files 15 passed (15)`, `Tests 602 passed (602)`, exit 0. - ESLint `--no-inline-config --format json` on the two touched sources: exit 0, 2 files linted, 0 errors, and 35 `no-explicit-any` warnings, none on an edited line. Type-aware linting is not enabled (`eslint.config.js` has no `parserOptions.project` / `projectService`), so this diff cannot move a verdict on any untouched file. - `node scripts/check-changeset-presence.mjs` 0 · `node scripts/check-changeset-no-major.mjs` 0 · `pnpm check:new-line-citations` 0 (`VERDICT new-cross-file-line-citations: 0 new citation(s)`) · `pnpm check:control-bytes` 0 · `pnpm check:spec-symbols` 0 · `pnpm check:test-path-roots` 0 · `pnpm check:changeset-claims` 0 (report-only). The pending objectui#8086 changeset's sentence "that copy of the internal arm does not carry `type`, and its type is unchanged" is still true. - `pnpm check:component-surface-parity` 0 · `check:designer-field-key-parity` 0 · `check:doc-types` 0 · `check:installed-pin-claims` 0 · `check:handler-key-reads` 0 · `check:action-forward-parity` 0. - `node scripts/check-governed-queue-guard.mjs --test` on the three paths: `NOT GOVERNED`. - **NOT MEASURED: `pnpm check:doc-examples`**, exit 2, prerequisite not met. It needs the dist of about 30 workspace packages, and that full build is CI's. This diff adds no `@example` block or fence (zero added lines match), so the gate's population is unchanged. - **NOT RUN: Spec Main Shape Gate.** The touched member is not spec-derived: the `series` element is a local copy of `ChartRendererProps`' arm and binds no `@objectstack/spec` symbol. The emitted `objectql.d.ts` is non-comment byte-identical, so compiling against any spec cannot move. ## Acceptance notes - **Kept verbatim: the `INTERNAL (relay-composed)` prefix.** It is objectui#7946's ruled verdict. The census above measured a channel it does not name: the ObjectChart react block. The spec's `react-blocks` entry has `schemaType: 'object-chart'` and `schema: ChartConfigSchema`, and it lists `series` in `dataProps`. `ChartSeriesSchema` is the `{ name }` arm and carries the per-series `type`. The showcase's `renewals-pipeline` page writes `series={[{ name, label }]}` through that block onto an `object-chart` node, and the published zod face refuses that node (`invalid_value` at `chartType`, `invalid_type` at `series.0.dataKey`). That belongs to the same family as objectui#10518 / objectui#10608 (the `object-chart` copy against the spec's ChartConfig contract), and it is reported to the seat rather than acted on here. It does not change this card's answer. On this node the spec's per-series `type` rides the `{ name }` arm, and the spec refuses `dataKey` by name, so a `{ dataKey, type }` entry is not spec-authorable on `object-chart` either. - The describe names `chartType` because it is this copy's declared per-series override. It is not a new authoring recommendation: the member stays `INTERNAL`. - No pin was added. The dispatch owed one only if the wording was already pinned, and it was not. Refs: objectui#8086 · objectui#7946 · PR #10554 --- _Generated by [Claude Code](https://claude.ai/code/session_014fWVhLzhxR8qrFsJ5o8TYW)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 17b323e commit d89492c

3 files changed

Lines changed: 43 additions & 4 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/types': patch
3+
---
4+
5+
docs(types): the `ObjectChartSchema.series` description says the copy omits the per-series `type`, and names `chartType` as its override
6+
7+
The zod mirror's `.describe()` on `ObjectChartSchema.series` called the element
8+
"the arm ChartRendererProps declares". Since objectui#8086 that arm also carries
9+
a per-series `type`, which this copy does not declare, so the sentence was no
10+
longer true member for member. It now says the copy is that `{ dataKey }` arm
11+
minus its per-series `type`, and that the per-series family override on an
12+
`object-chart` node is `chartType` (`bar` | `line` | `area`).
13+
14+
The TypeScript docblock on the same member now says the omission is deliberate
15+
rather than a lag: taking `type` up would widen a published accept set, and
16+
that waits for a named producer that writes it on an `object-chart` node.
17+
18+
Wording only. The accepted shape does not move on either face: the element
19+
type, its members and the mirror's parse result are what they were.

‎packages/types/src/objectql.ts‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4447,9 +4447,22 @@ export interface ObjectChartSchema extends BaseSchema {
44474447
*
44484448
* The element type is `ChartRendererProps.schema.series`' internal arm —
44494449
* that is the read this value ends at, and the ruling on objectui#7946 asked
4450-
* for the reads rather than a copy of any producer's literal — every member
4451-
* of it except `type`, which that arm gained under objectui#8086 and this
4452-
* copy has not taken up. The spec's AUTHOR-facing `ChartSeriesSchema` is the other arm
4450+
* for the reads rather than a copy of any producer's literal — with every
4451+
* member of it EXCEPT the per-series `type` that arm gained under
4452+
* objectui#8086.
4453+
*
4454+
* ⛔ The omission is deliberate, not a lag (objectui#10584). Taking `type`
4455+
* up widens a published accept set, and that waits for a named producer
4456+
* that writes `type` on an `object-chart` node; none was named. Until one
4457+
* is, the per-series family override on this node is `chartType` — the
4458+
* renderer-internal spelling of `type`, which wins when an entry writes
4459+
* both. A `type` written here anyway is an excess property on a literal
4460+
* typed by this interface, and the zod mirror's element is a plain
4461+
* `z.object`, which strips it: it parses clean and is dropped. The mirror's
4462+
* `.describe()` says the same, because that string is what an author-facing
4463+
* tool renders.
4464+
*
4465+
* The spec's AUTHOR-facing `ChartSeriesSchema` is the other arm
44534466
* (`{ name }`), and it refuses `dataKey` by name; `normalizeChartSchema` is
44544467
* the one translation between them.
44554468
*/

‎packages/types/src/zod/objectql.zod.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,13 @@ export const ObjectChartSchema = BaseSchema.extend({
25372537
aggregate: stripImportedDefaults(SpecChartAggregateSchema).optional()
25382538
.describe('AUTHORABLE — inline aggregation for the legacy objectName path. @objectstack/spec ChartAggregateSchema ({ field?, function, groupBy }), the same schema the react-page publish gate parses: function and groupBy are REQUIRED, field is optional because only count counts rows rather than a column, and unknown keys are refused rather than dropped'),
25392539
xAxisKey: z.string().optional().describe('INTERNAL (relay-composed) — the category column the renderer binds the x axis to. Authors write the spec xAxis: { field }; all five producers compute this key'),
2540+
// `series` copies the `{ dataKey }` arm of `ChartRendererProps.schema.series`
2541+
// WITHOUT that arm's per-series `type` (objectui#8086), deliberately
2542+
// (objectui#10584): widening a published accept set waits for a named
2543+
// producer that writes `type` on this node. The `.describe()` says so and
2544+
// names `chartType` as this copy's override, because that string is what an
2545+
// author-facing tool renders. The TS twin in `../objectql.ts` carries the
2546+
// ground.
25402547
series: z.array(z.object({
25412548
dataKey: z.string().describe('Result column this series plots'),
25422549
label: z.string().optional().describe('Series display label'),
@@ -2547,7 +2554,7 @@ export const ObjectChartSchema = BaseSchema.extend({
25472554
stack: z.string().optional().describe('Stack identifier to group series'),
25482555
yAxis: z.enum(['left', 'right']).optional().describe('Bind to a specific Y axis'),
25492556
color: z.string().optional().describe('Series color (hex/rgb/token)'),
2550-
})).optional().describe("INTERNAL (relay-composed) — plotted series in the renderer's internal { dataKey } contract, the arm ChartRendererProps declares. The spec's author-facing ChartSeriesSchema is the { name } arm and refuses dataKey by name; normalizeChartSchema is the one translation"),
2557+
})).optional().describe("INTERNAL (relay-composed) — plotted series in the renderer's internal { dataKey } contract: the { dataKey } arm ChartRendererProps declares, minus that arm's per-series type, which this copy does not declare. The per-series family override here is chartType (bar | line | area). The spec's author-facing ChartSeriesSchema is the { name } arm and refuses dataKey by name; normalizeChartSchema is the one translation"),
25512558
// Colors are overloaded kanban-style: a string[] is the positional palette
25522559
// (applied per category in order; fallback only), while a Record<value,color>
25532560
// is an explicit value→color map. A select/lookup dimension's option colors —

0 commit comments

Comments
 (0)