Skip to content

Fixes 6035: Make knowledge graph 3D theme-aware - #32482

Merged
shah-harshit merged 4 commits into
mainfrom
issue-6035-knowledge-graph-3d-theme
Sep 6, 2026
Merged

shah-harshit merged 4 commits into
mainfrom
issue-6035-knowledge-graph-3d-theme

Conversation

@shah-harshit

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

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #6035

This stacked PR makes the Knowledge Graph 3D experience theme-aware. It resolves canvas and WebGL colors from semantic tokens, rebuilds theme-sensitive presentation in place when the active theme changes, and updates the surrounding stage, legend, panels, labels, badges, and controls for light and dark themes.

Depends on #32439. The base branch will be changed to main after the parent PRs merge.

Screen.Recording.2026-09-02.at.7.44.54.PM.mov

Type of change:

  • Improvement

High-level design:

  • Keep categorical entity hues as token references with concrete fallbacks, then resolve them only at canvas/WebGL paint boundaries.
  • Treat the active theme as a presentation invalidation key for ForceGraph accessors. Cached textures are disposed once before the first object is rebuilt for the new theme.
  • Refresh the renderer without replacing graph data, reheating the simulation, fitting the graph, or changing the camera.
  • Replace dark-only stage and panel styling with semantic background, border, and text tokens.
  • Keep Data Insights, shared global color constants, and Collate changes outside this PR.

There are no data-model, API, migration, or backward-compatibility changes.

Tests:

Use cases covered

  • Canvas colors resolve current light and dark token values with concrete fallbacks.
  • A theme switch invalidates cached textures and rebuilds themed node/link presentation.
  • Theme switching preserves the graph-data reference and does not reset simulation or camera state.
  • Existing Knowledge Graph 3D rendering, interaction, ontology, and adapter behavior remains covered.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated: nodeCanvas.test.ts, KnowledgeGraph3DScene.test.tsx, KnowledgeGraph3D.test.tsx
  • Verification: yarn test src/components/KnowledgeGraph3D --runInBand --watchAll=false (6 suites, 107 tests passed)

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not added; the theme-transition behavior is covered at the ForceGraph integration boundary in the component test.

Manual testing performed

  1. Open an entity Knowledge Graph and switch to the 3D view.
  2. Toggle between light and dark themes.
  3. Verify node textures, links, labels, legend, detail panels, badges, and controls update immediately.
  4. Verify the current camera position and graph layout remain unchanged during the theme switch.

UI screen recording / screenshots:

To be attached during review.

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; this PR has 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.

@github-actions

github-actions Bot commented Sep 2, 2026

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.

@shah-harshit shah-harshit added UI UI specific issues skip-pr-checks Bypass PR metadata validation check labels Sep 2, 2026
@shah-harshit shah-harshit self-assigned this Sep 2, 2026
@shah-harshit shah-harshit added the safe to test Add this label to run secure Github workflows on PRs label Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 5777f7f5d7dcb2589fb6104f54e58091b25f6e17 in Playwright run 33952919970, attempt 1.

✅ 557 passed · ❌ 0 failed · 🟡 0 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) 46m 51s

⏱️ Max setup 4m 33s · max shard execution 16m 47s · max shard-job elapsed before upload 19m 53s · reporting 5s

🌐 235.83 requests/attempt · 2.82 app boots/UI scenario · 21.75% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 21.75% (convergence target: at most 15%).
  • Browser traffic was 235.83 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.82 per UI scenario (1630 boots / 578 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 138 0 0 0 0 0
✅ Shard chromium-02 121 0 0 0 0 0
✅ Shard chromium-03 140 0 0 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

📦 Download artifacts

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

@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 69%
69.86% (92253/132043) 54.55% (57253/104942) 55.84% (17404/31166)

chirag-madlani
chirag-madlani previously approved these changes Sep 3, 2026
@shah-harshit
shah-harshit added this pull request to the merge queue Sep 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-04T00:54:55Z)

Blocked the queue: playwright-summary

@shah-harshit
shah-harshit added this pull request to the merge queue Sep 4, 2026
@pmbrull
pmbrull removed this pull request from the merge queue due to a manual request Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

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 a conflict with the base branch Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

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

@gitar-bot

gitar-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Makes the Knowledge Graph 3D experience theme-aware by resolving canvas and WebGL colors from semantic tokens and rebuilding presentation when the active theme changes. Stage, legend, panels, labels, badges, and controls now update for light and dark themes without resetting graph data or camera state. The colorChannels utility now handles non-rgb/6-hex colors correctly instead of silently yielding black. No issues found.

✅ 1 resolved
✅ Edge Case: colorChannels silently yields black for non-rgb/6-hex colors

📄 openmetadata-ui/src/main/resources/ui/src/components/KnowledgeGraph3D/nodeCanvas.ts:52-66
colorChannels only parses rgb(...)/rgba(...) or exactly-6-digit hex; any other resolved form returns null, which hexRgba and lighten coerce to [0,0,0] (black). resolveCssColor can legitimately return other notations (isResolvedColor accepts hsl, hwb, lab, lch, oklab, oklch, color, and 3-digit hex like #fff) via the variableColor fallback path when the probe cascade fails. In that case link colors, lightened highlights, and icon/avatar foregrounds silently paint black instead of the theme color. In real browsers the primary cascade path normalizes to rgb(), so this is low-likelihood, but a token authored as #fff or oklch(...) would trip it. Consider having colorChannels handle 3-digit hex and returning the concrete fallback rather than defaulting to black.

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 5, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-05T14:07:48Z)

Blocked the queue: playwright-summary

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-05T22:02:35Z)

Blocked the queue: playwright-summary

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.

3 participants