Skip to content

Conversation

@artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Sep 23, 2025

Closes #2239

Stand (AccessDenied should be displayed): https://nda.ya.ru/t/Ln81amqO7KK7a8

The goal is to fix icons rendering when embedded ui is used as a package

  • Load illustrations with @svgr/webpack
  • Render svg with Icon instead of img
  • Changed fixed height and width in icons to viewbox

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 373 0 3 2
Test Changes Summary ⏭️2

⏭️ Skipped Tests (2)

  1. Scroll to row, get shareable link, navigate to URL and verify row is scrolled into view (tenant/diagnostics/tabs/queries.test.ts)
  2. Copy result button copies to clipboard (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: 🔽

Current: 85.36 MB | Main: 85.40 MB
Diff: 0.04 MB (-0.04%)

✅ Bundle size decreased.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Illustration component to render using the Icon component instead of directly loading SVG images. The change improves type safety by using IconData and addresses rendering issues with sprite elements.

Key changes:

  • Migrated from img-based rendering to Icon component rendering
  • Changed width prop from string to number type for consistency
  • Added proper TypeScript typing with IconData

Reviewed Changes

Copilot reviewed 8 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/components/Illustration/Illustration.tsx Complete refactor to use Icon component with IconData typing and async loading
src/components/Illustration/Illustration.scss New CSS styles for Icon-based rendering with responsive sizing
config-overrides.js Added illustrations directory to webpack SVG processing
src/containers/Tenants/Tenants.tsx Updated width prop from string "200" to number 200
src/containers/Tenant/Healthcheck/Healthcheck.tsx Updated width prop from string "200" to number 200
src/containers/Tenant/Diagnostics/Network/Network.tsx Updated width prop from string "200" to number 200
src/containers/Nodes/NodesTable.tsx Updated width prop from string "200" to number 200
src/components/EmptyFilter/EmptyFilter.tsx Added explicit width={200} to default image prop

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 8 out of 14 changed files in this pull request and generated 2 comments.

&__icon {
width: 100%;
height: 100%;
}
Copy link
Member Author

@artemmufazalov artemmufazalov Sep 23, 2025

Choose a reason for hiding this comment

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

Without these properties and explicitly set width and height, gravity-ui icons can use viewbox sizes. We need to be able to set only width or to use parent component sizes, so percentage sizes are needed here

https://github.com/gravity-ui/uikit/blob/main/src/components/Icon/Icon.tsx#L84

@artemmufazalov artemmufazalov marked this pull request as ready for review September 23, 2025 15:43
@artemmufazalov artemmufazalov added this pull request to the merge queue Sep 24, 2025
Merged via the queue into main with commit 0a9e5fa Sep 24, 2025
9 checks passed
@artemmufazalov artemmufazalov deleted the fix-illustration branch September 24, 2025 08:01
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.

EmptyState is not properly rendered in EM multi-cluster version

3 participants