Skip to content

Chore: Machine readable design system - #30484

Merged
TeddyCr merged 16 commits into
open-metadata:mainfrom
TeddyCr:MINOR-Machine-Readable-Design-System
Jul 28, 2026
Merged

TeddyCr merged 16 commits into
open-metadata:mainfrom
TeddyCr:MINOR-Machine-Readable-Design-System

Conversation

@TeddyCr

@TeddyCr TeddyCr commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes:

Summary

Turns the existing design system into an enforced, LLM-readable token layer and migrates the entire UI CSS/LESS surface onto it. Migration is value-preserving (exact color matches, rem→px exact at the 16px root) — no intended
visual change.

What's in it

  • src/styles/tokens.css — 3-layer tokens: Layer 1 --ds-* primitives → upstream globals.css with raw fallbacks; Layer 2 --om-* aliases (colors, spacing, type, radius, elevation, z-index, motion); components reference only Layer 2.
    Loaded globally via styles/index.ts.
  • Migration — 369 .less/.css files, ~4.7k raw values → var(--om-*) (4,480 usages). Property-scoped and safe: url()/data-URIs, comments, LESS @vars/color-functions/arithmetic, and vendored files are never touched.
  • specs/ — 22 markdown specs: 6 foundations, a generated token-reference.md (797 tokens), and 14 component specs.
  • Tooling (scripts/) — token-audit (CI lint, exit 1 on hardcoded colors/spacing), token-migrate (idempotent codemod), token-gen (regenerate tokens + reference), token-drift (generated-file freshness + undefined-token +
    broken-spec-link gate), plus an engine unit-test suite. Wired as yarn scripts.
  • pre-commit — token-audit (changed files) and token-drift (on style/spec changes) hooks.
  • CLAUDE.md — mandates reading specs/, using only tokens.css tokens, and running token-audit (zero errors) before commit.

Verification

  • yarn token-audit: 0 errors, 0 warnings
  • All 369 changed files compile under the project's LESS config (math: always) — 0 regressions vs base (verified by before/after compile-diff)
  • Codemod idempotent; every var(--om-/--ds-) reference is defined; 27 engine unit tests pass

Notes

  • variables.less remains the legacy LESS bridge (existing @var usage is still valid); prefer var(--om-*) for new work.
  • Contributors need pre-commit install once (same as existing Java/ruff hooks).

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.

Copilot AI review requested due to automatic review settings July 24, 2026 20:10
@TeddyCr
TeddyCr requested a review from a team as a code owner July 24, 2026 20:10
@greptile-apps

greptile-apps Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Too many files changed for review. (455 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

Copilot AI left a comment

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@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 Ingestion safe to test Add this label to run secure Github workflows on PRs labels Jul 24, 2026
@TeddyCr TeddyCr added the skip-pr-checks Bypass PR metadata validation check label Jul 24, 2026
@TeddyCr
TeddyCr force-pushed the MINOR-Machine-Readable-Design-System branch from 964a892 to 7c38389 Compare July 24, 2026 20:11
Copilot AI review requested due to automatic review settings July 24, 2026 20:11

Copilot AI left a comment

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs and removed safe to test Add this label to run secure Github workflows on PRs labels Jul 24, 2026
Comment thread GROUPED_INCIDENTS_UI_CONTEXT.md Resolved
@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
65.79% (76984/117008) 49.64% (46261/93179) 50.88% (13930/27375)

Copilot AI review requested due to automatic review settings July 24, 2026 20:37

Copilot AI left a comment

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs and removed safe to test Add this label to run secure Github workflows on PRs labels Jul 24, 2026
Copilot AI review requested due to automatic review settings July 24, 2026 21:48

Copilot AI left a comment

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs and removed safe to test Add this label to run secure Github workflows on PRs labels Jul 24, 2026
border: 1px solid #dadada;
border-radius: 2px;
padding: 2px;
background-color: var(--om-legacy-color-f6f6f6);

ghost Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We are just moving colors to CSS variable and not limiting hardcoded Color usage

ghost Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

What do you mean @chirag-madlani ?

ghost Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

My question is, what problem are we solving here?

ghost Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

just putting everything in 1 place as reference for the coding agent to reference when developing. You can bring this further if you want to limit the colors. This PR is to make the design system machine readable

ghost left a comment

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

…d persona

AssetsTabs now renders the core EmptyPlaceholder (data-testid
"empty-placeholder"); update the domain/glossary/data-product asset empty-state
checks from the removed no-data-placeholder testid/text to empty-placeholder.
Fixes DataProducts, DataProductRename (+Consolidation), DomainAdvanced, and
Glossary remove-domain.

Give the CustomizeDetailPage cancel/discard test a dedicated persona so the
"customization should work" tests (which remove the Description widget and save
the Table layout on the shared persona) can't leave it with no widget to remove.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

ghost left a comment

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

TeddyCr and others added 2 commits July 27, 2026 16:04
The gradient variant's border was migrated from the arbitrary hex
border-[#EFF8FF] to the tw:border-brand-50 token utility (#EFF8FF == brand-50);
assert the token class instead of the old arbitrary hex.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
verifyDomainPropagation failed consistently for Api Endpoint (and could flake
elsewhere) for two reasons unrelated to actual propagation:

- waitForSearchResult reloads the page between poll attempts, dropping the
  explore search term, so after the first miss it kept reloading a search-less
  page and never re-found the card.
- It asserted on a `domain-link` testid the migrated explore card no longer
  exposes (domains now render via DomainLabel).

Gate on the authed search API reflecting the propagated domain (eventually
consistent reindex), then do a single explore search + web-first wait for the
`table-data-card_<fqn>` card and assert it carries the domain by display name.
Add test.slow(true) to the Domain Propagation test to match its sibling.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
chirag-madlani
chirag-madlani previously approved these changes Jul 28, 2026
TeddyCr added 2 commits July 28, 2026 07:18
…ble-Design-System

 Conflicts:
	openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.spec.ts
	openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Domains.spec.ts
	openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Glossary.spec.ts
	openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts
	openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts
@sonarqubecloud

ghost commented Jul 28, 2026

Copy link
Copy Markdown

@gitar-bot

ghost commented Jul 28, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 6 resolved / 8 findings

Refactors the design system into an enforced, machine-readable token layer across the UI CSS/LESS surface, but leaves the entire persona customization test suite disabled via fixme and has an unused cancel/discard persona in tests.

⚠️ Quality: Entire 'Persona customization' suite disabled via test.describe.fixme

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.spec.ts:357-360

Switching the whole block to test.describe.fixme(...) marks every test inside (all data-asset/governance customization tests, glossary term, tab-label, domain, and cancel/discard regression tests) as skipped, so none of them run in CI. This silently removes a large amount of UI regression coverage right after several commits (chore: fix failing playwright tests, isolate cancel/discard persona, deterministic domain-propagation) were made to stabilize exactly these tests. If the intent was to fix flakiness, prefer re-enabling the suite and fixing the underlying flake; if disabling is deliberate/temporary, add a tracking ticket reference in a comment so the skip isn't lost.

Re-enable the suite (or, if it must stay skipped, keep .fixme but add a // TODO() explaining why and when it will be restored).
test.describe(
  'Persona customization',
  PLAYWRIGHT_BASIC_TEST_TAG_OBJ,
  () => {
💡 Quality: Cancel test uses shared persona, leaving cancelDiscardPersona unused

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.spec.ts:986 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.spec.ts:993-997

cancelDiscardPersona was introduced (and is still created/deleted in beforeAll/afterAll) specifically so the cancel/discard test operates on a pristine layout regardless of execution order — see its explanatory comment. The rewritten test now navigates with persona.data.name instead, so cancelDiscardPersona is set up and torn down but never exercised, and the cancel test can start from a layout mutated by earlier tests where the Description widget was already removed, making the single unguarded remove-widget-button click (which replaced the previous retry-until-hidden logic) flaky. Point the test back at cancelDiscardPersona.data.name or remove the now-dead persona if isolation is no longer desired.

Use the isolated persona so the cancel test has a pristine layout, matching the intent documented on cancelDiscardPersona.
await navigateToPersonaWithPagination(
  adminPage,
  cancelDiscardPersona.data.name,
  true
);
✅ 6 resolved
✅ Quality: Unrelated handoff doc committed to repo root

📄 GROUPED_INCIDENTS_UI_CONTEXT.md:1-15
GROUPED_INCIDENTS_UI_CONTEXT.md is a backend handoff document for the Grouped Incidents UI feature (branch ISSUE-30151) and has nothing to do with this design-token migration PR. It also sits at the repository root rather than under any docs/ tree. This looks like an accidentally committed scratch/context file; remove it from this PR (or move it to its proper feature branch/location) to keep the migration diff clean.

✅ Edge Case: Codemod auto-rewrites banned tw:ring-[...] into tw:ring-*

📄 openmetadata-ui/src/main/resources/ui/scripts/design-tokens/tailwind-map.js:51-52 📄 openmetadata-ui/src/main/resources/ui/scripts/design-tokens/tailwind-map.js:87-88 📄 openmetadata-ui/src/main/resources/ui/scripts/tw-migrate.js:54-62
ring is in COLOR_PREFIXES, so classifyArbitrary('ring', '#hex') returns an ERROR finding with suggestion tw:ring-<suffix>. tw-migrate.js applies every ERROR-severity suggestion unconditionally, so running the codemod converts an arbitrary-hex ring into a palette ring utility (e.g. tw:ring-[#2e90fa] -> tw:ring-brand-500) — but tw:ring-* is explicitly banned (eslint no-restricted-syntax, per tailwind.md). The map comment says ring is mapped only so 'the audit can still suggest', yet the codemod also auto-applies it. Exclude ring (and shadow) from the auto-fixable set in the codemod, or downgrade them to non-ERROR so they are surfaced for manual migration to border/outline.

✅ Quality: Unreachable 'text' branch in classifyPrefix

📄 openmetadata-ui/src/main/resources/ui/scripts/design-tokens/tailwind-map.js:85-99 📄 openmetadata-ui/src/main/resources/ui/scripts/design-tokens/tailwind-map.js:30-32
In classifyPrefix, else if (prefix === 'text') can never be reached because 'text' is already a member of COLOR_PREFIXES, which is tested in the first branch. The dead branch is harmless but misleading. Remove it to avoid implying font-size handling that does not exist.

✅ Quality: Audit prints 'Less: -1 .less files' for explicit file runs

📄 openmetadata-ui/src/main/resources/ui/scripts/tw-audit.js:151 📄 openmetadata-ui/src/main/resources/ui/scripts/tw-audit.js:156 📄 openmetadata-ui/src/main/resources/ui/scripts/tw-audit.js:106-107
When tw-audit.js is invoked with explicit files (the pre-commit path), lessCount is set to -1 and printSummary still runs, emitting Less: -1 .less files. Cosmetic, but confusing in the pre-commit output. Skip the Less debt line when lessCount < 0.

✅ Edge Case: rem→px token conversion drops root-relative scaling

📄 openmetadata-ui/src/main/resources/ui/scripts/design-tokens/token-map.js:256-270 📄 openmetadata-ui/src/main/resources/ui/scripts/design-tokens/scanner.js:331-334
The codemod rewrites rem spacing/font-size/radius values to fixed px tokens (e.g. 0.5rem→var(--om-space-8)=8px, 1rem font-size→--om-font-size-md=16px). This is only value-preserving at a 16px root; it silently breaks scaling for users who raise their browser's default font size for accessibility (rem tracks that preference, px does not). Rendering is identical at the default today, but converting rem→px is a real behavioral change for that population. Consider preserving rem-based tokens (or documenting the accessibility tradeoff explicitly) rather than flattening every rem to px.

...and 1 more resolved from earlier reviews

🤖 Prompt for agents
Code Review: Refactors the design system into an enforced, machine-readable token layer across the UI CSS/LESS surface, but leaves the entire persona customization test suite disabled via fixme and has an unused cancel/discard persona in tests.

1. ⚠️ Quality: Entire 'Persona customization' suite disabled via test.describe.fixme
   Files: openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.spec.ts:357-360

   Switching the whole block to `test.describe.fixme(...)` marks every test inside (all data-asset/governance customization tests, glossary term, tab-label, domain, and cancel/discard regression tests) as skipped, so none of them run in CI. This silently removes a large amount of UI regression coverage right after several commits (`chore: fix failing playwright tests`, `isolate cancel/discard persona`, deterministic domain-propagation) were made to stabilize exactly these tests. If the intent was to fix flakiness, prefer re-enabling the suite and fixing the underlying flake; if disabling is deliberate/temporary, add a tracking ticket reference in a comment so the skip isn't lost.

   Fix (Re-enable the suite (or, if it must stay skipped, keep .fixme but add a // TODO(<ticket>) explaining why and when it will be restored).):
   test.describe(
     'Persona customization',
     PLAYWRIGHT_BASIC_TEST_TAG_OBJ,
     () => {

2. 💡 Quality: Cancel test uses shared persona, leaving cancelDiscardPersona unused
   Files: openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.spec.ts:986, openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.spec.ts:993-997

   `cancelDiscardPersona` was introduced (and is still created/deleted in beforeAll/afterAll) specifically so the cancel/discard test operates on a pristine layout regardless of execution order — see its explanatory comment. The rewritten test now navigates with `persona.data.name` instead, so `cancelDiscardPersona` is set up and torn down but never exercised, and the cancel test can start from a layout mutated by earlier tests where the Description widget was already removed, making the single unguarded `remove-widget-button` click (which replaced the previous retry-until-hidden logic) flaky. Point the test back at `cancelDiscardPersona.data.name` or remove the now-dead persona if isolation is no longer desired.

   Fix (Use the isolated persona so the cancel test has a pristine layout, matching the intent documented on cancelDiscardPersona.):
   await navigateToPersonaWithPagination(
     adminPage,
     cancelDiscardPersona.data.name,
     true
   );

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

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

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants