Skip to content

chore(ui): verify theme propagation and add audit warnings - #33254

Merged
shah-harshit merged 3 commits into
mainfrom
6566-theme-root-propagation-tests
Sep 18, 2026
Merged

shah-harshit merged 3 commits into
mainfrom
6566-theme-root-propagation-tests

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Part of open-metadata/openmetadata-collate#6566
Closes open-metadata/openmetadata-collate#6567
Gate contract: open-metadata/openmetadata-collate#6564
Token foundation: #33249

This PR combines two small shared-theme foundation slices:

  • Verifies that the single root ThemeProvider governs application and portal content.
  • Verifies that customer brand variables persist across theme changes and that stale variables are removed.
  • Reports explicit tw:dark:* overrides and unsupported --ai-* theme tokens as review warnings.
  • Documents the fixed-color and dark-override exception requirements.
  • Runs both design-token scanner suites in UI Checkstyle and keeps successful warning output visible.

The reference to #6566 is intentionally non-closing because that ticket also owns the separate Collate pre-paint restoration change. Existing audit errors remain errors; only the new migration rules are warning-level and non-blocking.

Type of change:

  • Improvement
  • Tests

High-level design:

The ThemeProvider tests exercise the existing provider through its public context and observable DOM/root-style effects. Portal content is rendered through createPortal into document.body, while the active theme remains owned by document.documentElement.

The token scanners reuse their existing finding and severity model. They classify tw:dark:* and --ai-* occurrences as warnings so migration debt is visible without blocking incremental AI-mode work. Existing hardcoded-value error classifications and exit behavior are unchanged.

There are no production runtime, token-value, component, domain, generated-file, API, or submodule changes.

Tests:

Use cases covered

  • A body-mounted portal follows live light/dark theme changes through the root theme.
  • Portal elements and document.body do not receive copied theme classes.
  • Customer brand variables survive theme changes.
  • Replaced and removed customer branding clears stale variables.
  • Explicit dark variants and --ai-* tokens produce warnings, not errors.
  • Shared semantic utilities do not produce those warnings.

Unit tests

  • yarn test src/context/UntitledUIThemeProvider/theme-provider.test.tsx --runInBand — 15 tests passed.
  • node scripts/design-tokens/scanner.test.js — 28 checks passed.
  • node --test scripts/design-tokens/tw-scanner.test.js — 3 tests passed.
  • node scripts/tw-audit.js scripts/design-tokens/tw-scanner.test.js — 0 errors and 4 expected warnings; exit 0.

Backend and ingestion integration tests

  • Not applicable; no backend or ingestion changes.

Playwright tests

  • Not applicable; no user-visible runtime change.

Local verification

  • Focused ESLint and Prettier checks passed.
  • JavaScript syntax and workflow YAML syntax checks passed.
  • git diff --check passed.

UI screen recording / screenshots:

Not applicable. This PR adds regression coverage, audit warnings, and contributor guidance without changing rendered UI.

Checklist:

  • I have read the CONTRIBUTING document.
  • The PR references both implementation tickets, the Gate Zero contract, and the token dependency.
  • New dark-theme audit classifications are warning-level and covered by focused tests.
  • Existing audit error behavior is unchanged.
  • JSON Schema migrations are not applicable.
  • UI screenshots are not applicable because rendered behavior is unchanged.

@shah-harshit shah-harshit added 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 labels Sep 13, 2026
@shah-harshit shah-harshit self-assigned this Sep 13, 2026
@shah-harshit shah-harshit changed the title test(ui): verify root theme and portal propagation chore(ui): verify theme propagation and add audit warnings Sep 13, 2026
@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.85% (102383/140535) 57.61% (62080/107751) 58.81% (20335/34572)

@shah-harshit
shah-harshit dismissed stale reviews from pellejador and karanh37 via ead06cc September 15, 2026 13:08
@gitar-bot

gitar-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Adds theme propagation tests and audit warnings for design token migrations. ThemeProvider tests verify root theme governance and customer brand variable persistence across theme changes, while new scanner checks classify tw:dark:* overrides and --ai-* tokens as warnings to surface migration debt without blocking. No issues found.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@sonarqubecloud

Copy link
Copy Markdown

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 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.

5 participants