Skip to content

refactor(ui): replace native HTML elements with Ant Design 5 components for consistent theming #33231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
May 12, 2025

Conversation

EnxDev
Copy link
Contributor

@EnxDev EnxDev commented Apr 24, 2025

SUMMARY

The goal of this PR is to replace all remaining native HTML elements within the superset-frontend/src, superset-frontend/plugins, and superset-frontend/packages directories with their corresponding Ant Design 5 components.

This change is being made to ensure that theming colors are applied consistently across all components in the project.
By replacing native HTML elements like <input>,<table>, <button>, <li>, and <h3>/<h4> tags with Ant Design 5 components such as Input, Button, Typography.Title, and List.Item, we can guarantee that the Ant Design theming system works as expected.

Specifically, this will:

Ensure consistent application of theming 🎨 (colors, fonts, spacing) across the UI.

Improve maintainability by aligning the entire codebase with the Ant Design 5 component system 🔧.

Ensure better responsiveness, theming, and accessibility 🌍 through the Ant Design 5 system.

Facilitate future UI enhancements, as the project will be fully based on Ant Design 5 components, making it easier to integrate new features or updates from the design system 🚀.

This PR can be considered a continuation of #33090, further extending the standardization and theming improvements across the project.

After this change, the theming colors and styles will work uniformly across all components, providing a consistent look and feel throughout the application.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

  • Before
    before-explore
  • After
    after

TESTING INSTRUCTIONS

  • The changes need to maintain the same appearance as before, and all tests should pass

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

korbit-ai bot commented Apr 24, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@EnxDev EnxDev added the frontend:refactor Related to refactoring the frontend label Apr 30, 2025
@EnxDev EnxDev requested review from mistercrunch and msyavuz May 8, 2025 11:18
@EnxDev EnxDev marked this pull request as ready for review May 8, 2025 11:19
@dosubot dosubot bot added the change:frontend Requires changing the frontend label May 8, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset-frontend/packages/superset-ui-chart-controls/src/components/Menu.tsx
superset-frontend/packages/superset-ui-chart-controls/src/components/Dropdown.tsx
superset-frontend/packages/superset-ui-demo/storybook/shared/components/Expandable.tsx
superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx
superset-frontend/src/components/Pagination/Wrapper.tsx
superset-frontend/packages/superset-ui-chart-controls/src/components/Select.tsx
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.js
superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipTable.tsx
superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx
superset-frontend/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx
superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx
superset-frontend/plugins/plugin-chart-table/src/Styles.tsx
superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx
superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/TableCatalog.tsx
superset-frontend/src/components/index.ts
superset-frontend/src/explore/components/controls/ZoomConfigControl/ZoomConfigControl.tsx
superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx
superset-frontend/src/features/annotationLayers/AnnotationLayerModal.tsx
superset-frontend/src/features/cssTemplates/CssTemplateModal.tsx
superset-frontend/src/features/databases/DatabaseModal/ModalHeader.tsx
superset-frontend/src/features/reports/ReportModal/index.tsx
superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx
superset-frontend/src/explore/components/PropertiesModal/index.tsx
superset-frontend/src/features/rls/RowLevelSecurityModal.tsx
superset-frontend/src/components/ListView/ListView.tsx
superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
superset-frontend/src/features/alerts/AlertReportModal.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@EnxDev EnxDev requested a review from msyavuz May 9, 2025 13:16
@@ -17,5 +17,4 @@
* under the License.
*/

export { Dropdown } from 'antd';
export type { DropDownProps } from 'antd/lib/dropdown';
export { Dropdown, type DropDownProps } from 'antd-v5';
Copy link
Member

Choose a reason for hiding this comment

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

is the plan to use what's in src/components once we move it to @superset-ui/core ?

Copy link
Member

Choose a reason for hiding this comment

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

wondering what effect it may have on bundle sizes until we move things around ...

Copy link
Member

@msyavuz msyavuz left a comment

Choose a reason for hiding this comment

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

Looks good to me

@msyavuz msyavuz merged commit 67aa991 into template_less May 12, 2025
47 checks passed
@msyavuz msyavuz deleted the enxdev/refactor/ui-html-to-antd5 branch May 12, 2025 07:00
// eslint-disable-next-line no-restricted-imports
import { Form, Tag } from 'antd'; // TODO: Remove antd
import { Form, Tag } from 'antd';
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't these have been migrated to Ant Design 5 or at least keep the // TODO: Remove antd?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please follow this #33231 (comment)

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

Successfully merging this pull request may close these issues.

4 participants