fix(ui): theme CodeMirror editors for dark mode - #33562
shah-harshit wants to merge 2 commits into
Conversation
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>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
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>
Code Review ✅ Approved🟢 Low risk Adds dark-mode styling for CodeMirror editors across the application using semantic OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
✅ Playwright Results — workflow succeededValidated commit ✅ 4477 passed · ❌ 0 failed · 🟡 4 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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:
🟡 4 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Pull request was closed



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.lessmapping 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:
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:
--om-*tokens).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.
Reviews (2) · Last reviewed commit: "fix(ui): keep dark editor selection on f..."