Repository navigation
fix(ui): give every core icon unique SVG ids so the active Observability icon renders - #38177
shah-harshit wants to merge 2 commits into
Conversation
The icon generator minified each regular icon's ids to a, b, ... and only prefixed them for custom icons. url(#a) resolves to the first #a in the document, so icons sharing an id clipped or masked through another icon's definition. ObservabilityFilled, the active Observability rail icon, vanished on the Data Quality page. Prefix ids with the icon name for every icon, rewrite the ids in the 27 affected icons, and add a test that fails on any shared id.
Code Review ✅ Approved 🟡 Medium riskPrefixing SVG definition IDs across core icons prevents cross-icon clipping; a generator regression could leave icons blank across UI pages. Fixes the disappearing active Observability rail icon by giving every core icon unique SVG ids, so VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
The SVG ID collision was already fixed in #38390. After resolving the conflict with |
Describe your changes:
The active Observability icon in the AI-mode rail (
ObservabilityFilled) disappears when Observability is selected, for example on/observability/data-quality.Root cause:
generate-icons.mjsminified every regular icon's SVG ids toa,b, …, and only prefixed them for custom icons (icons-custom/). 26 core icons ended up with<clipPath id="a">/url(#a), andIpAddressTypewith#a/#b. Aurl(#a)reference resolves to the first#ain the document, not the icon's own.ObservabilityFilleddraws everything inside<g clipPath="url(#a)">, so once another icon with an#a(for exampleDashboardLayoutfromDataQualityClassBase) is in the DOM, the clip resolves to the wrong element and the icon renders blank.Regression from #37093, which switched the Observability rail's active state to
ObservabilityFilledand moved Data Quality ontoDashboardLayout. Both icons were added in #36954.Fix:
generate-icons.mjs: movedprefixIdsinto the shared SVGO plugins so every icon's ids are<icon-name>_<id>(prefixClassNames: falsesotw:classes stay intact).src/icons/icons.test.ts, which fails when any two icons share an SVG id.Other navigation icons affected the same way and fixed here:
ArchiveFilled(Context Center rail, active),Workflow/WorkflowsFilled(Govern sub-nav), andDashboardService/SecurityService(Connections secondary nav). The other rail and sub-nav icons have no internal ids.Type of change:
High-level design:
N/A — small change (generator config + mechanical id rename).
Tests:
Use cases covered
<use>refs render through their own definitions when several are on one page.Unit tests
openmetadata-ui-core-components/.../src/icons/icons.test.ts: passes on this branch and fails ("a"duplicated) with the oldObservabilityFilled/DashboardLayoutrestored.Backend integration tests
Checks run
make ui-checkstyle-changed: clean, no diff.npx vitest run src/icons/icons.test.ts: pass.ObservabilityFilled,IpAddressType,ArchiveFilled,AiAssetsFilled): identical;tw:class names unchanged.

Confidence Score: 5/5
The PR appears safe to merge.Summary
This PR prevents different core icons from sharing SVG IDs, keeping the active Observability icon visible alongside other icons.
shah-harshit intentionally skipped full regeneration because it would overwrite unrelated hand-edited sizes, masks, and copyright headers. No actionable issues found.
Reviews (1) · Last reviewed commit: "fix(ui): give every core icon unique SVG..." · Reviewed by Greptile