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
finding(components): three near-identical menu-item recursions in renderers/overlay/ — the same icon bug has now been repaired in two of them separately #6327
Observation recorded while repairing #6278. Filed unassigned; no fix attempted, and deliberately notpm:queue — see the last section.
What was measured, at ad54f7587
packages/components/src/renderers/overlay/ contains three separate recursive menu-item renderers over the same item shape (MenuItem from packages/types/src/overlay.ts, or an any[] standing in for it):
The first two differ only in the imported component names and in how a shortcut is drawn. The duplication is acknowledged in the source itself — context-menu.tsx carries the comment:
// Reuse helper for recursive menu items if I could share it, but for now duplicate concise logic
The cost, as actually paid
The same defect — an item's authored icon not reaching a glyph — has now been diagnosed and repaired once per copy, in sequence:
Each copy also had to be censused separately in scripts/check-lucide-icon-record-names.mjs, and menubar cannot be censused at all today because nothing authors the key.
So this is not a tidiness observation: it is a measured pattern of one bug costing three diagnoses, three repairs and three census entries, with the divergence risk that the three arms' behaviour now drifts independently.
Why this is filed as an observation, not queued
Two reasons, both arguing against acting on it now:
It has no pull yet. Nothing is blocked on the duplication; the concrete defect it produced is already answered for two of the three files. Under the startup-scope principle (core capability first, no speculative refactors), a shared-helper extraction that serves only future hypothetical bugs should wait for a real one.
The natural moment to reconsider is after #5935 lands, or the next time a third defect has to be fixed once per copy. Recording it now so that moment is recognisable rather than rediscovered.
⚠️ Any consolidation must preserve what #5930 ruled: the icon resolves through resolveIcon (the lucide RECORD surface), notLazyIcon, which degrades an unknown name to the Database glyph and trades a no-icon failure for a wrong-icon one.
Observation recorded while repairing #6278. Filed unassigned; no fix attempted, and deliberately not
pm:queue— see the last section.What was measured, at
ad54f7587packages/components/src/renderers/overlay/contains three separate recursive menu-item renderers over the same item shape (MenuItemfrompackages/types/src/overlay.ts, or anany[]standing in for it):dropdown-menu.tsxrenderMenuItemscontext-menu.tsxrenderContextMenuItemsmenubar.tsxitems.mapThe first two differ only in the imported component names and in how a
shortcutis drawn. The duplication is acknowledged in the source itself —context-menu.tsxcarries the comment:The cost, as actually paid
The same defect — an item's authored
iconnot reaching a glyph — has now been diagnosed and repaired once per copy, in sequence:ui:dropdown-menurenders an item's authorediconas raw TEXT — the catalog fixture named with-icons.json draws the words "edit", "copy", "trash" beside its labels #5930 repaireddropdown-menu(PR fix(components): resolve ui:dropdown-menu item icons instead of rendering the name as text #5994), and ruled that repairing only the leaf arm and not the submenu-trigger arm would be "a narrower version of the same bug".ui:context-menunever reads an item's authoredicon— dropdown-menu's identical twin, left behind by #5930 #6278 repairedcontext-menuthree weeks later, porting that same diff verbatim into the file next door, including the same both-arms requirement.ui:menubarnever reads an item'siconeither — the thirdMenuItem-shaped container, and the one no census can see #6326 records thatmenubarstill carries it, on all three of its arms.Each copy also had to be censused separately in
scripts/check-lucide-icon-record-names.mjs, andmenubarcannot be censused at all today because nothing authors the key.So this is not a tidiness observation: it is a measured pattern of one bug costing three diagnoses, three repairs and three census entries, with the divergence risk that the three arms' behaviour now drifts independently.
Why this is filed as an observation, not queued
Two reasons, both arguing against acting on it now:
The natural moment to reconsider is after #5935 lands, or the next time a third defect has to be fixed once per copy. Recording it now so that moment is recognisable rather than rediscovered.
resolveIcon(the lucide RECORD surface), notLazyIcon, which degrades an unknown name to theDatabaseglyph and trades a no-icon failure for a wrong-icon one.