Skip to content

fix(ui): give every core icon unique SVG ids so the active Observability icon renders - #38177

Closed
shah-harshit wants to merge 2 commits into
mainfrom
shah-harshit/openmetadata-observability-icon-disappears
Closed

shah-harshit wants to merge 2 commits into
mainfrom
shah-harshit/openmetadata-observability-icon-disappears

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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.mjs minified every regular icon's SVG ids to a, b, …, and only prefixed them for custom icons (icons-custom/). 26 core icons ended up with <clipPath id="a"> / url(#a), and IpAddressType with #a/#b. A url(#a) reference resolves to the first #a in the document, not the icon's own. ObservabilityFilled draws everything inside <g clipPath="url(#a)">, so once another icon with an #a (for example DashboardLayout from DataQualityClassBase) 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 ObservabilityFilled and moved Data Quality onto DashboardLayout. Both icons were added in #36954.

Fix:

  • generate-icons.mjs: moved prefixIds into the shared SVGO plugins so every icon's ids are <icon-name>_<id> (prefixClassNames: false so tw: classes stay intact).
  • Rewrote only the ids in the 27 affected icon files. I didn't run a full regeneration because it also rewrites ~64 icons that were edited by hand after generation (sizes, masks, copyright), which is out of scope here. With the fixed generator, a full run produces the same ids as these edits.
  • Added 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), and DashboardService / SecurityService (Connections secondary nav). The other rail and sub-nav icons have no internal ids.

Type of change:

  • Bug fix

High-level design:

N/A — small change (generator config + mechanical id rename).

Tests:

Use cases covered

  • Selecting Observability (or Context Center, Govern) in the AI-mode rail keeps its active icon visible.
  • Icons with clip paths, masks or <use> refs render through their own definitions when several are on one page.

Unit tests

  • Added openmetadata-ui-core-components/.../src/icons/icons.test.ts: passes on this branch and fails ("a" duplicated) with the old ObservabilityFilled/DashboardLayout restored.

Backend integration tests

  • Not applicable (no backend API changes).

Checks run

  • make ui-checkstyle-changed: clean, no diff.
  • npx vitest run src/icons/icons.test.ts: pass.
  • Fixed generator compared against the hand-edited ids (ObservabilityFilled, IpAddressType, ArchiveFilled, AiAssetsFilled): identical; tw: class names unchanged.

RetriggerView in GreptileConfidence 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.

  • Each icon keeps its own SVG shapes when icons share a page.

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

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.
@shah-harshit
shah-harshit requested a review from a team as a code owner November 19, 2026 07:11
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Nov 19, 2026
@shah-harshit shah-harshit self-assigned this Nov 19, 2026
@gitar-bot

gitar-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Prefixing 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 url(#...) clip and mask references resolve to their own definitions. The SVGO config now prefixes ids with the icon name, 27 affected icon files are renamed, and a new test fails when icons share an SVG id. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@shah-harshit

Copy link
Copy Markdown
Contributor Author

The SVG ID collision was already fixed in #38390. After resolving the conflict with main, this PR has no remaining file changes. Closing as superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant