Skip to content

finding(components): ui:context-menu never reads an item's authored icon — dropdown-menu's identical twin, left behind by #5930 #6278

Description

@yinlianghui-tw

Found while re-measuring the lucide gate's header parenthetical for #5992 (PR #6277). Filed unassigned; out of that card's fence — #5992 changes what the gate judges, this is a renderer repair.

Sub-issue of #5931, which already owns "catalog fixtures declare child icon keys the renderer never reads" for button-group, breadcrumb and command. This adds a fourth container to that set, and it is the one with a materially different answer available.

What was measured

At ef2a3bd8d, every untyped node carrying a string icon in the schema catalog was enumerated and grouped by its nearest typed ancestor, then each container's renderer was read to see what it does with the key:

containernameswhat the renderer does with icon
dropdown-menu3resolveIcon(item.icon)repaired by #5930
context-menu4never reads icon
button-group8never reads button.icon (#5931)
breadcrumb3never reads icon (#5931)
command9never reads icon (#5931)
timeline4raw text, <span>{item.icon}</span> — the authored names are emoji, so this is arguably correct as-is
tree-view30a two-valued literal switch, node.icon === 'folder' — never a name lookup

packages/components/src/renderers/overlay/context-menu.tsx has no reference to icon at all. Its renderContextMenuItems is line-for-line the shape dropdown-menu.tsx had before #5930, including the same submenu recursion:

if(item.type==='separator')return<ContextMenuSeparatorkey={i}/>;if(item.type==='label')return<ContextMenuLabelkey={i}>{item.label}</ContextMenuLabel>;if(item.children){<ContextMenuSubTriggerinset={item.inset}>{item.label}</ContextMenuSubTrigger>}return(<ContextMenuItemkey={i}>{item.label}{item.shortcut&&<ContextMenuShortcut>{item.shortcut}</ContextMenuShortcut>}</ContextMenuItem>);

The four authored names live in examples/schema-catalog/src/schemas/components-overlay-context-menu/basic-context-menu.jsoncopy, scissors, clipboard, trash. All four are live icons keys today, so nothing renders wrong; they simply render nothing.

Why this one is different from #5931's other three

For button-group/breadcrumb/command the open question is whether the key should exist at all. For context-menu it is not open: its twin was answered three weeks ago. #5930 decided the shape (route through resolveIcon, i.e. the RECORD surface; LazyIcon explicitly ruled out because it degrades an unknown name to the Database glyph, trading a no-icon failure for a wrong-icon one) and decided that repairing only the leaf arm and not the submenu-trigger arm would be a narrower version of the same bug. A context-menu repair is that diff again, in a file next door.

Note on what will and will not catch it

#5992/PR #6277 makes the gate judge icon names on untyped child items of a container that declares it reads them. context-menu will correctly not declare that while its renderer does not read the key — so the gate stays silent here by construction, and correctly so. When this card is repaired, the census entry should be added in the same PR: one line, 'context-menu': { paths: [], descendants: true, min: 1, resolver: … }, and the fixture's four names come under judgement.

References

Generated by Claude Code

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatched

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions