You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while implementing #7073 (docs correction on overlay/context-menu.mdx). Filed rather than decided: the docs row was mine, this is a declaration that looks wrong, which is not.
Measured on origin/main592acafbeed97c5aed81a18f4d848b6179d3c044.
The measurement
fact
evidence
children is declared required on the TS type
packages/types/src/overlay.ts:471 — children: SchemaNode | SchemaNode[]; inside ContextMenuSchema, no ?
...and required in the zod mirror
packages/types/src/zod/overlay.zod.ts:190 — children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Context menu children'), no .optional()
overlay.ts:477-479 — "the renderer renders trigger, NOT the declared ContextMenuSchema.children, which no read site consumes"
the only shipped catalog fixture omits it
examples/schema-catalog/src/schemas/components-overlay-context-menu/basic-context-menu.json has type, trigger, items and nochildren
Why it is worth a card
This is the ADR-0049 declared-vs-enforced shape, in its most awkward form: a required key that nothing reads, so the contract obliges every author to write something the platform then ignores — and the one document this repo ships for the component does not write it. Any consumer that strict-parses ContextMenuSchema refuses the repo's own fixture.
It is also the reason overlay/context-menu.mdx cannot simply publish the key. #7073's PR deliberately left children off that page: publishing a required-but-unread key would teach authors to emit dead metadata, and publishing it as optional would contradict the declaration. The page can only be made complete once this is decided.
The options, not a recommendation to adopt without triage
Make it optional (children?:) — smallest change, keeps the key available for a future read site, stops obliging authors. Leaves a declared-but-unread key, which ADR-0049 exists to discourage.
Retire it (enforce-or-remove) — trigger already covers the right-clickable area and is the key the renderer actually reads. Removing children makes trigger unambiguously the one spelling. Needs the ADR-0087 registry treatment for a removal.
Found while implementing #7073 (docs correction on
overlay/context-menu.mdx). Filed rather than decided: the docs row was mine, this is a declaration that looks wrong, which is not.Measured on
origin/main592acafbeed97c5aed81a18f4d848b6179d3c044.The measurement
childrenis declared required on the TS typepackages/types/src/overlay.ts:471—children: SchemaNode | SchemaNode[];insideContextMenuSchema, no?packages/types/src/zod/overlay.zod.ts:190—children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Context menu children'), no.optional()grep -rn 'schema\.children' packages/components/src/renderers/overlay/returns nothing. The renderer rendersschema.triggerinstead:context-menu.tsx:95—renderChildren(schema.trigger || { type: 'text', value: 'Right click here' })overlay.ts:477-479— "the renderer renderstrigger, NOT the declaredContextMenuSchema.children, which no read site consumes"examples/schema-catalog/src/schemas/components-overlay-context-menu/basic-context-menu.jsonhastype,trigger,itemsand nochildrenWhy it is worth a card
This is the ADR-0049 declared-vs-enforced shape, in its most awkward form: a required key that nothing reads, so the contract obliges every author to write something the platform then ignores — and the one document this repo ships for the component does not write it. Any consumer that strict-parses
ContextMenuSchemarefuses the repo's own fixture.It is also the reason
overlay/context-menu.mdxcannot simply publish the key. #7073's PR deliberately leftchildrenoff that page: publishing a required-but-unread key would teach authors to emit dead metadata, and publishing it as optional would contradict the declaration. The page can only be made complete once this is decided.The options, not a recommendation to adopt without triage
children?:) — smallest change, keeps the key available for a future read site, stops obliging authors. Leaves a declared-but-unread key, which ADR-0049 exists to discourage.triggeralready covers the right-clickable area and is the key the renderer actually reads. Removingchildrenmakestriggerunambiguously the one spelling. Needs the ADR-0087 registry treatment for a removal.childrenwas meant to be the right-clickable area andtriggeris the accident. The doc comment and finding(types): 13 top-level schema keys that component renderers genuinely READ are declared by no shipped type — measured across all 76content/docs/componentspages #6150 both point the other way, so this looks like the weakest option, but it is the one that would explain why the key is required.Refs: #7073 (the docs card that surfaced it) · #6150 (declared
trigger, did not touchchildren) · ADR-0049.Generated by Claude Code