Skip to content

Migrated TagsV1 and TagsViewer components#29778

Open
Rohit0301 wants to merge 4 commits into
mainfrom
tags-v1-migration
Open

Migrated TagsV1 and TagsViewer components#29778
Rohit0301 wants to merge 4 commits into
mainfrom
tags-v1-migration

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Uploading Screen Recording 2026-07-06 at 6.44.03 PM.mov…

Fixes 4867

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Summary by Gitar

  • Component Migration:
    • Migrated TagsV1 and TagsViewer to use custom components from @openmetadata/ui-core-components.
    • Replaced native MuiTooltip with Tooltip and TooltipTrigger for enhanced design consistency.
  • UI Refinements:
    • Updated TagsV1 to use Badge for automated tags and refined styling using tw: utility classes.
    • Standardized Typography components and icons in TagsV1 for better alignment and responsiveness.

This will update automatically on new commits.

Greptile Summary

This PR migrates TagsV1 and TagsViewer components from MUI (@mui/material) and Antd primitives to the internal @openmetadata/ui-core-components library, replacing MuiTooltip with the custom Tooltip, Typography.Text with Typography, and TagChip (MUI-based) with Badge for automated tags.

  • TagsV1: Removes useTheme, replaces TagChip with Badge for automated tag rendering, wraps the Link inside tagChip with <Focusable>, and updates icon classes from flex-shrink to tw:shrink-0. The useMemo dependency arrays are also corrected to include previously missing deps (isVersionPage, newLook, tagChipStyleClass).
  • TagsViewer: Replaces MuiTooltip with the new Tooltip in the muiTags rendering branch, changes the tooltip placement from bottom-start to top, and switches the link width class from w-full to tw:w-max.

Confidence Score: 3/5

Two tooltip trigger wiring issues could silently break tooltip display for ordinary and automated tags before merging.

The new Tooltip from @openmetadata/ui-core-components requires a TooltipTrigger child (confirmed by EntityTitleSection.tsx usage). Both changed files use <Focusable> instead, and the regular tagChip code path in TagsV1 passes the Antd <Tag> directly — with no trigger wrapper at all. This means tag tooltips may not activate on hover or keyboard focus in these two paths after the migration.

TagsV1.component.tsx (regular tag tooltip path at line 312–317) and TagsViewer.tsx (muiTags tooltip path at lines 59–85) both need their tooltip trigger children corrected from <Focusable> / direct child to <TooltipTrigger>.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx Migrates Tooltip and Typography from MUI/Antd to @openmetadata/ui-core-components; tagChip is passed to <Tooltip> without a <TooltipTrigger> or <Focusable> wrapper, inconsistent with automatedTagChip and the library's documented pattern.
openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsViewer/TagsViewer.tsx Replaces MuiTooltip with Tooltip from @openmetadata/ui-core-components in the muiTags render path; uses <Focusable> as the tooltip trigger child where <TooltipTrigger> is the expected pattern per other usages in the codebase.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[TagsViewer] -->|muiTags=true| B[Tooltip from ui-core-components]
    A -->|muiTags=false| C[TagsV1]

    B --> D["<Focusable> ⚠️ should be <TooltipTrigger>"]
    D --> E[Link → TagChip]

    C --> F{labelType === Generated?}
    F -->|yes + isEditTags| G[automatedTagChip - Link → Badge]
    F -->|yes + tooltip| H["Tooltip → <Focusable> → automatedTagChip"]
    F -->|no + isEditTags| I[tagChip - Tag → Focusable → Link]
    F -->|no + tooltip| J["Tooltip → tagChip ⚠️ missing trigger wrapper"]

    style D fill:#ffe0b2,stroke:#e65100
    style J fill:#ffe0b2,stroke:#e65100
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[TagsViewer] -->|muiTags=true| B[Tooltip from ui-core-components]
    A -->|muiTags=false| C[TagsV1]

    B --> D["<Focusable> ⚠️ should be <TooltipTrigger>"]
    D --> E[Link → TagChip]

    C --> F{labelType === Generated?}
    F -->|yes + isEditTags| G[automatedTagChip - Link → Badge]
    F -->|yes + tooltip| H["Tooltip → <Focusable> → automatedTagChip"]
    F -->|no + isEditTags| I[tagChip - Tag → Focusable → Link]
    F -->|no + tooltip| J["Tooltip → tagChip ⚠️ missing trigger wrapper"]

    style D fill:#ffe0b2,stroke:#e65100
    style J fill:#ffe0b2,stroke:#e65100
