This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 6837bfa
fix(plugin-charts): an object-chart whose family is on specType gets compareTo as its chartType twin does (objectui#11530) (#11537)
Fixes #11530
Clause-②: no
Dispatched by the PM loop, round 1 (`domain:ui` seat 1), claim comment
`5965044944`, session
`https://claude.ai/code/session_01YLg8XqWGJ785fwQ5v4pH37`. Triage ruling
`5964859128` executed as written.
## The defect, reproduced at BASE `06634afe7`
`ObjectChart` gates the comparison fetch (`wantsComparison`) and the
overlay series (`enableComparisonSeries`) on
`chartTypeIgnoresCompareTo(schema.chartType)`. A family on `specType`
was invisible to both. Measured through the real `SchemaRenderer` with
the final pin and `ObjectChart.tsx` at BASE:
- The card's document (`properties` bag, `specType: scatter`,
`compareTo: { kind: 'previousYear' }`): **2** aggregate calls, then the
`scatter-multi-series` refusal "A scatter plots one measure. Keep
exactly one series: amount, amount__comparison", with no chart surface.
- `specType` set to `pie`, `donut` or `funnel`: **2** calls, and one pie
(or funnel) drawn. The comparison rows are never drawn.
- The `chartType` twins: **1** call each, and the scatter draws.
## The fix
- **One reader.** `chartFamily = normalizeChartSchema(schema,
language).chartType`, memoised at component scope. That is the value
`ChartRenderer` dispatches on (`schema.chartType ?? spec.chartType` over
the same normalizer: `chartType`, else `specType`), so the gates read
the family the chart is drawn as. It was already importable, so
`normalizeChartSchema.ts` is untouched and nothing new is exported.
There is no hand-rolled `chartType ?? specType`.
- **One list.** Both gates read that family through
`chartTypeIgnoresCompareTo`. Its family list in `@object-ui/core` is
untouched (objectui#7495).
- **The fetch key.** The fetch callback's dependency list keys on
`chartFamily` instead of `schema.chartType`: it is the input of the same
compare decision. A `specType` family change now re-runs the fetch under
the new family's gate.
- `language` is passed although no label is read off the result, so
`resolveChartCategoryField` stays the package's one call without it, as
the comment beside it says.
- **Where `specType` sits.** The `SchemaRenderer` properties hoist
copies `properties.*` flat onto the node before `ObjectChart` sees it,
and `normalizeChartSchema` reads the flat key. So the bag form and the
flat forms reach the same reader. The pin covers each shape.
No other `schema.chartType` read in `ObjectChart.tsx` decides behaviour.
The three code reads before the change were the two gates and the fetch
key; after it there are none.
## Pins
`packages/plugin-charts/src/__tests__/object-chart-compareto-spectype-11530.test.tsx`
(new), through the real `SchemaRenderer` and this package's
registrations. Every expectation is read off
`chartTypeIgnoresCompareTo`; no family list is restated.
- **Per object-path shape** (the `properties` bag, which is the card's
document; the dashboard producer's flat node; the react-page wrapper's
node):
- `specType: scatter` with `compareTo` draws one scatter after 1 call,
with no refusal;
- `specType: pie` makes 1 call;
- CONTROL: `specType: bar` makes 2 calls and draws 2 bars (the overlay);
- CONTROL: the `chartType` twins answer scatter 1, pie 1, bar 2 with the
overlay.
- **The flat node with inline rows that already carry the comparison
column.** It fetches nothing, so it isolates the overlay gate.
`specType: scatter` draws instead of refusing; CONTROL: `bar` on both
channels draws the overlay.
- **Every spec family (20) on the card's document:** `specType` makes
the call count `chartTypeIgnoresCompareTo` predicts, the same as
`chartType`, and shows the same form.
- **The dataset node** (scatter, pie, bar): both channels make the same
calls and show the same form.
- **A `specType` family change, bar to pie:** 2 calls, then exactly 1
more, and the pie drawn.
- **Premise:** the card's document parses on `safeValidateSchema` and
`StrictAnyComponentSchema` with scatter, pie and bar on `specType`.
## Reverse verification and ablation (predicted first, all at committed
head `4589e68c0`)
The subject resolves to `src` through the vitest alias, so no `dist` leg
applies. The three mutations went through objectstack's
`scripts/ablation-replace.mjs` (anchor 1 to 0, blob moved; restore
proven by blob equal to `HEAD` and an empty `git diff HEAD`). The BASE
leg was `git checkout 06634af -- ObjectChart.tsx`, restored with `git
checkout HEAD --` and the same two proofs.
| leg | prediction | reading |
|---|---|---|
| **BASE** `ObjectChart.tsx` | red: 3 shapes x (scatter, pie), inline
scatter, the 4 ignoring families in the matrix, the re-run row = 12 |
**12 failed, 28 passed (40)**, exactly those |
| **A1:** the fetch gate back to `schema.chartType` | the 6 shape rows,
the 4 matrix rows, and the re-run row (it re-runs, then fetches the
comparison) = 11; inline scatter stays green | **11 failed, 29 passed
(40)**, exactly those |
| **A2:** the overlay gate back to `schema.chartType` | only inline
scatter (the object paths never get the column) | **1 failed, 39 passed
(40)**, that one |
| **A3:** the fetch key back to `schema.chartType` | only the re-run row
(calls stay at 2) | **1 failed, 39 passed (40)**, that one |
## Gates (at `4589e68c0`)
- `pnpm exec vitest run packages/plugin-charts/` plus every test naming
`compareTo` or `chartTypeIgnoresCompareTo` (`git grep -l`; 17 outside
plugin-charts, in console, core, data-objectstack, plugin-dashboard,
react and types): **106 files, 1889 passed, 9 skipped**.
- `pnpm turbo run build --filter='./packages/*'` (39 of 39;
plugin-charts, plugin-dashboard, runner and app-shell rebuilt), then
`pnpm --filter @object-ui/plugin-charts type-check` (`tsc --noEmit` and
`tsc -p tsconfig.test.json`, whose file list includes the new pin): exit
0.
- `pnpm --filter @object-ui/console build`, the `Bundle Analysis`
program (`tsc`, vite build, SDUI manifest, `tsconfig.plugin.json`): exit
0.
- Exit 0 with their own verdict lines: `check:control-bytes`,
`check:new-line-citations` (0 new), `check-changeset-presence.mjs`,
`changeset:check`, `check:pending-changeset-literals`,
`check:self-import`, `check:test-path-roots`,
`check:vi-mock-specifiers`, `check:vi-mock-inherit`,
`check:vi-mock-override-shape`, `check:spec-symbols`,
`check:phantom-deps`, `check:unreferenced-sources`,
`check:esm-specifiers` (specifier leg), `check:sdui-registration-pins`,
`check:element-data-source-declaration`, `check:installed-pin-claims`,
`check:handler-key-reads`, `check:shell-escape-residue` and
`check:i18n-keys`.
- `check:changeset-claims` (report-only) named 4 pending changesets that
cite `ObjectChart.tsx`: `8650-chart-foreign-dialect-retired`,
`8885-object-chart-drilldown-title-compareto`,
`humanize-label-single-home-5444` and `objectchart-schema-anchor-7946`.
Each paragraph was read. None says how the compare gate reads the
family, so none goes false.
- **Lint, a declared narrowing.** `eslint --no-inline-config --format
json` over the changed files read 3 entries:
- the 2 TS files, 0 errors. `ObjectChart.tsx` has 41 warnings, the same
41 by rule as BASE (linted through `--stdin`). The pin has 2, both
`no-explicit-any` in the `vi.mock('recharts')` block, the sibling
pattern;
- the changeset, which the config ignores.
- The population is the root flat config: plugin-charts' `lint` is
`eslint .` and the package has no config of its own. `eslint.config.js`
sets no `parserOptions.project` / `projectService`, and no rule in
`eslint-rules/` reads the filesystem, so this diff cannot move a verdict
on an untouched file. The repo-wide lint belongs to CI.
## Acceptance notes
- **What an accepted document does differently:** `specType: scatter`
with `compareTo` draws instead of refusing; `specType` set to `pie`,
`donut` or `funnel` stops the unused comparison fetch, with the same
picture. A family on `chartType`, and every family that keeps
`compareTo` on either key, is unchanged. Changeset:
`@object-ui/plugin-charts` `patch`.
- **Route:** the ruling's effective family is read through
`normalizeChartSchema`, which is already exported and already called by
this file. Exporting the family expression on its own was the claim's
fallback and was not needed.
- **`Clause-②: no` holds:** no exported type moves; the change is inside
the component body.
- **The overlay gate alone** is reachable only when the rows already
carry the comparison column (inline or bound rows with an `aggregate`).
The pin's inline shape is that case, built to isolate it.
- **Noted, not filed:** the dataset-bound path of `ObjectChart` forwards
no `compareTo` to `queryDataset` for any family. The pin holds only that
both channels agree there. `compareTo` on `object-chart` is declared
INTERNAL (relay-composed by `DashboardRenderer`), and no producer of a
dataset-bound `object-chart` with `compareTo` was measured. Carrier:
none.
- **Docs:** nothing under `content/docs`, in the package README or under
`skills/` mentions `compareTo`, so no doc moves.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01YLg8XqWGJ785fwQ5v4pH37)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8bfc001 commit 6837bfa
3 files changed
Lines changed: 424 additions & 4 deletions
File tree
- .changeset
- packages/plugin-charts/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
557 | 580 | | |
558 | 581 | | |
559 | 582 | | |
| |||
809 | 832 | | |
810 | 833 | | |
811 | 834 | | |
812 | | - | |
813 | | - | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
814 | 839 | | |
815 | 840 | | |
816 | 841 | | |
| |||
944 | 969 | | |
945 | 970 | | |
946 | 971 | | |
947 | | - | |
| 972 | + | |
948 | 973 | | |
949 | 974 | | |
950 | 975 | | |
| |||
1153 | 1178 | | |
1154 | 1179 | | |
1155 | 1180 | | |
| 1181 | + | |
| 1182 | + | |
1156 | 1183 | | |
1157 | 1184 | | |
1158 | 1185 | | |
1159 | 1186 | | |
1160 | 1187 | | |
1161 | 1188 | | |
1162 | 1189 | | |
1163 | | - | |
| 1190 | + | |
1164 | 1191 | | |
1165 | 1192 | | |
1166 | 1193 | | |
| |||
0 commit comments