Skip to content

Fixes 6035: Add theme-aware Data Insights colors - #32518

Merged
shah-harshit merged 4 commits into
mainfrom
issue-6035-data-insights-theme
Sep 5, 2026
Merged

shah-harshit merged 4 commits into
mainfrom
issue-6035-data-insights-theme

Conversation

@shah-harshit

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

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #6035

This stacked PR makes Data Insights and KPI chart presentation respond to the active theme. It resolves semantic and categorical color tokens to concrete SVG/canvas-safe values, refreshes those values when the theme changes, and replaces the remaining dark-only chart, progress, legend, and panel colors in this slice.

Depends on #32482 and targets its feature branch so the theme work can be reviewed and backported as a stack.

Screen.Recording.2026-09-03.at.8.50.14.PM.mov
Screenshot 2026-09-03 at 8 51 13 PM Screenshot 2026-09-03 at 8 51 27 PM

Type of change:

  • Improvement

High-level design:

  • Add a shared useDataInsightChartColors hook that resolves registered --om-color-* tokens with deterministic fallbacks and recomputes them when the active theme changes.
  • Route reusable Data Insights charts, KPI charts, legends, progress bars, axes, grids, and active dots through the resolved theme palette.
  • Preserve categorical series identity while cycling finite palettes safely for arbitrary KPI counts.
  • Keep graph data, requests, and chart interaction behavior unchanged; this layer only updates presentation.

Tests:

Use cases covered

  • Data Insights colors are resolved again during an in-place light/dark theme switch.
  • Reusable line charts receive theme-aware grid, axis, and inactive legend colors.
  • KPI widgets and progress/status components receive theme-aware presentation colors.
  • KPI series palettes wrap safely when the number of results exceeds the palette length.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated:
    • useDataInsightChartColors.test.tsx
    • DataInsightChartUtils.test.tsx
    • DataInsightProgressBar.test.tsx
    • KPILatestResultsV1.test.tsx
    • KPIChart.test.tsx
    • KPIWidget.test.tsx
  • Result: 21 focused tests passed across 6 suites.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable for this presentation-only slice; behavior is covered by focused component and hook tests.

Manual testing performed

  1. Switched the theme in the hook harness and verified computed chart colors update without remounting graph data.
  2. Ran the exact UI checkstyle sequence on all 18 changed TypeScript files (0 errors).
  3. Ran the design-token audit report and confirmed the changed Data Insights LESS file has no findings.

UI screen recording / screenshots:

To be added during review after validating against a local Data Insights dataset.

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: not applicable; no schema changes.
  • 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.

Improvement

  • I have added tests around the new logic.
  • For connector/ingestion changes: not applicable.

@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 Sep 3, 2026
@shah-harshit shah-harshit self-assigned this Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 69%
69.8% (91940/131705) 54.46% (57100/104840) 55.94% (17486/31258)

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 12e19467fa66235243ddf678bcda71807035091c in Playwright run 33772080193, attempt 1.

✅ 601 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 0 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) 51m 41s

⏱️ Max setup 3m 58s · max shard execution 16m 8s · max shard-job elapsed before upload 19m 54s · reporting 6s

🌐 249.62 requests/attempt · 2.89 app boots/UI scenario · 35.02% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 35.02% (convergence target: at most 15%).
  • Browser traffic was 249.62 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.89 per UI scenario (1818 boots / 630 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 111 0 0 0 0 0
🟡 Shard chromium-02 113 0 1 0 0 0
✅ Shard chromium-03 111 0 0 0 0 0
🟡 Shard chromium-04 108 0 1 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 2 flaky test(s) (passed on retry)
  • Flow/CustomizeWidgets.spec.ts › KPI Widget (shard chromium-02, 1 retry)
  • Pages/Entity.spec.ts › Update description (shard chromium-04, 1 retry)

📦 Download artifacts

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

Ant Design colors Typography.Title via `h5.ant-typography` (specificity
0,0,1,1), which beat the bare `.custom-data-insight-tooltip-title` rule
(0,0,1,0), leaving the Data Insights tooltip title black in dark mode.
Prefix the selector with `.ant-typography` to win specificity.

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

gitar-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Adds theme-aware colors to Data Insights and KPI charts, resolving registered --om-color-* tokens and refreshing them when the active theme changes. The hook and chart components now route through the resolved palette while preserving graph data and interaction behavior. Comprehensive unit tests cover theme switching, palette cycling for arbitrary KPI counts, and color resolution across reusable components. 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 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-09-04T05:11:15Z)

The entry left the queue before it was built, so no checks ran against it.

@shah-harshit
shah-harshit added this pull request to the merge queue Sep 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-05T01:31:29Z)

Blocked the queue: playwright-summary

@ShaileshParmar11
ShaileshParmar11 added this pull request to the merge queue Sep 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-05T11:14:04Z)

Blocked the queue: playwright-summary

@shah-harshit
shah-harshit added this pull request to the merge queue Sep 5, 2026

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.

2 participants