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
fix(notifications): the spec icon is read instead of stored and ignored (#3014 follow-up) (#3076)
`NotificationSchema.icon` — "Icon name override" — reached `NotificationItem`
and stopped there. Every surface drew the severity icon, so an author writing
`icon: 'rocket'` got the success checkmark. Same shape as the `displayType`
collapse #3071 fixed: a value that validates, is carried, and renders nothing.
All five presentations now resolve it through one rule (`notificationIcon`): a
declared Lucide name — kebab-case or PascalCase — replaces the severity icon;
anything else falls back to it. That includes the console's sonner toast
(`presentNotificationToast`, now .tsx so it can build the icon element), so the
override behaves identically on all five.
The fallback is the interesting part. `getLazyIcon` degrades an unknown name to
a `Database` glyph — right for a data-shaped schema slot, wrong here, where it
would swap a meaningful icon for a meaningless one on an error notification. So
the name is checked first via a new `isLucideIconName` export, and a typo costs
the author their override and nothing more.
The two `react-hooks/static-components` disables follow the existing repo
convention for this rule (MetricCard / MetricWidget / NavigationRenderer): the
factory is module-cached per name, so the component identity is stable and the
rule is a false positive here.
Verified in the running console: a toast declaring `icon: 'rocket'` renders the
rocket instead of the success checkmark, while a snackbar declaring
`icon: 'not-a-real-icon'` renders the info icon — not a Database glyph.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
{/* eslint-disable-next-line react-hooks/static-components -- notificationIcon returns a module-cached stable component per name, not one created during render */}
0 commit comments