Loading

Comments Outside Diff (2)

  1. openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx, line 107-114 (link)

    P1 Dead CSS rule — tooltip paragraph colour lost

    tagsV1.less line 107 has a rule targeting .tags-tooltip.MuiTooltip-tooltip … p { color: @grey-700; }. That rule fired because the old MUI <Tooltip> received slotProps={{ tooltip: { className: 'tags-tooltip' } }}, which caused MUI to attach both .tags-tooltip and .MuiTooltip-tooltip to the tooltip element. Both classes are now gone, so the compound selector never matches — any p element inside a tag tooltip that contains markdown/rich text will revert to the default colour instead of grey-700.

  2. openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx, line 257-273 (link)

    P2 Inconsistent indentation in addTagChip<Tag> and the opening <Typography> have an extra leading space compared to the surrounding code, which breaks the expected 2-space indent.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (4): Last reviewed commit: "lint fix" | Re-trigger Greptile

@Rohit0301 Rohit0301 self-assigned this Jul 6, 2026
@Rohit0301 Rohit0301 requested a review from a team as a code owner July 6, 2026 13:15
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

Comment on lines +262 to +269
<Typography
ellipsis
className="m-0"
data-testid="add-tag"
ellipsis={{ tooltip: false }}>
size="text-xs"
weight="medium">
{getTagDisplay(tagName)}
</Typography.Text>
</Typography>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 text-primary colour class removed from "add tag" chip

The old Typography.Text carried text-primary (among other classes) that explicitly set the text colour to the brand primary. The new <Typography> only sets size and weight, with no color prop or text-primary class, so the text will fall back to whatever colour the <Tag> ancestor injects — which may not match the expected primary/blue colour. If the "add tag" chip text renders in the wrong colour after this change, adding a color prop or restoring the text-primary className here is the fix.

Comment on lines +58 to 61
<Tooltip
delay={500}
key={tag.tagFQN}
placement="bottom-start"
slotProps={{
tooltip: {
sx: {
bgcolor: 'common.black',
color: 'common.white',
},
},
}}
title={getTagTooltip(tag.tagFQN, tag.description) ?? ''}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 placement prop dropped — tooltip position changes silently

The old <MuiTooltip> used placement="bottom-start", which anchored the tooltip to the bottom-left of the tag chip. The new <Tooltip> has no placement prop, so it will fall back to whatever the @openmetadata/ui-core-components default is. In a dense list of tags this could cause the tooltip to overlap adjacent chips or appear in an unexpected direction. Consider passing placement="bottom-start" (or the equivalent prop name) to preserve the original behaviour.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.77% (72758/114087) 46.92% (42341/90239) 48.19% (13021/27018)

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (26 flaky)

