Skip to content

Commit b09ce67

Browse files
fix(spec): chart drillDown mode guidance names object-data-table, not TABLE/PIVOT/METRIC (#20211)
Fixes #20152 Clause-②: no ## What changed `ChartDrillDownSchema`'s `guidance` entry for `mode` (`packages/spec/src/ui/chart.zod.ts`) told an author who wrote `drillDown.mode` on a chart that the key belonged on a "TABLE / PIVOT / METRIC" widget. Two of those three blocks now refuse the same key on arrival: - `object-metric` refuses `drillDown.mode` at its TypeScript door since objectui#9002 (PR objectui#10681, merged) — the ruling this card follows (objectui#9002 comment `5643445104`, B). - `object-pivot` refuses it at its TypeScript door since objectui#10685 (PR objectui#10710, merged). Measured on objectui `origin/main` (`0896838`): neither `object-metric`'s nor `object-pivot`'s renderer ever read `mode`; only `object-data-table` does (`ObjectDataTableSchema.drillDown` / `plugin-dashboard/src/ObjectDataTable.tsx`). So the old sentence sent an author straight into a second refusal on two of the three blocks it named, and a stored config that lands on `object-pivot` (no zod mirror there) is silently ignored with no diagnostic. The guidance now names the one block that actually reads `mode`: > `mode` (`'filter'` | `'record'`) is objectui's `object-data-table` drill key, not a chart one: … The reasoning clause and "Delete the key" are unchanged. Its pin at `packages/spec/src/ui/chart.test.ts:707` and the mirror pin at `packages/lint/src/validate-react-page-props.test.ts:1033` moved with the wording. Out of scope on this card's own evidence (triage note 3, comment `5851546523`): the neighbouring `report` guidance entry ("a METRIC / PIVOT widget capability") is left untouched — its blocks were not remeasured here. ## Premise check (H1) Re-verified on objectui `origin/main` (`0896838`, PR objectui#10710 merged): `ObjectMetricDrillDownConfig` and the new `ObjectPivotDrillDownConfig` both carry `mode?: never` tombstones; `object-data-table` is the sole reader (`isDrillEnabled` guards it, `'record'` opens the row, `'filter'` turns the drill off). Premise holds in both the pre- and post-#10710 state, so `premise_still_valid: true`. ## Ships, so this carries a changeset `@objectstack/spec`'s published `files[]` includes both `dist` and `src/**/*.zod.ts`; `chart.zod.ts` ships as source verbatim, and the sentence is also a runtime string in `dist/ui/index.js` / `dist/ui/index.mjs` (measured after a rebuild: 1 occurrence of the new wording in each, 0 of the old "TABLE / PIVOT / METRIC" spelling). `.changeset/20152-chart-drilldown-mode-guidance.md` — `patch`, no accept/reject behaviour changes. ## Verification - `pnpm --filter @objectstack/spec build` — clean; new wording present in `dist/ui/index.{js,mjs}`, old wording absent. - `pnpm --filter @objectstack/spec check:generated` — all 15 generated artifacts up to date (no regeneration needed for a guidance-text-only change). - `pnpm --filter @objectstack/spec test` — 541 test files / 15896 tests passed. - `pnpm --filter @objectstack/spec typecheck` — clean. - `pnpm --filter @objectstack/lint test` — 108 test files / 4169 tests passed, after building lint's workspace dependency closure (`@objectstack/formula`, `@objectstack/spec`, `@objectstack/sdui-parser` — none were built in the fresh worktree). - `pnpm --filter @objectstack/lint typecheck` — clean. - `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands`, re-derived after adding the changeset → 83 derived families; ran all 83 and reconciled with `--ran`: **78 run (all green), 5 NOT MEASURED, 0 UNRUN**. The 5 NOT MEASURED (`check:doc-formula-expressions`, `check:docs-transcript-drift`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:type-check-debt`) each exit 3 `PREREQUISITE NOT MET` — they read a whole-tree `pnpm build` this local verification's scope does not owe (CI's `Build Core` job covers it). - Six silent-verdict rosters whose scan directory this diff sits in were read directly rather than trusted on silence: `check-changeset-fixed`, `check:meta-url-spelling`, `check:spec-changes`, `check:authz-resolver`, `check:error-code-casing`, `check:filter-alias-parity` — all green. --- _Generated by [Claude Code](https://claude.ai/code/session_01QcAS3qiYYZNezaxZxaUdMV)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent af32cf9 commit b09ce67

4 files changed

Lines changed: 44 additions & 3 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
`ChartDrillDownSchema`'s refusal text for `drillDown.mode` names the one objectui block that reads it, not all three it used to
6+
7+
An author (or an AI) who writes `drillDown.mode` on a chart gets this guidance
8+
sentence back from `objectui validate` / `safeValidateSchema`. It used to read:
9+
10+
> `mode` (`'filter'` | `'record'`) is a TABLE / PIVOT / METRIC drill key, not a
11+
> chart one: …
12+
13+
`object-metric` has refused `drillDown.mode` at its TypeScript door since
14+
objectui#9002 (PR objectui#10681, merged, on the maintainer ruling recorded
15+
there, comment `5643445104`), and `object-pivot` has refused it since
16+
objectui#10685 (PR objectui#10710, merged). Measured on objectui `origin/main`:
17+
neither block's renderer ever read `mode`; only `object-data-table` does. So
18+
the old sentence sent an author who followed it straight into a second
19+
refusal on two of the three blocks it named — right on `object-pivot` and
20+
`object-metric` (both now refuse the key by name), and a stored JSON config
21+
that carries it there is silently ignored with no diagnostic.
22+
23+
The sentence now names the one block that actually reads `mode`:
24+
25+
> `mode` (`'filter'` | `'record'`) is objectui's `object-data-table` drill
26+
> key, not a chart one: …
27+
28+
The reasoning clause and "Delete the key" are unchanged. The neighbouring
29+
`report` guidance entry (a METRIC / PIVOT widget capability) is untouched —
30+
its blocks were not remeasured on this card.
31+
32+
⛔ No accept/reject behaviour changes. `mode` remains refused on
33+
`ChartDrillDownSchema` exactly as before; only the refusal text changes.
34+
35+
**This is shipped, which is why it carries a changeset rather than
36+
`skip-changeset`.** `@objectstack/spec`'s published `files[]` ships both
37+
`dist` and `src/**/*.zod.ts`, and `chart.zod.ts` is one of the latter — so the
38+
sentence ships as source verbatim, and also as a runtime string built into
39+
`dist/ui/index.js` / `dist/ui/index.mjs` (measured: present at 1 occurrence
40+
each after a rebuild, with the old "TABLE / PIVOT / METRIC" spelling absent
41+
from both).

