Skip to content

feat(ui-core): add semantic color prop to Typography - #30665

Merged
chirag-madlani merged 1 commit into
antd-migration/core-button-forwardreffrom
antd-migration/core-typography-color
Jul 30, 2026
Merged

chirag-madlani merged 1 commit into
antd-migration/core-button-forwardreffrom
antd-migration/core-typography-color

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of the AntD → ui-core-components migration (Wave 1 prep, epic #30570). Stacked on #30664 (reuses its vitest infra); base auto-retargets to main when that merges.

antd Typography's type prop (semantic text color) has no core equivalent — the Typography sweep's gap check found 20 live type="secondary" call sites whose only migration target today is a per-site hardcoded className. This adds a first-class prop so the sweep gets a 1:1 mapping, and covers the remaining antd values for future use.

color?: 'secondary' | 'success' | 'warning' | 'danger' mapped to existing semantic tokens (no invented names — each verified in current core usage):

value token precedent
secondary tw:text-tertiary tree.tsx, pagination.tsx
success tw:text-success-primary existing theme usage
warning tw:text-warning-primary existing theme usage
danger tw:text-error-primary form-field, file-upload

Omitted prop → behavior unchanged. Consumer className composes and can still override (twMerge precedence, documented inline).

Tests

7 new vitest cases (one per value, omitted-prop no-op, className composition) — written failing first, now green; full package suite 11/11.

Fixes #30663

🤖 Generated with Claude Code

Greptile Summary

Adds semantic text-color support to the ui-core Typography component.

  • Introduces a typed color prop mapping secondary, success, warning, and danger values to existing Tailwind utilities.
  • Preserves consumer className precedence through cx.
  • Adds tests for every semantic value, omitted-color behavior, class composition, and color overrides.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete behavioral, compatibility, or security defects identified.

The semantic values map to fixed existing utility classes, omitted color preserves prior behavior, consumer classes retain precedence, and focused tests cover the new API behavior.

Important Files Changed

Filename Overview
openmetadata-ui-core-components/src/main/resources/ui/src/components/foundations/typography.tsx Adds a typed semantic color mapping and composes it with existing Typography classes without changing omitted-prop behavior.
openmetadata-ui-core-components/src/main/resources/ui/src/components/foundations/typography.test.tsx Covers all supported color values, default behavior, class composition, and consumer color-class precedence.

Reviews (1): Last reviewed commit: "feat(ui-core): add semantic color prop t..." | Re-trigger Greptile

antd's Typography.Text/Paragraph exposes a `type` prop ("secondary" | "success" | "warning" | "danger") that sets a semantic text color. The antd->ui-core-components migration gap-check found 20 call sites relying on `type="secondary"` with no core equivalent, forcing a per-site `className="tw:text-tertiary"` workaround. This adds a first-class `color` prop to core Typography mapping each antd type to the existing semantic Tailwind text tokens (tw:text-tertiary, tw:text-success-primary, tw:text-warning-primary, tw:text-error-primary), matching the idiom already used elsewhere in core (tree.tsx, pagination.tsx, form-field, empty-placeholder). Omitting the prop leaves current behavior unchanged, and an explicit consumer className still wins over the color class via twMerge ordering.

Fixes #30663

Co-Authored-By: Claude Fable 5 <[email protected]>
@chirag-madlani
chirag-madlani requested a review from karanh37 as a code owner July 29, 2026 17:38
@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 safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jul 29, 2026
@gitar-bot

gitar-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Adds a semantic color prop to the Typography component mapped to existing design tokens, supported by comprehensive vitest coverage. 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 👍 / 👎 | Gitar | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 33f8cda334e77fd7092f4d48db96afc7a897e1b2 in Playwright run 30476283214, attempt 1.

✅ 65 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 3 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) 59m 48s

⏱️ Max setup 1m 28s · max shard execution 7m 22s · max shard-job elapsed before upload 10m 22s · reporting 2s

🌐 146.49 requests/attempt · 1.73 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Application boot ratio was 1.73 per UI scenario (116 boots / 67 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 65 0 0 3 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

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