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

docs(components): follow the shipped MenuItem union on the dropdown-menu and context-menu Schema blocks - #7084

Merged
os-sam merged 1 commit into
mainfrom
claude/issue-7073-overlay-menu-docs
Aug 31, 2026
Merged

os-sam merged 1 commit into
mainfrom
claude/issue-7073-overlay-menu-docs

Conversation

@claude

@claude claude Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Closes #7073

Docs only, publishes nothing. The ## Schema blocks of
content/docs/components/overlay/dropdown-menu.mdx and
content/docs/components/overlay/context-menu.mdx are corrected to the surface
packages/types/src/overlay.ts actually declares. Same defect class PR #7074
fixed on the third menu page, and more of it. Verified against origin/main
592acafbeed97c5aed81a18f4d848b6179d3c044; gate union re-run on the final
commit 1d5bb9197.

Premise verification — every load-bearing fact re-derived, and what drifted

The card and the dispatch were substantively correct on every claim. Two
classes of small drift, neither of which changes an outcome:

claim verdict
dropdown-menu.mdx:34-41 publishes value?: string and variant?: 'default' | 'destructive' ✅ exactly as stated (:36, :38)
dropdown-menu.tsx:58,66 reads item.children and renders a real submenu; :80 reads item.shortcut ✅ verbatim
dropdown-menu.tsx:125 registry description names neither value nor variant, names shortcut and children ✅ verbatim
dropdown-menu.tsx:130 — the only variant in the file is on a button node inside defaultProps.trigger ✅ verbatim; a repo-wide grep for variant across dropdown-menu.tsx, context-menu.tsx and menubar.tsx returns that one line and nothing else
context-menu.tsx:56,64 reads item.children; :78 reads item.shortcut; :117 description names both and names no value ✅ verbatim — the half the dispatch did not verify holds
no menu renderer reads a .value ✅ zero .value reads across all three files. (context-menu.tsx:95 contains the literal value: — inside { type: 'text', value: 'Right click here' }, the renderer's own placeholder node. A different object, exactly like the variant on the trigger button.)
MenuCommandItem at overlay.ts:363-400, MenuDividerItem at :409-421 ⚠️ ranges drift at the closing brace — measured 363-401 and 409-419. The declarations are otherwise exactly as described.
zod mirror at overlay.zod.ts:154,155 ⚠️ path abbreviated — the file is packages/types/src/zod/overlay.zod.ts, not packages/types/src/overlay.zod.ts. The line numbers are right.

No premise was falsified, so there is a PR.

dropdown-menu.mdx — four rows

page before the declaration that authorises the change page after
value?: string (:36) Declared on neither arm: not MenuCommandItem (overlay.ts:363-401), not MenuDividerItem (:409-419); absent from both zod arms (zod/overlay.zod.ts:149-166). No menu renderer reads a .value. row deleted
variant?: 'default' | 'destructive' (:38) Declared nowhere on the menu types, in TS or zod. The only variant in the renderer is dropdown-menu.tsx:130 — trigger: [{ type: 'button', label: 'Menu', variant: 'outline' }] — a button node inside defaultProps.trigger, not a menu item. row deleted
(absent) shortcut?: string — overlay.ts:383, zod/overlay.zod.ts:154. Read at dropdown-menu.tsx:80. shortcut?: string; added
(absent) children?: MenuItem[] — overlay.ts:387, zod/overlay.zod.ts:155. Read at dropdown-menu.tsx:58,66, and it draws a real submenu. children?: DropdownMenuItem[]; added

context-menu.mdx — four rows

page before the declaration that authorises the change page after
value?: string (:33) Same authority as above — undeclared on both arms, in TS and zod; context-menu.tsx reads no .value. row deleted
(absent) shortcut?: string — overlay.ts:383, zod/overlay.zod.ts:154. Read at context-menu.tsx:78, rendered through ContextMenuShortcut. shortcut?: string; added
(absent) children?: MenuItem[] — overlay.ts:387, zod/overlay.zod.ts:155. Read at context-menu.tsx:56,64. children?: ContextMenuItem[]; added
trigger: ComponentSchema (required) (:47) trigger?: SchemaNode | SchemaNode[] — optional at overlay.ts:486, .optional() at zod/overlay.zod.ts:191. The renderer substitutes a placeholder (context-menu.tsx:95), so a trigger-less document is legal today. trigger?: ComponentSchema

Deliverable 3 — the read sites, quoted, per page

children and shortcut are added because the component reads them, not because the type declares them. Both, on both renderers:

packages/components/src/renderers/overlay/dropdown-menu.tsx

// :58,66 — a real submenu, not a flattened list
if (item.children) {
    return (
        <DropdownMenuSub key={i}>
            <DropdownMenuSubTrigger>
                {Icon && <Icon className="mr-2 h-4 w-4" />}
                {item.label}
            </DropdownMenuSubTrigger>
            <DropdownMenuSubContent>
                {renderMenuItems(item.children)}
            </DropdownMenuSubContent>
        </DropdownMenuSub>
    )
}

// :80
{item.shortcut && <span className="ml-auto text-xs tracking-widest opacity-60">{item.shortcut}</span>}

packages/components/src/renderers/overlay/context-menu.tsx

// :56,64
if (item.children) {
    return (
        <ContextMenuSub key={i}>
            <ContextMenuSubTrigger>
                {Icon && <Icon className="mr-2 h-4 w-4" />}
                {item.label}
            </ContextMenuSubTrigger>
            <ContextMenuSubContent>
                {renderContextMenuItems(item.children)}
            </ContextMenuSubContent>
        </ContextMenuSub>
    )
}

// :78
{item.shortcut && <ContextMenuShortcut>{item.shortcut}</ContextMenuShortcut>}

Both renderers' own registry metadata already enumerates the correct key set —
dropdown-menu.tsx:125 and context-menu.tsx:117 both describe an item as
{ label, icon, shortcut, disabled, onClick, children }. Neither names value.
Neither names variant. The shipped metadata and the reference page beside it
were teaching different key sets, and the metadata was the one that was right.

Deliverable 4 — verdict on the two items the card flagged but did not measure

The discriminator the dispatch set: a doc row that disagrees with a declaration
is mine; a declaration that looks wrong is not.

context-menu.mdx publishes trigger as required — FIXED HERE

This is a doc row disagreeing with a settled declaration, so it is the same
defect class as the other three rows and it is in scope.

  • overlay.ts:486 declares trigger?: SchemaNode | SchemaNode[], optional.
  • zod/overlay.zod.ts:191 carries .optional() and re-states the reason in its .describe().
  • The declaration's doc comment says so in words: "Declared OPTIONAL although the docs page shows it required: the renderer substitutes a placeholder when it is absent, so every document without a trigger is legal today and declaring it required would refuse them. Declared by objectui#6150."
  • The renderer confirms it at context-menu.tsx:95 — renderChildren(schema.trigger || { type: 'text', value: 'Right click here' }).
  • packages/types/src/__tests__/undeclared-but-consumed-keys-6150.test.ts:113 pins the type invariantly, optional limb included.

⇒ the declaration is deliberate, dated and pinned; the page is the side that is
wrong. PR #7074 fixed the exact analogue (menus: to menus?:), so this also
follows an established precedent rather than inventing one.

⚠️ Only the optionality marker changed. The type name on that row —
ComponentSchema, where the declared type is SchemaNode — is a real but
different divergence spanning six pages; filed as #7082, untouched here, for the
same reason PR #7074 left the localized interface names alone.

ContextMenuSchema.children is required but unread — FILED, NOT DECIDED (#7080)

Here the declaration is what looks wrong, so per the discriminator it is not
mine to settle. Measured:

  • overlay.ts:471 — children: SchemaNode | SchemaNode[];, required.
  • zod/overlay.zod.ts:190 — required in the mirror too, no .optional().
  • grep -rn 'schema\.children' packages/components/src/renderers/overlay/ returns nothing.
  • The only shipped catalog fixture, examples/schema-catalog/src/schemas/components-overlay-context-menu/basic-context-menu.json, has type, trigger, items and no children — so a strict parse of ContextMenuSchema refuses this repo's own document.

The page therefore stays silent about it, deliberately: 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 be
completed once #7080 is decided. Three options are laid out there
(make optional / retire under ADR-0049 / give it a read site); I did not choose.

Deliverable 5 — changeset form, and the fence census

Empty frontmatter, not patch. apps/site is "private": true, so
content/docs/** is not published source of any released package. The gate says
so itself, on this diff:

✅  No source or published contract of a released package changed in this range, so no changeset is owed.

A patch bump would have been a false claim that a released package changed.
Ruling taken from PR #7074, re-measured here rather than inherited.

⛔ The skip-changeset label was not applied. It exists as a label object in
this repo but no workflow or script reads it, so it exempts nothing; the
empty-frontmatter changeset is this repo's real declaration form.

Fence census, both pages, before and after — these blocks are plaintext,
which check:doc-snippets never compiles, so no gate would have caught a
mistake in them:

file fence markers before after plaintext openers before after
content/docs/components/overlay/dropdown-menu.mdx 2 (:33, :57) 2 (:33, :57) 1 1
content/docs/components/overlay/context-menu.mdx 2 (:30, :51) 2 (:30, :52) 1 1

No fence added, removed or relabelled — objectui#5867's SHRINK-ONLY declared
population is unmoved, which check:doc-fences independently confirms below
(80 declared files, 90 blocks, unchanged).

Verification

Gate union re-run on the final commit 1d5bb9197, working tree clean. Every
verdict below is quoted from the gate's own output, not from an exit code read
through a pipe.

gate verdict line
check:doc-fences ✅ check:doc-fences — every TypeScript block in 224 document(s) is fenced ts/tsx/typescript, except 80 declared file(s) carrying 90 block(s) of objectui#5867's remaining population (⛔ SHRINK-ONLY).
check:doc-types ✅ Every documented component type is registered.
docs:check-links Links are valid across 17 scan roots.
check:control-bytes ✅ check-control-bytes: OK (scanned 5861 tracked text file(s); skipped 85 binary).
check:docs-route-closure ✅ MEASURED_PAYLOAD is honest + ✅ gauge: 1360 modules crawled from 149 route roots (145 MDX), every specifier resolved
check:skills-paths ✅ check-skills-paths: OK (95/96 stated path(s) resolve across 18 guide file(s); 1 baselined).
check:shell-escape-residue ✅ check-shell-escape-residue: OK (4/4 root(s) resolved -- ... content/docs: 185 file(s), 1067 fence(s); ... 0 occurrence(s) outside a fence)
changeset:check (fixed) ✅ All workspace packages are in the changeset fixed group.
changeset:check (no-major) ✅ No changeset declares a major bump.
check-changeset-presence ✅ No source or published contract of a released package changed in this range, so no changeset is owed.
check-changeset-overwrite ✅ No pre-existing changeset was modified or deleted.

Plus a control-byte self-scan over the three touched files beyond the gate:
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]' on both pages and the changeset
returned no match.

Declared narrowings — two gates did NOT run or could not see this diff

Stated as narrowings, because "not run" and "green" have to stay
distinguishable.

  1. check:doc-snippets exits 2 here: PRECONDITION NOT MET (exit 2) — The snippet program was NOT run: the packages it resolves against are not built. Its own output says this is "I could not run", not "I ran and found errors". Building the 21 package closures it names would not move its answer: the gate's covered population is read from its own source — const TS_FENCE_LANGUAGES = new Set(['ts', 'tsx', 'typescript']) at scripts/check-doc-snippet-types.mjs:317, acted on at :600. This diff lives entirely inside plaintext fences and adds, removes and relabels zero fences (census above), and it changes no source and no .d.ts, so no untouched document's verdict can move either.
  2. eslint — narrowed to the diff, and the narrowing is measured rather than asserted. Population read from eslint's own configuration, not guessed: eslint.config.js:28 scopes the TypeScript config to files: ['**/*.{ts,tsx}']. Count read from --format json: running eslint on both edited files yields 2 results, errorCount: 0 each, both reporting File ignored because no matching configuration was supplied. Invariance for untouched files: the diff contains no .ts, .tsx or config file, and no type-aware rule is in play, so no untouched file's verdict can move.

CI runs the full farm regardless.

Out-of-scope findings, filed unassigned

None of the three is addressed in this PR; all three remain open.

Refs: #7074 (the same fix on the third menu page, whose three conventions this
follows) · #7072 · #6521 · #6523 · #6150 · #5250 · #5867.


Generated by Claude Code

…enu and context-menu Schema blocks

Both pages' `## Schema` blocks published keys `MenuCommandItem` does not
declare (`value` on both, `variant` on dropdown-menu) and hid two that it
does declare and both renderers read (`shortcut`, `children`). context-menu
also published `trigger` as required where the declaration is optional.

Docs only; publishes nothing. Empty-frontmatter changeset, since
`content/docs/**` is not published source of any released package.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013hfmP9hoMd3dJwTh85J4yB
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

1 participant