✅ 4462 passed · ❌ 0 failed · 🟡 26 flaky · ⏭️ 54 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 420 0 5 33
🟡 Shard 2 819 0 5 3
✅ Shard 3 795 0 0 12
🟡 Shard 4 811 0 2 5
🟡 Shard 5 853 0 4 0
🟡 Shard 6 764 0 10 1
🟡 26 flaky test(s) (passed on retry)
  • Features/Glossary/GlossaryPagination.spec.ts › should filter by InReview status (shard 1, 1 retry)
  • Flow/CustomizeLandingPage.spec.ts › Add, Remove and Reset widget should work properly (shard 1, 1 retry)
  • Flow/TestConnectionModal.spec.ts › raw log toggle shows and hides connection log (shard 1, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 1 retry)
  • Flow/SearchRBAC.spec.ts › a dashboard-scoped user sees dashboards but never tables (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary Term (Nested) (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Table (shard 2, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article listing search filters, clears, and shows empty state (shard 2, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article list cards, recently viewed widget, and pagination work (shard 2, 1 retry)
  • Features/DomainFilterQueryFilter.spec.ts › Quick filters should persist when domain filter is applied and cleared (shard 2, 1 retry)
  • Pages/CustomProperties.spec.ts › Set & Update all CP types on table (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Should search custom properties for apiCollection in right panel (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Multiple consecutive domain renames preserve all associations (shard 5, 1 retry)
  • Pages/EntityDataSteward.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should verify deleted user not visible in owner selection for pipeline (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should allow Data Steward to view all tabs for searchIndex (shard 6, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Glossary Bulk Import Export (shard 6, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Import partial success - some terms pass, some fail (shard 6, 1 retry)
  • Pages/GlossaryTermRightPanel.spec.ts › Should display overview tab content in glossary term assets context (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for apiService in platform lineage (shard 6, 1 retry)
  • Pages/TagPageRightPanel.spec.ts › Should display correct tabs for table entity in tag assets page context (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Admin user can get all the roles hierarchy and edit roles (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@gitar-bot

gitar-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Migrates TagsV1 and TagsViewer to the @openmetadata/ui-core-components library, replacing MUI dependencies with consistent UI components. Resolved the nesting issue where TooltipTrigger incorrectly wrapped navigable anchors.

✅ 1 resolved
Bug: TooltipTrigger (a ) wraps navigable anchors

📄 openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx:301-315 📄 openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsViewer/TagsViewer.tsx:57-71
TooltipTrigger from @openmetadata/ui-core-components renders a react-aria <button> element (see tooltip.tsx:148-164, AriaButton). In this PR, the trigger now wraps content that contains interactive <a> anchors:

  • TagsV1.component.tsx:306-308 — <TooltipTrigger>{automatedTagChip}</TooltipTrigger> where automatedTagChip is a <Link> (renders <a href>).
  • TagsV1.component.tsx:320-322 — <TooltipTrigger>{tagChip}</TooltipTrigger> where tagChip is an antd <Tag> containing a <Link>.
  • TagsViewer.tsx:62-80 — <TooltipTrigger><Link ...> wraps an anchor directly.

Nesting an <a> inside a <button> is invalid HTML (interactive content cannot be nested inside a button), which causes React hydration/DOM validation warnings and undefined behavior across browsers. More importantly, react-aria's Button intercepts press/pointer events, so the tag click-through navigation that previously worked (the old code placed <Link> as the direct Tooltip child) may no longer navigate reliably, and keyboard focus order is broken (two focusable controls stacked).

Before this change the MUI Tooltip forwarded its ref to the <Link> child directly, so there was a single interactive element. Consider making the anchor itself the tooltip trigger element rather than wrapping it in a <button> — e.g. render the Link via react-aria's link-based trigger, or verify that TooltipTrigger supports an elementType/as prop so it can render as an <a> instead of a <button>. At minimum, confirm navigation and keyboard access still work end-to-end, since there is no UI recording or test attached to this PR.

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot

gitar-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Migrates TagsV1 and TagsViewer to the @openmetadata/ui-core-components library, replacing MUI dependencies with consistent UI components. Resolved the nesting issue where TooltipTrigger incorrectly wrapped navigable anchors.

✅ 1 resolved
Bug: TooltipTrigger (a ) wraps navigable anchors

📄 openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx:301-315 📄 openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsViewer/TagsViewer.tsx:57-71
TooltipTrigger from @openmetadata/ui-core-components renders a react-aria <button> element (see tooltip.tsx:148-164, AriaButton). In this PR, the trigger now wraps content that contains interactive <a> anchors:

  • TagsV1.component.tsx:306-308 — <TooltipTrigger>{automatedTagChip}</TooltipTrigger> where automatedTagChip is a <Link> (renders <a href>).
  • TagsV1.component.tsx:320-322 — <TooltipTrigger>{tagChip}</TooltipTrigger> where tagChip is an antd <Tag> containing a <Link>.
  • TagsViewer.tsx:62-80 — <TooltipTrigger><Link ...> wraps an anchor directly.

Nesting an <a> inside a <button> is invalid HTML (interactive content cannot be nested inside a button), which causes React hydration/DOM validation warnings and undefined behavior across browsers. More importantly, react-aria's Button intercepts press/pointer events, so the tag click-through navigation that previously worked (the old code placed <Link> as the direct Tooltip child) may no longer navigate reliably, and keyboard focus order is broken (two focusable controls stacked).

Before this change the MUI Tooltip forwarded its ref to the <Link> child directly, so there was a single interactive element. Consider making the anchor itself the tooltip trigger element rather than wrapping it in a <button> — e.g. render the Link via react-aria's link-based trigger, or verify that TooltipTrigger supports an elementType/as prop so it can render as an <a> instead of a <button>. At minimum, confirm navigation and keyboard access still work end-to-end, since there is no UI recording or test attached to this PR.

Options

Display: compact → Showing less information.

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

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant