Skip to content

ui: remove dead antd styles, selectors, tests and packages (backport 2.1) - #36552

Merged
shah-harshit merged 1 commit into
2.1from
shah-harshit/7504-oss-antd-only-2.1
Oct 29, 2026
Merged

shah-harshit merged 1 commit into
2.1from
shah-harshit/7504-oss-antd-only-2.1

Conversation

@shah-harshit

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #36373 to 2.1. Part of open-metadata/openmetadata-collate#7504.

The merge commit aada83e157d applied as a patch with a 3-way merge. A plain cherry-pick could not fetch some objects in this partial clone, but the result is the same. There was one conflict, in playwright/eslint-rules/tests/corpus.test.mjs: 2.1 sits at 537 positional-locator suppressions because it never got main's task-count helper removal, and this change removes two, so the count is 535. The suppression baseline test confirms it.

What it carries is described in #36373:

  • The antd package, antd-master.less and the antd ESLint rules are removed.
  • antd's global base styles are kept in legacy-base.css, loaded first, ahead of master.less.
  • --ant-* variables are renamed to --theme-*, and --ant-navbar-height to --navbar-height.
  • The remaining ant-* class names are renamed.
  • Dead .ant-* selectors, tests and Playwright checks are removed.
  • tw-guard and tw-audit stop checking for antd imports.
  • Decision record: ADR:2026-10-28-antd-global-styles-live-on-in-legacy-base-css.

Prerequisite checked: 2.1 already contains #35509, and src/ has no antd imports, so removing the package is safe.

Not in this backport: 2.1 still has .ant-skeleton waits in some Playwright specs (AuditLogs, CustomProperties, ContextCenterPermission, importUtils, task.ts). main removed them in a separate PR, #36307, which belongs to that PR's backport.

Collate 2.1: Collate 2.1 tracks OpenMetadata 2.1 and keeps building after this merges, because it imports none of the deleted stylesheets. It still reads three --ant-* variables, though: --ant-navbar-height in CreateChartForm, and --ant-primary-2 / --ant-primary-5 in styles/variables.less. Those need the rename from open-metadata/openmetadata-collate#7913, backported to Collate 2.1 alongside this PR.

Type of change:

  • Improvement

Tests:

Unit tests

  • Jest on the touched modules (styles, TagsUtils, CronExpressionUtils, useThemeCssVariables, FieldErrorTemplate, Loader, SelectableList, IngestionListTable, SettingsSso, SSOUtils, formPureUtils): 24 suites, 540 tests passed.

Backend integration tests

  • Not applicable (no backend changes).

Playwright (UI) tests

Not run locally: OpenMetadata PRs don't run Playwright locally by default. The Playwright edits are the same as in #36373.

Manual testing performed

  • CSS equivalence on 2.1: 2.1's own antd-master.less was compiled with antd 4.24.16 and compared rule by rule with this branch's legacy-base.css + master.less. 2.1's variables.less differs from main's, which is why this was re-checked here.
    • After normalising the intended renames, the remaining differences are antd's own keyframes, which nothing references.
    • The [data-drop-target] table:not(.ant-table) rules became table, which matches the same elements now that nothing renders .ant-table.
  • yarn install --frozen-lockfile: passes, and antd is no longer installed.
  • yarn tsc:check: 0 errors. yarn build: passes. check-bundle-chunks: passes (1337 emitted / 1156 small JS files).
  • yarn ui-checkstyle:changed on the 45 changed src files and yarn ui-checkstyle:playwright:changed on the 33 changed Playwright files: clean, with no diff left by the tools.
  • yarn lint:playwright: 0 errors. yarn test:eslint-rules: 170/170, including the corpus baseline at 535. generate-playwright-rule-table --check: passes.
  • check-drift.js (token drift): clean. token-audit: 77 errors, the same count as on main. tw-deprecation-guard.test.js: 5/5.
  • scripts/harness/check_decision_records.py: clean.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is linked to a GitHub issue above.

* ui: remove dead antd styles, selectors, tests and packages

Nothing renders antd any more, so .ant-* LESS rules that target classes
no component emits are deleted, along with the dead .ant-* checks in
TSX, the antd mocks and assertions in unit tests, the no-op antd
selectors in Playwright, and the unused rc-picker and
react-antd-column-resize packages. Classes OSS still emits itself
(ant-form-item-explain-error, ant-select-selection-item,
ant-typography-ellipsis-custom, ant-layout-content,
ant-space-authMechanism) keep their rules, and antd-master.less stays,
so nothing renders differently.

* ui: format, prune playwright suppressions and lower the corpus count

* ui: drop comments left behind by removed antd rules

* ui: keep the antd sidebar popup wait and update the Playwright handbook

* ui: remove the antd package, antd-master.less and the antd ESLint rules

antd's global element reset, the --ant-* defaults and the rules for the two
ant-* class names still rendered move to src/styles/legacy-base.css, compiled
with variables.less so the emitted global CSS is unchanged. The rest of
antd-master.less becomes master.less. rc-virtual-list is now a direct
dependency, the rc-* type imports are local, and the dead tagRender and
TagRenderer are deleted.

* ui: rename the --ant-* variables and ant-* classes, drop antd from tw-guard

The theme colour properties become --theme-*, the navbar height becomes
--navbar-height, and the class names still rendered become form-field-error,
loader-content and auth-mechanism-space. The ant-select-selection-item rules
left by the deleted TagRenderer go, tw-guard and tw-audit stop looking for
antd imports, and the token files and specs are regenerated for the styles
removed earlier.

* ui: load legacy-base.css and master.less before every other global stylesheet

antd-master.less was first in globalStyles.ts only because import sorting put
"antd" before "app". Its replacements sorted after app.less and the other
global sheets, so antd's base rules (p margin-bottom: 1em, among others) and
master.less's layout rules started winning ties they used to lose. They now
sit in their own import group above the sorted list, and a unit test pins the
order. Also formats the files the previous commit touched.

* ui: drop the antd names left in identifiers

waitForAntOverlayToOpen becomes waitForOverlayToOpen and loses its check for
ant-zoom classes, which nothing renders. TableV2's size maps and
IngestionListTable's sort types no longer carry an Antd prefix.

* ui: sort the imports touched by the waitForOverlayToOpen rename

(cherry picked from commit aada83e)
@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 Oct 29, 2026
@shah-harshit
shah-harshit requested a review from a team as a code owner October 29, 2026 13:04
@shah-harshit shah-harshit self-assigned this Oct 29, 2026
@shah-harshit
shah-harshit requested review from shrabantipaul-collate and removed request for a team October 29, 2026 13:04
@gitar-bot

gitar-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Removing Ant Design and replacing global styles across 211 UI files could cause widespread layout or interaction regressions if retained styles differ.

Backports the removal of the antd package, its ESLint rules, and dead .ant-* styles, selectors, tests and Playwright checks to 2.1, renaming --ant-* variables to --theme-* and keeping antd's global base styles in legacy-base.css. 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

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 80%
80.15% (132394/165165) 66.74% (46882/70239) 69.8% (26592/38094)

@sonarqubecloud

Copy link
Copy Markdown

@shah-harshit
shah-harshit merged commit 5186e00 into 2.1 Oct 29, 2026
103 checks passed
@shah-harshit
shah-harshit deleted the shah-harshit/7504-oss-antd-only-2.1 branch October 29, 2026 14:37
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.

2 participants