Found while implementing #6523 / #6346 (the overlay.ts MenuItem discriminated-union +
onClick fix). Filed unassigned and out of both cards' fence — this is a pre-existing,
unrelated docs/type-naming collision, not something either ruling's diff touches.
What was measured, at c75b928e6
content/docs/core/app-schema.mdx's ## Global Actions section has a real, compiled
ts fence (unlike the plaintext "Schema" blocks elsewhere on this same page):
import type { MenuItem } from '@object-ui/types';
interface AppAction {
...
items?: MenuItem[]; // For type='dropdown' or 'user'
...
}
import type { MenuItem } from '@object-ui/types' resolves to the overlay MenuItem
(packages/types/src/overlay.ts, re-exported at index.ts:255 under the bare name
MenuItem) — the discriminated union shared by ui:dropdown-menu/ui:context-menu/
ui:menubar, which #6523 just reshaped.
But the real AppAction.items field — packages/types/src/app.ts:728 — is declared
inside app.ts itself, so MenuItem[] there resolves to app.ts's own local MenuItem
(app.ts:461), a structurally different, legacy navigation-item shape (type?: 'item' | 'group' | 'separator', path, href, badge, hidden — none of which the overlay
MenuItem declares). The barrel re-exports app.ts's version under the renamed
AppMenuItem (index.ts:59) specifically to avoid this collision — but the docs snippet
imports the bare, unrenamed name, so it silently picks up the WRONG same-named type.
Confirmed this is not new: app.ts's own MenuItem and overlay.ts's MenuItem have
always been structurally different (this predates #6523's union split — before it, the
overlay MenuItem was still a single object with label: string required, icon,
disabled, onClick, shortcut, children, separator?: boolean, none of which match
app.ts's type/path/href/badge/hidden shape either).
Why this doesn't block #6523/#6346
The snippet is a bare type reference (items?: MenuItem[]), not an object literal that
instantiates the shape — so it compiles under check-doc-snippet-types.mjs regardless of
which MenuItem it actually resolves to, and #6523's union split doesn't change whether it
compiles. Confirmed unaffected by grepping the diff: the snippet's own text is untouched by
either card.
The open question
Two candidate fixes, not adjudicated here:
- A — the snippet's import is simply wrong; change it to
import type { MenuItem as AppMenuItem } from '@object-ui/types'; (or import from '@object-ui/types''s already-exported
AppMenuItem name directly) so the reader compiles against the type that's actually there.
- B —
AppAction.items itself is questionable: dropdown/user toolbar actions plausibly
WANT the richer overlay MenuItem (icon, onClick, shortcut, submenu children, divider) more
than the legacy nav-item shape (path/href/badge) app.ts gives them today — worth
checking whether header-bar.tsx (the renderer consuming AppAction.items) actually reads
app.ts's fields or the overlay ones before choosing.
Whichever way, this is a genuine decision (which MenuItem AppAction.items should mean),
not a mechanical fix, so it doesn't qualify for the bounded in-place-fix exemption on the PR
that found it.
Refs: #6523 · #6346 (found while implementing, unrelated to either ruling).
Found while implementing #6523 / #6346 (the
overlay.tsMenuItemdiscriminated-union +onClickfix). Filed unassigned and out of both cards' fence — this is a pre-existing,unrelated docs/type-naming collision, not something either ruling's diff touches.
What was measured, at
c75b928e6content/docs/core/app-schema.mdx's## Global Actionssection has a real, compiledtsfence (unlike theplaintext"Schema" blocks elsewhere on this same page):import type { MenuItem } from '@object-ui/types'resolves to the overlayMenuItem(
packages/types/src/overlay.ts, re-exported atindex.ts:255under the bare nameMenuItem) — the discriminated union shared byui:dropdown-menu/ui:context-menu/ui:menubar, which #6523 just reshaped.But the real
AppAction.itemsfield —packages/types/src/app.ts:728— is declaredinside
app.tsitself, soMenuItem[]there resolves toapp.ts's own localMenuItem(
app.ts:461), a structurally different, legacy navigation-item shape (type?: 'item' | 'group' | 'separator',path,href,badge,hidden— none of which the overlayMenuItemdeclares). The barrel re-exportsapp.ts's version under the renamedAppMenuItem(index.ts:59) specifically to avoid this collision — but the docs snippetimports the bare, unrenamed name, so it silently picks up the WRONG same-named type.
Confirmed this is not new:
app.ts's ownMenuItemandoverlay.ts'sMenuItemhavealways been structurally different (this predates #6523's union split — before it, the
overlay
MenuItemwas still a single object withlabel: stringrequired,icon,disabled,onClick,shortcut,children,separator?: boolean, none of which matchapp.ts'stype/path/href/badge/hiddenshape either).Why this doesn't block #6523/#6346
The snippet is a bare type reference (
items?: MenuItem[]), not an object literal thatinstantiates the shape — so it compiles under
check-doc-snippet-types.mjsregardless ofwhich
MenuItemit actually resolves to, and #6523's union split doesn't change whether itcompiles. Confirmed unaffected by grepping the diff: the snippet's own text is untouched by
either card.
The open question
Two candidate fixes, not adjudicated here:
import type { MenuItem as AppMenuItem } from '@object-ui/types';(or import from'@object-ui/types''s already-exportedAppMenuItemname directly) so the reader compiles against the type that's actually there.AppAction.itemsitself is questionable: dropdown/user toolbar actions plausiblyWANT the richer overlay
MenuItem(icon, onClick, shortcut, submenu children, divider) morethan the legacy nav-item shape (
path/href/badge)app.tsgives them today — worthchecking whether
header-bar.tsx(the renderer consumingAppAction.items) actually readsapp.ts's fields or the overlay ones before choosing.Whichever way, this is a genuine decision (which
MenuItemAppAction.itemsshould mean),not a mechanical fix, so it doesn't qualify for the bounded in-place-fix exemption on the PR
that found it.
Refs: #6523 · #6346 (found while implementing, unrelated to either ruling).