This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 49f7672
fix(plugin-report): a matrix report with columns draws its declared chart beside the cross-tab (objectui#10964) (#11043)
Fixes #10964
Clause-②: no
## What
A `matrix` report that declares `columns` now draws its declared `chart`
below the cross-tab. `ReportSchema` accepts that shape, but the
cross-tab branch of `DatasetReportRenderer` returned
`DatasetMatrixTable` before the only `report.chart` read, so the chart
parsed and drew nothing.
The non-joined presentations now share one wrapper and one chart slot.
`DatasetReportChart` runs its own `chart.xAxis` × `chart.yAxis` dataset
query, so it binds the same way next to a cross-tab as next to a grouped
table: `xAxis` names a dataset dimension (a matrix `rows` or `columns`
dimension) and `yAxis` a dataset measure. The chart still comes before a
tabular or summary table (and before a matrix without `columns`, which
degrades to the grouped table), and it comes after the cross-tab. The
ruling on objectstack-ai/objectstack#20293 places it "beside or below
the cross-tab", and below needs no new layout option.
Landing site: `packages/plugin-report/src/DatasetReportRenderer.tsx`, as
the card and the claim name it.
## Premises measured on objectui `origin/main` `3ad61001b`
- Mechanism assumption 1 holds: the `presentation === 'matrix' &&
across.length > 0` branch returned before the `chartCfg` /
`report.chart` read.
- Mechanism assumption 2 holds, so the stop valve did not fire.
`DatasetReportChart` queries `[chart.xAxis]` × `[chart.yAxis]` over
`report.dataset` through `useDatasetRows`, independent of the table next
to it, and `scopeOrder` already narrows `report.order` to that pair. No
new binding rule is involved. On the spec side, objectstack's
`validate-chart-bindings` (`packages/lint`) already treats a chart on
every non-`joined` report as drawn (`drawsChart` is `report.type !==
'joined'`) and binds `chart.xAxis` to a dataset dimension and
`chart.yAxis` to a dataset measure: the binding this renderer now
honours on the matrix arm too.
- Mechanism assumption 3 holds: no example carries a matrix report with
both `columns` and a `chart`, so the pin builds its own document.
## Also changed, because this round made it false
- The out-of-spec chart-type notice said "the grouped table below
carries this report's numbers". On a matrix the notice now sits after
the cross-tab, so it names no position: "the report's table carries its
numbers". Code comments that said the table sits "beneath" the chart
slot now say "beside".
- The matrix wrapper now carries the same `flex flex-col gap-3` classes
and `data-report-presentation` attribute the other non-joined
presentations carry. `git grep` finds no reader of
`data-report-presentation` outside the renderer.
- Docs (AGENTS.md commandment 2): the "Embedded chart" sections of
`packages/plugin-report/README.md` and
`content/docs/plugins/plugin-report.mdx` say where the chart draws for
each type. Prose only, no fenced block.
## Tests
New pin
`packages/plugin-report/src/__tests__/DatasetReportRenderer.matrixChart-10964.test.tsx`:
- a matrix report with `columns` and a `chart` draws both, with the
chart after the cross-tab in document order, from its own `['status']` ×
`['est_hours']` query;
- the control, the same report without `chart`, draws the cross-tab only
and issues exactly one query (the cross-tab's);
- an `xAxis` naming the ACROSS dimension binds the same way;
- an out-of-spec chart type on a matrix reaches the visible notice,
after the cross-tab.
Reverse verification. The implementation was committed first
(`cad6b4745`). The renderer file was then checked out from BASE
`3ad61001b` with the pin kept, under a trap-guarded restore. After the
mutation the on-disk blob equals the BASE blob `c362912eb` and the
fix-marker count went from 3 to 0. The run gave `Tests 3 failed | 1
passed (4)`: the three chart cases red and the control green, as
predicted in the pin's header. After the restore the on-disk blob equals
the HEAD blob `9560f4d4b` and `git diff HEAD` is 0 bytes.
Gates, at HEAD `ec7caad07`:
- `pnpm exec vitest run packages/plugin-report/`: `Test Files 23 passed
(23)`, `Tests 232 passed | 7 skipped (239)`. The 7 skips are the
`describe.runIf(DRIVEN)` blocks of
`formatValue.dateOnlyZone-10844.test.ts`.
- `pnpm --filter @object-ui/plugin-report type-check` (`tsc --noEmit &&
tsc -p tsconfig.test.json`): exit 0. `tsc -p tsconfig.test.json
--listFilesOnly` includes the pin. The dependency closure was built
first with `turbo run build --filter='@object-ui/plugin-report^...'`.
- `pnpm exec eslint` on the two changed `.tsx` files: 2 files linted, 0
errors, 5 warnings. The BASE renderer carries the same 5 warnings under
the same rules, shifted 3 lines by the new doc lines, so none is new.
- Exit 0: `check-changeset-presence`, `check-control-bytes`,
`check-new-cross-file-line-citations`, `check-changeset-no-major`,
`check-changeset-fixed`, `check-changeset-claims`,
`check-changeset-overwrite`, `check-pending-changeset-literals`,
`check-doc-links`, `check-doc-fence-languages`, `check-test-path-roots`,
`check-unreferenced-sources`, `check-vi-mock-specifiers`.
- `check-readme-exports`: exit 1 on this checkout because 24 unrelated
packages are unbuilt and it cannot judge them. With plugin-report built,
its README has 0 findings.
- NOT MEASURED: `check-sdui-registration-pins`, reason: it needs a
console build (`apps/console/dist/assets`), and the diff touches no
registration and no `sideEffects`. Declared to CI.
ESLint narrowing, declared. (1) The population is read from eslint
itself: the `.md` / `.mdx` files in this diff answer "File ignored
because no matching configuration was supplied". (2) The file count is
read from `--format json`: 2. (3) Invariance: `eslint.config.js` enables
no type-aware linting (no `projectService`, no `parserOptions.project`),
so this diff cannot move a verdict on an untouched file. The repo-wide
`pnpm lint` is CI's.
## Acceptance notes
- objectstack `packages/spec/src/ui/report.zod.ts`: the doc comment on
`ReportSchema.chart` says the chart is plotted "above the report's
table". That still holds for tabular and summary reports. On a matrix
with `columns` the chart now draws below the cross-tab, per the ruling.
It is a doc-comment word with no accept-set change, so it is not filed.
Carrier: the spec seat on objectstack-ai/objectstack#20293, when that
coordination card wraps up.
- The notice and "Loading chart…" strings in `DatasetReportChart` are
English literals outside the i18n catalogue. That predates this PR and
is unchanged in kind. Not filed; carrier: none.
---
_Generated by [Claude
Code](https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 99878d8 commit 49f7672
5 files changed
Lines changed: 261 additions & 51 deletions
File tree
- .changeset
- content/docs/plugins
- packages/plugin-report
- 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 | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
204 | 209 | | |
205 | 210 | | |
206 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
259 | 264 | | |
260 | 265 | | |
261 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
744 | | - | |
| 747 | + | |
745 | 748 | | |
746 | 749 | | |
747 | 750 | | |
| |||
758 | 761 | | |
759 | 762 | | |
760 | 763 | | |
761 | | - | |
762 | | - | |
| 764 | + | |
| 765 | + | |
763 | 766 | | |
764 | 767 | | |
765 | 768 | | |
| |||
933 | 936 | | |
934 | 937 | | |
935 | 938 | | |
936 | | - | |
| 939 | + | |
937 | 940 | | |
938 | 941 | | |
939 | 942 | | |
| |||
974 | 977 | | |
975 | 978 | | |
976 | 979 | | |
977 | | - | |
| 980 | + | |
978 | 981 | | |
979 | 982 | | |
980 | 983 | | |
| |||
1032 | 1035 | | |
1033 | 1036 | | |
1034 | 1037 | | |
1035 | | - | |
| 1038 | + | |
1036 | 1039 | | |
1037 | 1040 | | |
1038 | 1041 | | |
1039 | 1042 | | |
1040 | | - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1041 | 1046 | | |
1042 | 1047 | | |
1043 | 1048 | | |
1044 | 1049 | | |
1045 | 1050 | | |
1046 | | - | |
| 1051 | + | |
1047 | 1052 | | |
1048 | 1053 | | |
1049 | 1054 | | |
| |||
1058 | 1063 | | |
1059 | 1064 | | |
1060 | 1065 | | |
1061 | | - | |
| 1066 | + | |
1062 | 1067 | | |
1063 | 1068 | | |
1064 | 1069 | | |
| |||
1104 | 1109 | | |
1105 | 1110 | | |
1106 | 1111 | | |
1107 | | - | |
| 1112 | + | |
1108 | 1113 | | |
1109 | 1114 | | |
1110 | 1115 | | |
| |||
1613 | 1618 | | |
1614 | 1619 | | |
1615 | 1620 | | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
1620 | | - | |
1621 | | - | |
1622 | | - | |
1623 | | - | |
1624 | | - | |
1625 | | - | |
1626 | | - | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
| 1621 | + | |
1632 | 1622 | | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
| 1623 | + | |
1638 | 1624 | | |
1639 | | - | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
1640 | 1634 | | |
1641 | 1635 | | |
1642 | 1636 | | |
1643 | 1637 | | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
1644 | 1680 | | |
1645 | 1681 | | |
1646 | 1682 | | |
1647 | 1683 | | |
1648 | 1684 | | |
1649 | 1685 | | |
1650 | 1686 | | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
| 1687 | + | |
| 1688 | + | |
1670 | 1689 | | |
1671 | 1690 | | |
1672 | 1691 | | |
0 commit comments