Skip to content

fix(ui): resolve cached-image race in Icon and move IconProps to interface file - #32067

Merged
Rohit0301 merged 2 commits into
mainfrom
icon-render-fix
Aug 26, 2026
Merged

Rohit0301 merged 2 commits into
mainfrom
icon-render-fix

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #

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

  • Refactoring:
    • Extracted IconProps interface into a dedicated Icon.interface.ts file
  • Bug fix:
    • Resolved cached image race condition in Icon component by checking img.complete on mount
  • Testing & Components:
    • Added unit test for cached images in Icon.test.tsx and updated Certification component fallback

This will update automatically on new commits.

Greptile Summary

The PR updates the shared Icon component to resolve already-complete images after mounting and moves its props into a dedicated interface file.

  • Adds cached-image completion handling and a focused unit test.
  • Adds a certification fallback icon when custom image loading fails.
  • Extracts IconProps into Icon.interface.ts.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/components/common/Icon/Icon.tsx Adds a post-mount completion check for cached images and imports the extracted props interface.
openmetadata-ui/src/main/resources/ui/src/components/common/Icon/Icon.test.tsx Adds coverage verifying that an already-complete cached image is displayed without its loading skeleton.
openmetadata-ui/src/main/resources/ui/src/components/common/Icon/Icon.interface.ts Defines the extracted IconProps interface without changing its prop shape.
openmetadata-ui/src/main/resources/ui/src/components/Certification/Certification.component.tsx Supplies the standard certification icon as a fallback when a configured icon fails to load.

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

@Rohit0301 Rohit0301 self-assigned this Aug 25, 2026
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Aug 25, 2026
@github-actions

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.

@github-actions github-actions Bot added the UI UI specific issues label Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 3 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 3 warning(s) across 1 changed file(s).

Count Rule
2 react-hooks/exhaustive-deps
1 sonarjs/no-nested-conditional
All findings
Location Rule Message
🟡 src/components/Certification/Certification.component.tsx:119:9 react-hooks/exhaustive-deps The 'handleScroll' function makes the dependencies of useMemo Hook (at line 218) change on every render. Move it inside the useMemo callback. Alternatively, wra
🟡 src/components/Certification/Certification.component.tsx:188:21 sonarjs/no-nested-conditional Extract this nested ternary operation into an independent statement.
🟡 src/components/Certification/Certification.component.tsx:254:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'currentCertificate' and 'getCertificationData'. Either include them or remove the dependency array. If 'setSelec

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 67%
67.13% (80620/120080) 51.55% (49301/95632) 52.52% (14750/28083)

@gitar-bot

gitar-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Resolves a cached-image race condition in the Icon component and extracts IconProps into a dedicated interface file. No issues found.

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 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 5b2668f0bf86d653c8e93db21c2c42977266e2ac in Playwright run 32881624149, attempt 1.

✅ 552 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 55m 22s

⏱️ Max setup 5m 21s · max shard execution 18m 33s · max shard-job elapsed before upload 22m 45s · reporting 4s

🌐 213.13 requests/attempt · 2.83 app boots/UI scenario · 13.66% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 213.13 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.83 per UI scenario (1626 boots / 575 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 133 0 0 0 0 0
🟡 Shard chromium-02 139 0 1 0 0 0
✅ Shard chromium-03 126 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.ts › Announcement create, edit & delete (shard chromium-02, 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

@Rohit0301
Rohit0301 added this pull request to the merge queue Aug 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-26T07:47:41Z)

Blocked the queue: playwright-summary

@Rohit0301
Rohit0301 added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit 602baf4 Aug 26, 2026
90 of 93 checks passed
@Rohit0301
Rohit0301 deleted the icon-render-fix branch August 26, 2026 11:09
ShaileshParmar11 pushed a commit that referenced this pull request Aug 27, 2026
* fix(ui): render icon/image URLs by real load outcome instead of regex pre-validation (#31982)

* fix(ui): render icon/image URLs by real load outcome instead of regex pre-validation

* lint fix

* addressed gitar comment

* addressed gitar comment

* lint fix

* fix(ui): resolve cached-image race in Icon and move IconProps to interface file (#32067)

* fix(ui): resolve cached-image race in Icon and move IconProps to interface file

* lint fix

* fix(ui): apply icon-image classes to the <img> instead of its wrapper span (#32110)

* fix(ui): apply icon-image classes to the <img> instead of its wrapper span

* addressed gitar comment

* lint fix

* unit test fix

* fix(playwright): select Collate SaaS Runner before password fill in ServiceCreationPermissions (#32112)

* fix(playwright): select Collate SaaS Runner before filling password in ServiceCreationPermissions test

When the default runner is Remote Runner the form validation requires
passwords to start with the secret: prefix; switching to Collate SaaS
Runner before submitting removes that requirement so the test can use a
plain-text password value.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* fix(playwright): move runner selection before password fill to prevent blur-time validation error

RJSF customValidate can fire on field blur; selecting Collate SaaS Runner
after the password is typed means the secret: prefix validation may
trigger while Remote Runner is still active. Select the runner first so
the error is never recorded.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>

* fix(ui): Renamed context center Dashboard to Overview

* lint fix

* playwright fix

* lint fix

* Rename i18n key from what-should-ask-collate-remember to what-should-ai-remember

Replace the old product-branded key with a generic AI key across the component and all 20 locale files, and move the key from the label namespace to the message namespace where the component expects it.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* lint fix

* class based approach

* lint fix

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>

This branch was previously deployed

1 inactive deployment
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants