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

Commit 3ef0b51

Browse files
fix(plugin-map, plugin-gantt): objectName is not a required registration input (objectui#7470) (#10390)
Fixes #7470 Clause-②: no ## What changed Ruling 5809231477 (letter align, maintainer 「同意」), executed as written: - `objectName` loses `required: true` on every map and gantt registration key, re-derived by symbol on `origin/main` `62bc8a250`: `object-map` (namespace `plugin-map`), `map` (namespace `view`) and `object-gantt` (namespace `plugin-gantt`). The bare `gantt` key is already retired (objectui#8008), so gantt has one key today, not two. - Its `description` now states the rule: the record source is one of `data`, `staticData` and `objectName`, and the `object-map` / `object-gantt` schema refuses a block that declares none of them. - `packages/plugin-gantt/README.md`: the "`objectName` (required)" sentence is corrected. - No one-of vocabulary was added to the input declaration. The renderers' read order and the zod mirrors are unchanged. ## Why the description is true (hypothesis 3) `requireRecordSource` in `packages/types/src/zod/objectql.zod.ts` checks `RECORD_SOURCE_KEYS` (`data`, `staticData`, `objectName`) and adds an issue with `params.code` `RECORD_SOURCE_REQUIRED` when none is present. It is attached with `superRefine(requireRecordSource('object-map'))` on `ObjectMapSchema` and `superRefine(requireRecordSource('object-gantt'))` on `ObjectGanttSchema`. The new tests assert this directly, so the sentence in the description is checked by a test, not copied prose. ## What the required flag did at runtime `sdui-parser`'s `validateTree` turns a required input into a `missing-required-prop` ERROR. A `staticData`-only map or gantt drew that error while the schema accepted the block and the renderer drew it. After this change it no longer does. ## Hypothesis 2: pins and generated artefacts No pin or generated artefact asserted `required: true` for these inputs. `apps/console/public/manifest.json` (public-tier manifest) carries no map or gantt entry. No test in `plugin-map` / `plugin-gantt` read the inputs' `required`. `content/docs/plugins/plugin-map.mdx` and `plugin-gantt.mdx` already say "At least one of data / staticData / objectName is required", which is correct, so they are not touched. `packages/plugin-map/README.md` makes no required claim. ## Tests New tests: `packages/plugin-map/src/index.recordSourceInput-7470.test.tsx` (both map keys) and `packages/plugin-gantt/src/__tests__/recordSourceInput-7470.test.ts`. For each key they check four things: `objectName` is declared (non-vacuity) and is not required; the description names the three sources; the named schema refuses a block with no source, with `RECORD_SOURCE_REQUIRED`; and, as a control, the same schema accepts a `staticData`-only block. All runs are on head `2083a24f8`: - `pnpm exec vitest run packages/plugin-map/ packages/plugin-gantt/`: `Test Files 97 passed (97)`, `Tests 705 passed (705)`. - Reverse verification, done after the fix was committed. The mutation was put back with `ablation-replace.mjs`, and each anchor was confirmed to hit once. `required: true` restored on `object-gantt` gave `1 failed / 9 passed`. On `object-map` alone it gave `× 'object-map' — objectName is declared and not required`, and on `map` alone `× 'view:map' — …`. Each file was restored with `git checkout HEAD`, the restore was proved by matching the HEAD blob hash, and `git diff HEAD` was empty afterwards. The re-run was 10/10 green. The first map attempt was a no-op: the anchor was ambiguous (x2) and the tool refused it, so it was redone with per-key anchors. - `type-check` (`tsc --noEmit && tsc -p tsconfig.test.json`) for both packages: exit 0, after building the dependency closure. `--listFiles` confirms that both new test files are in the test program. ## Acceptance notes - The `map` key has no zod arm. `safeValidateSchema` on a `map` node with `staticData` gives `invalid_union` ("Invalid input"), while `object-map` with the same content passes. So on the `map` key the description's sentence talks about the `object-map` schema, and a bare `map` node is refused whatever it carries. This is reported to the seat as a finding and not changed here. - `data` / `staticData` are still not declared inputs on map or gantt. `validateTree` therefore reports a `staticData`-only block as `unknown-prop`, which is a warning, not an error. The ruling did not order declaring them, so this is reported to the seat. - `object-calendar` / `calendar` have the same disagreement one plugin over: `objectName` is `required: true` while `ObjectCalendarSchema` carries `requireRecordSource('object-calendar')`. That is out of this card's ruling and reported to the seat. ## Gates (local, targeted) Exit 0: `check:new-line-citations` (`VERDICT … 0 new citation(s)`), `check:control-bytes`, `check:element-data-source-declaration`, `check:component-surface-parity` (report-only; its divergences are on the `map` / `gantt` config inputs and existed before this change), `check:changeset-claims` (it points at `.changeset/6470-gantt-dependency-field-deprecated.md`, which names the gantt README; I read that paragraph and it is still true), `check:pending-changeset-literals`, `check:vi-mock-*`, `check:test-path-roots`, `check:registry-bare-names`, `check:phantom-deps`, changeset presence, and `check-governed-queue-guard --test` (NOT GOVERNED). NOT MEASURED, left to CI: - `check:sdui-registration-pins` exited 2 because the console build it reads was absent. - `check:readme-exports` exited 1 because only part of the packages were built, so its population collapsed below its floors. ESLint over the 4 touched source and test files: 0 errors (warnings only, the same kinds as the file's existing ones). The config is not type-aware, so this diff cannot change verdicts on untouched files. Session `https://claude.ai/code/session_01D486C1axmXnrkJMNUfz2eb`, `domain:ui#3` seat. --- _Generated by [Claude Code](https://claude.ai/code/session_01D486C1axmXnrkJMNUfz2eb)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent ce6bd99 commit 3ef0b51

6 files changed

Lines changed: 206 additions & 5 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@object-ui/plugin-map': patch
3+
'@object-ui/plugin-gantt': patch
4+
---
5+
6+
fix(plugin-map, plugin-gantt): the registrations no longer declare `objectName` a required input
7+
8+
Both renderers read their records from one of three keys (`data`, then
9+
`staticData`, then `objectName`), and the `object-map` / `object-gantt` zod schemas
10+
enforce "one of the three" through `requireRecordSource` (objectui#6939). The
11+
registrations' designer-facing `inputs` still said `objectName` was required, on
12+
`object-map`, `map` and `object-gantt`, so the html tier's validator reported a
13+
`missing-required-prop` error on a block authored on `staticData` or `data` that
14+
the schema accepts and the renderer draws.
15+
16+
`objectName` is now declared without `required`, and its description states the
17+
rule: the record source is one of `data`, `staticData` and `objectName`, and the
18+
schema refuses a block that declares none of them. No one-of form was added to the
19+
input declaration; the zod refinement stays the place that enforces it. The
20+
renderers' read order is unchanged. The `@object-ui/plugin-gantt` README sentence
21+
that called `objectName` required is corrected (objectui#7470).

‎packages/plugin-gantt/README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ claim these schema types:
138138
| `object-gantt` | `plugin-gantt:object-gantt` | `ObjectGanttRenderer` |
139139

140140
Both spellings of the surviving key resolve — `register` stores the namespaced key
141-
*and* a bare-`type` fallback. It declares two inputs: `objectName` (required) and
142-
the `gantt` configuration object.
141+
*and* a bare-`type` fallback. It declares two inputs: `objectName` and the `gantt`
142+
configuration object. `objectName` is not a required input: the record source is
143+
one of `data`, `staticData` and `objectName` (read in that order), and the
144+
`object-gantt` schema refuses a block that declares none of them.
143145

144146
> **The bare `gantt` key is retired** (objectui#8008, ruled 2026-09-09). This
145147
> table used to carry a second row, `gantt` / `view:gantt`, on the same renderer.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/**
10+
* objectui#7470 — the designer face stops claiming `objectName` is required.
11+
*
12+
* `ObjectGantt`'s `getDataConfig` reads `data`, then `staticData`, then
13+
* `objectName`, and the `object-gantt` zod schema carries `requireRecordSource`
14+
* (objectui#6939): one of the three must be present, none is required alone.
15+
* The registration still declared `objectName` with `required: true`, so the
16+
* registry said the opposite of the schema — and `sdui-parser`'s `validateTree`
17+
* turns a required input into a `missing-required-prop` ERROR, which a
18+
* `staticData`-only gantt drew while the schema accepted it.
19+
*
20+
* Ruled (letter align): drop `required`, state the one-of rule in the
21+
* description, add no one-of vocabulary to the input declaration.
22+
*
23+
* `object-gantt` is the one registration key: the bare `gantt` key is retired
24+
* (objectui#8008, pinned by `bare-gantt-node-key-retired-8008.test.ts`).
25+
*
26+
* Rows:
27+
* 1. `objectName` is declared (non-vacuity) and is not required.
28+
* 2. Its description names all three record sources.
29+
* 3. The description's claim about the schema is TRUE: `ObjectGanttSchema`
30+
* refuses a block with none of the three with the refinement's own code,
31+
* and accepts a block authored on `staticData` alone.
32+
*/
33+
34+
import { describe, it, expect } from 'vitest';
35+
import { ComponentRegistry } from '@object-ui/core';
36+
import { ObjectGanttSchema } from '@object-ui/types/zod';
37+
// Module scope, not a hook: this import IS the registration (AGENTS.md
38+
// test-discipline section).
39+
import '../index';
40+
41+
const objectNameInput = () =>
42+
((ComponentRegistry.getConfig('object-gantt', 'plugin-gantt') as any)?.inputs ?? []).find(
43+
(i: any) => i.name === 'objectName',
44+
);
45+
46+
describe('objectui#7470 — the object-gantt registration does not declare objectName required', () => {
47+
it('objectName is declared and not required', () => {
48+
const input = objectNameInput();
49+
expect(input, 'object-gantt declares objectName').toBeDefined();
50+
expect(input.required).not.toBe(true);
51+
});
52+
53+
it('the description names the three record sources', () => {
54+
const description: string = objectNameInput()?.description ?? '';
55+
for (const key of ['`data`', '`staticData`', '`objectName`']) {
56+
expect(description).toContain(key);
57+
}
58+
expect(description).toContain('`object-gantt` schema refuses');
59+
});
60+
61+
it('the schema the description names refuses a block with no record source', () => {
62+
const parsed = ObjectGanttSchema.safeParse({ type: 'object-gantt' });
63+
expect(parsed.success).toBe(false);
64+
const codes = parsed.success
65+
? []
66+
: parsed.error.issues.map((issue: any) => issue.params?.code);
67+
expect(codes).toContain('RECORD_SOURCE_REQUIRED');
68+
});
69+
70+
it('control: the same schema accepts a block authored on staticData alone', () => {
71+
const parsed = ObjectGanttSchema.safeParse({
72+
type: 'object-gantt',
73+
staticData: [{ id: '1', title: 'Task', start: '2026-01-01', end: '2026-01-02' }],
74+
});
75+
expect(parsed.success).toBe(true);
76+
});
77+
});

‎packages/plugin-gantt/src/index.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,17 @@ export const ObjectGanttRenderer: React.FC<{ schema: any }> = elementDataSourceB
112112
);
113113
});
114114

115+
// `objectName` is NOT a required input (objectui#7470): `getDataConfig` reads
116+
// `data`, then `staticData`, then `objectName`, and the `object-gantt` zod
117+
// schema (`requireRecordSource`, objectui#6939) is where "one of the three" is
118+
// enforced. The input list is a flat declaration with a boolean `required`, so
119+
// it states the rule in the description rather than growing a one-of form.
115120
ComponentRegistry.register('object-gantt', ObjectGanttRenderer, {
116121
namespace: 'plugin-gantt',
117122
label: 'Object Gantt',
118123
category: 'view',
119124
inputs: [
120-
{ name: 'objectName', type: 'string', required: true },
125+
{ name: 'objectName', type: 'string', description: 'ObjectQL object name. The record source is one of `data`, `staticData` and `objectName`; the `object-gantt` schema refuses a block that declares none of them.' },
121126
{ name: 'gantt', type: 'object', description: 'startDateField, endDateField, titleField, progressField, percentageField, colorField, dependenciesField' },
122127
],
123128
});
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/**
10+
* objectui#7470 — the designer face stops claiming `objectName` is required.
11+
*
12+
* `ObjectMap`'s `getDataConfig` reads `data`, then `staticData`, then
13+
* `objectName`, and the `object-map` zod schema carries `requireRecordSource`
14+
* (objectui#6939): one of the three must be present, none is required alone.
15+
* Both registration keys still declared `objectName` with `required: true`, so
16+
* the registry said the opposite of the schema — and `sdui-parser`'s
17+
* `validateTree` turns a required input into a `missing-required-prop` ERROR,
18+
* which a `staticData`-only map drew while the schema accepted it.
19+
*
20+
* Ruled (letter align): drop `required`, state the one-of rule in the
21+
* description, add no one-of vocabulary to the input declaration.
22+
*
23+
* Rows, per registration key:
24+
* 1. `objectName` is declared (non-vacuity: a wrong type/namespace read fails
25+
* here) and is not required.
26+
* 2. Its description names all three record sources.
27+
* 3. The description's claim about the schema is TRUE: `ObjectMapSchema`
28+
* refuses a block with none of the three with the refinement's own code,
29+
* and accepts a block authored on `staticData` alone.
30+
*/
31+
32+
import { describe, it, expect, vi } from 'vitest';
33+
34+
// `src/index.tsx` pulls in the real map bindings; stub them so a plain module
35+
// import needs no WebGL canvas (same stub as `index.registration.test.tsx`).
36+
vi.mock('react-map-gl/maplibre', () => ({
37+
default: () => null,
38+
Map: () => null,
39+
NavigationControl: () => null,
40+
Marker: () => null,
41+
Popup: () => null,
42+
}));
43+
44+
import { ComponentRegistry } from '@object-ui/core';
45+
import { ObjectMapSchema } from '@object-ui/types/zod';
46+
// Module scope, not a hook: this import IS the registration (AGENTS.md
47+
// test-discipline section).
48+
import './index';
49+
50+
const MAP_KEYS = [
51+
{ label: 'object-map', type: 'object-map', namespace: 'plugin-map' },
52+
{ label: 'view:map', type: 'map', namespace: 'view' },
53+
] as const;
54+
55+
const objectNameInput = (type: string, namespace: string) =>
56+
((ComponentRegistry.getConfig(type, namespace) as any)?.inputs ?? []).find(
57+
(i: any) => i.name === 'objectName',
58+
);
59+
60+
describe('objectui#7470 — map registrations do not declare objectName required', () => {
61+
it.each(MAP_KEYS)('$label — objectName is declared and not required', ({ type, namespace }) => {
62+
const input = objectNameInput(type, namespace);
63+
expect(input, `${type} declares objectName`).toBeDefined();
64+
expect(input.required).not.toBe(true);
65+
});
66+
67+
it.each(MAP_KEYS)('$label — the description names the three record sources', ({ type, namespace }) => {
68+
const description: string = objectNameInput(type, namespace)?.description ?? '';
69+
for (const key of ['`data`', '`staticData`', '`objectName`']) {
70+
expect(description).toContain(key);
71+
}
72+
expect(description).toContain('`object-map` schema refuses');
73+
});
74+
75+
it('the schema the description names refuses a block with no record source', () => {
76+
const parsed = ObjectMapSchema.safeParse({ type: 'object-map' });
77+
expect(parsed.success).toBe(false);
78+
const codes = parsed.success
79+
? []
80+
: parsed.error.issues.map((issue: any) => issue.params?.code);
81+
expect(codes).toContain('RECORD_SOURCE_REQUIRED');
82+
});
83+
84+
it('control: the same schema accepts a block authored on staticData alone', () => {
85+
const parsed = ObjectMapSchema.safeParse({
86+
type: 'object-map',
87+
staticData: [{ id: '1', lat: 1, lng: 2 }],
88+
});
89+
expect(parsed.success).toBe(true);
90+
});
91+
});

‎packages/plugin-map/src/index.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,17 @@ export const ObjectMapRenderer: React.FC<any> = elementDataSourceBlock(({ schema
5959
);
6060
});
6161

62+
// `objectName` is NOT a required input (objectui#7470): `getDataConfig` reads
63+
// `data`, then `staticData`, then `objectName`, and the `object-map` zod schema
64+
// (`requireRecordSource`, objectui#6939) is where "one of the three" is
65+
// enforced. The input list is a flat declaration with a boolean `required`, so
66+
// it states the rule in the description rather than growing a one-of form.
6267
ComponentRegistry.register('object-map', ObjectMapRenderer, {
6368
namespace: 'plugin-map',
6469
label: 'Object Map',
6570
category: 'view',
6671
inputs: [
67-
{ name: 'objectName', type: 'string', required: true },
72+
{ name: 'objectName', type: 'string', description: 'ObjectQL object name. The record source is one of `data`, `staticData` and `objectName`; the `object-map` schema refuses a block that declares none of them.' },
6873
{ name: 'map', type: 'object', description: 'latitudeField, longitudeField, titleField' },
6974
],
7075
});
@@ -74,7 +79,7 @@ ComponentRegistry.register('map', ObjectMapRenderer, {
7479
label: 'Map View',
7580
category: 'view',
7681
inputs: [
77-
{ name: 'objectName', type: 'string', required: true },
82+
{ name: 'objectName', type: 'string', description: 'ObjectQL object name. The record source is one of `data`, `staticData` and `objectName`; the `object-map` schema refuses a block that declares none of them.' },
7883
{ name: 'map', type: 'object', description: 'latitudeField, longitudeField, titleField' },
7984
],
8085
});

0 commit comments

Comments
 (0)