Skip to content

fix(icons): apply fill to AddCircleIcon path, drop full-canvas rect#1411

Merged
yi-nuo426 merged 2 commits intolayer5io:masterfrom
alexquincy:lc/fix-add-circle-icon-fill
Apr 17, 2026
Merged

fix(icons): apply fill to AddCircleIcon path, drop full-canvas rect#1411
yi-nuo426 merged 2 commits intolayer5io:masterfrom
alexquincy:lc/fix-add-circle-icon-fill

Conversation

@alexquincy
Copy link
Copy Markdown
Contributor

Summary

AddCircleIcon's SVG put fill={fill} (currentColor by default) on a full-canvas 48×48 rect and left the actual icon path unfilled. As a result the icon rendered as a solid rectangle of text color with a black plus-in-circle outline on top (SVG default-fill behavior), rather than a clean outlined-plus-in-circle glyph.

This drops the background rect and applies fill={fill} to the icon path, so AddCircleIcon renders like the @mui/icons-material/AddCircleOutline it's meant to replace in consumers.

Before / after SVG

<!-- before -->
<svg viewBox="0 0 48 48">
  <path d="M0 0h48v48h-48z" fill={fill} />   <!-- background rect -->
  <path d="M26 14h-4v8..." />                 <!-- icon, unfilled -->
</svg>

<!-- after -->
<svg viewBox="0 0 48 48">
  <path d="M26 14h-4v8..." fill={fill} />     <!-- icon, currentColor -->
</svg>

The icon d attribute is unchanged; only the paint instructions moved.

Context

This is exposed by meshery/meshery#18796, which swaps @mui/icons-material/AddCircleOutlineAddCircleIcon from @sistent/sistent. Without this fix, that swap produces a visible regression (solid-colored rectangle with black outline instead of a clean outline). AddCircleIcon wasn't used anywhere in meshery/ui before #18796, which is why this bug went unnoticed.

Test plan

  • npm test — 7 suites, 21 tests all pass.
  • Visual spot-check: <AddCircleIcon /> renders matching @mui/icons-material/AddCircleOutline on both light and dark themes.

AddCircleIcon's SVG put fill={fill} (currentColor by default) on a
full-canvas 48x48 rect and left the actual icon path unfilled, so the
icon rendered as a solid rectangle of text color with a black
plus-in-circle on top — instead of a clean outlined-plus-in-circle
glyph.

Drop the background rect and apply fill={fill} to the icon path, so
AddCircleIcon renders like the @mui/icons-material/AddCircleOutline
it's intended to replace in consumers (e.g. meshery/ui).

Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the AddCircleIcon SVG by removing an unnecessary background path and applying the fill property directly to the icon path. A review comment suggests renaming the component AddIconCircleBordered to match the filename AddCircleIcon.tsx for better consistency and maintainability.

Comment thread src/icons/AddCircle/AddCircleIcon.tsx
Signed-off-by: Yī nuò <218099172+yi-nuo426@users.noreply.github.com>
@yi-nuo426 yi-nuo426 merged commit 5b217aa into layer5io:master Apr 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants