Uh oh!
There was an error while loading. Please reload this page.
docs(core): app-schema's "Global Actions" snippet imports AppMenuItem, not the overlay MenuItem - #6855
Merged
Conversation
…t the overlay MenuItem
`import type { MenuItem } from '@object-ui/types'` resolves to the overlay
union (overlay.ts, re-exported bare from the barrel), but `AppAction.items`
is declared inside app.ts and so resolves to that file's own legacy
navigation-item `MenuItem`, which the barrel re-exports renamed as
`AppMenuItem` precisely to avoid this collision.
The two are mutually incompatible, not just differently named: the overlay
union declares `type?: never` on both arms, so the `{ "type": "separator" }`
item documented elsewhere on the same page is refused by the type the
snippet named.
Note: `MenuItem as AppMenuItem` does NOT fix this — that imports the bare
(overlay) export and renames it locally. `AppMenuItem` is already the
barrel's export name.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013hfmP9hoMd3dJwTh85J4yBos-sam
marked this pull request as ready for review
August 30, 2026 02:56
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#6692
Executes the 2026-08-29 ruling on that card: option A — the docs snippet references the type
AppAction.itemsactually resolves to. The ruling's census rider is recorded below, and it fired: option B is filed as #6854.Diff is two files:
content/docs/core/app-schema.mdxand a changeset.packages/types/**is read-only in this card (route B's surface, and held by PR #6826).The defect
content/docs/core/app-schema.mdx's "Global Actions" section imported the bare name:That resolves to the overlay union —
packages/types/src/overlay.ts:347, re-exported bare atpackages/types/src/index.ts:255, the type behindui:dropdown-menu/ui:context-menu/ui:menubar. But the realAppAction.items(packages/types/src/app.ts:728) is declared insideapp.ts, so it resolves to that file's own legacy navigation-itemMenuItem(app.ts:461). The barrel re-exports that one renamed, asAppMenuItem(index.ts:59), precisely to avoid this collision — every line number in the finding re-derived at26896c6and confirmed.The two are mutually incompatible, not merely differently named. The overlay union declares
type?: neveron both arms (dividers became{ separator: true }in #6523), so the{ "type": "separator" }item documented a few paragraphs earlier on this same page is refused by the type the snippet named.Both the original card and the ruling offer "
MenuItem as AppMenuItem" as an alternative spelling. It does not fix this, and it fails in the worst way — it looks repaired and compiles:AppMenuItemis already the barrel's export name for the app.ts type. ImportingMenuItemand locally aliasing it toAppMenuItemimports the overlay export and renames it, leaving the defect exactly in place under a name that reads correct. The only correct import isimport type { AppMenuItem }, which is what this PR uses. Verified by type probe, below.Census rider (required by the ruling) — result: MIXED, so #6854 is filed
The consumer named in the card is the wrong file.
packages/components/src/renderers/navigation/header-bar.tsxnever seesAppAction; it consumesHeaderBarSchema(packages/types/src/navigation.ts:57), whoseactions?: SchemaNode[]is unrelated, and it never reads.items.The real and only consumer is
packages/runner/src/LayoutRenderer.tsx:301-315:app.tsMenuItem(whatitemsIS)MenuItemitem.type === 'separator'type?: neveritem.label(item as any).onClick(item as any).shortcutNever read:
path,href,badge,hidden,children.So the renderer branches on the legacy
typespelling and then reaches two overlay-shaped fields throughas any, past its own declared type. That is the rider's trigger condition, so option B is filed as #6854 with this census as its evidence — not decided here, and no part of it is attempted in this PR.This does not undermine option A: both declarations agree on what
itemsis today (TSapp.ts:728; zod mirrorapp.zod.ts:192, using the "Legacy MenuItem Schema" atapp.zod.ts:167), so documentingAppMenuItemis documenting the shipped contract either way. If #6854 later re-types the field, this snippet changes with it.⛔ What does NOT demonstrate this change is correct
A green CI run is not evidence here, and neither is
check:doc-snippetspassing. The snippet is a bare type reference (items?: MenuItem[]), never an object literal, so it compiles against eitherMenuItem. No gate goes red-to-green on this fix.Measured rather than assumed — ablation at
4b65e8d, reverting the file to its pre-fix bytes and re-running the gate:Identical verdict on the buggy tree. The gate is structurally blind to this defect.
What DOES demonstrate it
A type probe compiled against the built
packages/types/dist/index.d.ts, using@ts-expect-errorso each assertion fails if the expected error does not occur. Exit 0 — every assertion held:AppMenuItemaccepts{ type: 'separator' }and the full legacy shape (type/label/path/href/badge/hidden) — it is app.ts's type.MenuItemthe docs imported rejects{ type: 'separator' }and rejectspath.MenuItem as AppMenuItemstill rejects{ type: 'separator' }— proving that spelling stays the overlay type.AppMenuItemhas noonClick— the fieldLayoutRenderercasts past.The probe was a scratch file, deleted before commit; it is reproducible from the four assertions above.
Gates
Run at
4b65e8d(the final commit), exit codes captured before any pipe; verdict lines quoted as each gate printed them:check:doc-snippetscheck:doc-fencescheck:doc-typescheck:control-bytescheck:docs-route-closurecheck-changeset-presencecheck-changeset-no-majormajorbump."check-changeset-overwriteapp-schema.mdxis confirmed covered bycheck:doc-snippets: coverage is every doc undercontent/docsminus the script'sUNGATED_DOCSledger, and this page has no ledger entry.The changeset carries empty frontmatter — the repo's declaration form for a change that publishes nothing, since the presence gate itself reports nothing owed for a docs-only diff.
Generated by Claude Code