Skip to content

fix(ui): theme CodeMirror editors for dark mode - #33562

Closed
shah-harshit wants to merge 2 commits into
mainfrom
6580-dark-theme-editors
Closed

shah-harshit wants to merge 2 commits into
mainfrom
6580-dark-theme-editors

Conversation

@shah-harshit

@shah-harshit shah-harshit commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Refs open-metadata/openmetadata-collate#6580
Gate contract: open-metadata/openmetadata-collate#6564

CodeMirror 5 ships a light theme, so every editor — SchemaEditor, table query cards, JSON/manifest RJSF widgets, the ontology query console — kept a light editor surface, gutter, line numbers, cursor, selection, and active-line in dark mode.

Adds a dark-scoped block to the shared code-mirror.less mapping that chrome to semantic --om-* tokens (surface, canvas gutter, tertiary line numbers/fold markers, primary cursor, hover-bg selection, secondary active line). Appended last so it wins over the light .custom-code-mirror-theme, and covers all CodeMirror instances in one place.

Scope: syntax token hues are intentionally left intact (they read fine on the dark surface); only comments are lifted to the muted text tone for legibility. Pure CSS — no editor content, undo history, or focus is affected, and it flips live with the theme (CSS vars).

Type of change:

  • Improvement

Frontend Preview (Screenshots)

Toggle dark mode on any SQL/JSON editor: the editor surface, gutter, line numbers, cursor, and selection now follow the theme instead of staying light.

Checklist:

  • I have read the CONTRIBUTING document.
  • PR references the implementation ticket and Gate Zero contract.
  • No raw theme-sensitive colors added (all --om-* tokens).
  • No editor API or interaction change.

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the previously reported focused-selection issue fully addressed.

Summary

This PR adds shared dark-mode styling for CodeMirror editor chrome using semantic theme tokens.

  • Themes editor surfaces, gutters, line numbers, cursors, selections, active lines, and comments.
  • Adds a higher-specificity focused-selection selector so CodeMirror’s light default cannot override the dark selection color.

Reviews (2) · Last reviewed commit: "fix(ui): keep dark editor selection on f..."

CodeMirror ships a light theme, so every editor (SchemaEditor, table query
cards, JSON/manifest RJSF widgets, ontology query console) kept a light editor
surface, gutter, line numbers, cursor, selection, and active line in dark mode.
Add a dark-scoped block in the shared code-mirror.less mapping that chrome to
semantic --om-* tokens; appended last so it wins over the light
`.custom-code-mirror-theme`. Covers all CodeMirror instances at once.

Syntax token hues are left intact (they read fine on the dark surface); only
comments are lifted to the muted text tone for legibility. No editor content,
undo history, or focus is touched (pure CSS).

Refs open-metadata/openmetadata-collate#6580

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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.

@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 18, 2026
@shah-harshit shah-harshit self-assigned this Sep 18, 2026
Comment thread openmetadata-ui/src/main/resources/ui/src/styles/components/code-mirror.less Outdated
CodeMirror's .CodeMirror-focused .CodeMirror-selected (light lavender) has equal
specificity and loads later, so it overrode the dark selection during editing.
Include the focused state so the dark selection color wins.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟢 Low risk

Adds dark-mode styling for CodeMirror editors across the application using semantic --om-* theme tokens for surface, gutter, line numbers, cursor, and selection. The styling applies globally and flips live with theme changes via CSS variables. 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

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.93% (102547/140603) 57.9% (62408/107770) 58.97% (20413/34613)

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit b48e38dd75c2a54ce5d1c452e56762673818a55b in Playwright run 35319607899, attempt 1.

✅ 4477 passed · ❌ 0 failed · 🟡 4 flaky · ⏭️ 1 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) 36m 52s

⏱️ Max setup 4m 15s · max shard execution 21m 16s · max shard-job elapsed before upload 24m 23s · reporting 16s

🌐 220.08 requests/attempt · 2.23 app boots/UI scenario · 39.97% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 39.97% (convergence target: at most 15%).
  • Browser traffic was 220.08 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.23 per UI scenario (10619 boots / 4762 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
✅ Shard chromium-01 138 0 0 0 0 0
✅ Shard chromium-02 170 0 0 0 0 0
🟡 Shard chromium-03 151 0 1 0 0 0
✅ Shard chromium-04 170 0 0 0 0 0
✅ Shard chromium-05 174 0 0 0 0 0
✅ Shard chromium-06 180 0 0 0 0 0
✅ Shard chromium-07 134 0 0 0 0 0
🟡 Shard chromium-08 134 0 1 0 0 0
✅ Shard chromium-09 154 0 0 0 0 0
✅ Shard chromium-10 156 0 0 0 0 0
✅ Shard chromium-11 181 0 0 1 0 0
✅ Shard chromium-12 193 0 0 0 0 0
✅ Shard chromium-13 189 0 0 0 0 0
✅ Shard chromium-14 165 0 0 0 0 0
🟡 Shard chromium-15 194 0 1 0 0 0
🟡 Shard chromium-16 177 0 1 0 0 0
✅ Shard chromium-17 163 0 0 0 0 0
✅ Shard chromium-18 147 0 0 0 0 0
✅ Shard chromium-19 154 0 0 0 0 0
✅ Shard chromium-20 152 0 0 0 0 0
✅ Shard chromium-21 150 0 0 0 0 0
✅ Shard chromium-22 163 0 0 0 0 0
✅ Shard chromium-23 157 0 0 0 0 0
✅ Shard chromium-24 169 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 import-export-01 114 0 0 0 0 0
✅ Shard import-export-02 36 0 0 0 0 0
✅ Shard ingestion-01 43 0 0 0 0 0
✅ Shard ingestion-02 55 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 4 flaky test(s) (passed on retry)
  • Pages/ExploreBrowse.spec.tsTags leaf under Governance filters the results (shard chromium-03, 1 retry)
  • Pages/DataContractsSemanticRules.spec.tsValidate Description Rule Is_Set (shard chromium-08, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.tsShould remove user owner for knowledgeCenter (shard chromium-15, 1 retry)
  • Features/Glossary/LargeGlossaryPerformance.spec.tsshould search and filter glossary terms (shard chromium-16, 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

@shah-harshit

Copy link
Copy Markdown
Contributor Author

Combined into #33567 — the CodeMirror editor commits (5e045db, b48e38d) were cherry-picked there so the sidebar + editor dark-mode fixes ship as one small PR. Closing this in favor of #33567.

auto-merge was automatically disabled September 18, 2026 09:47

Pull request was closed

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.

1 participant