feat: add override icon to Notice#1010
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🧠 Memory Leak Test ResultsStatus: ✅ All tests passed
📋 Test Details
🤖 Generated by MemLab + Playwright |
| const showOverrideIcon = iconOverride && size === 'medium'; | ||
| const showIcon = !hideIcon && size === 'medium' && !iconOverride; |
There was a problem hiding this comment.
I'm unsure why we pass down size to <NoticeIcon /> since it only ever renders at medium size. It's further confusing to see the size={size === 'small' ? 'medium' : 'large'} inside the NoticeIcon, since presumably this component never gets a value other than medium
There was a problem hiding this comment.
There is a note about this in the ticket -- I believe it is just a bug (or AI hallucination) that missed the QA gate.
There is an additional bug here where we only render the icon if the Notice size is medium, but in the Notice component we are checking to see if the size is small and then rendering a medium size icon – which makes no sense. The component will only render if the size is medium, so we can remove that conditional and just render the correct size of icon.
📊 Coverage ReportsCoverage Changes by PackageClick to expand 29 package details
Coverage data collected from all packages in the monorepo. |
🖼️ Visual Regression Test ResultsStatus: ✅ All tests passed
Component Coverage45 / 54 design-toolkit components have VRT tests (83%) Missing VRT tests (9 components)- audio - carousel - deferred-collection - floating-card - gantt - lines - media-controls - status-indicator - video |
|
Yay! Thank you for picking up work. Here's the ticket: https://gitlab.accelint.dev/core-ux/standard-toolkit/-/issues/92 I think the solution you have in place may not be sufficient because mostly those Notice components are generated, and you won't be able to pass a function (React component) through the event bus. It has to be serializable. |
Closes n/a
see:
CORE-177✅ Pull Request Checklist
📝 Test Instructions
Allows passing a custom icon into the
<Notice overrideIcon={<MyIcon />} />The automatic color-based switching is useful for basic notices, but shouldn't disallow customization for client apps.
❓ Does this PR introduce a breaking change?
🤖 AI Usage
If ai was used, select all that apply:
💬 Other information