‎packages/lint/src/validate-react-page-props.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ describe('validateReactPageProps — <ObjectChart drillDown> (#5022)', () => {
10301030
it('rejects a key that belongs to another widget, with the reason rather than a rename', () => {
10311031
const f = validateReactPageProps(drill(`{ mode: 'record' }`));
10321032
const hit = f.find((x) => x.rule === REACT_CHART_DRILLDOWN_INVALID);
1033-
expect(hit!.message).toContain('TABLE / PIVOT / METRIC');
1033+
expect(hit!.message).toContain('object-data-table');
10341034
});
10351035

10361036
it('rejects the report near-key spelling and names the type difference', () => {

‎packages/spec/src/ui/chart.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ describe('#5022 — ChartDrillDownSchema', () => {
704704
});
705705

706706
it.each([
707-
['mode', 'TABLE / PIVOT / METRIC'],
707+
['mode', 'object-data-table'],
708708
['report', 'METRIC / PIVOT'],
709709
['view', 'read by no renderer at all'],
710710
['sort', 'read by no renderer'],

‎packages/spec/src/ui/chart.zod.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ export const ChartDrillDownSchema = lazySchema(() => strictObject(
470470
// Keys of objectui's wider renderer-side drill config. Each is real —
471471
// on another widget — so a rename suggestion would be actively wrong.
472472
mode:
473-
'`mode` (`\'filter\'` | `\'record\'`) is a TABLE / PIVOT / METRIC drill key, not a chart one: it chooses whether a click drills through an aggregate to a filtered list or straight to one record. A chart segment is always an aggregate, so a chart drill is always the filtered-list kind and there is nothing to discriminate. Delete the key.',
473+
'`mode` (`\'filter\'` | `\'record\'`) is objectui\'s `object-data-table` drill key, not a chart one: it chooses whether a click drills through an aggregate to a filtered list or straight to one record. A chart segment is always an aggregate, so a chart drill is always the filtered-list kind and there is nothing to discriminate. Delete the key.',
474474
report:
475475
'`report` (drill into an analytical report instead of the record list) is a METRIC / PIVOT widget capability in the objectui renderer; `<ObjectChart>` does not read it and renders the record list regardless. Delete the key, or drill from a metric widget instead.',
476476
view:

0 commit comments

Comments
 (0)