Skip to content

fix(ui): dark-mode AI sidebar and CodeMirror editors - #33567

Merged
shah-harshit merged 12 commits into
mainfrom
6573-nav-selected-dark
Sep 18, 2026
Merged

shah-harshit merged 12 commits into
mainfrom
6573-nav-selected-dark

Conversation

@shah-harshit

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

Copy link
Copy Markdown
Contributor

Describe your changes:

Refs open-metadata/openmetadata-collate#6573 (sidebar/nav), open-metadata/openmetadata-collate#6580 (editors), open-metadata/openmetadata-collate#6577 (empty-state assets)
Gate contract: open-metadata/openmetadata-collate#6564

Combines three small, non-overlapping dark-mode fixes.

1. AI sidebar selected/active state (sidebar.less) — verified against the design recording (source of truth):

  • Active/pressed pill was a solid neutral gray-blue-900, one step from the gray-blue-950 panel → effectively invisible. Now the brand-tinted --om-color-interactive-selected (brand-500 @16%). Covers all 8 active/pressed surfaces.
  • Selected label/icon resolved to brand-200 (one step too pale); now brand-300 (#84caff), the recording's glyph-core color.
  • Rest nav/list icons dimmed to gray-600 (#61656c) to match the recording; quaternary (gray-400) read a step too bright.
  • All flip only in dark via --ask-* custom properties; light is frozen.

2. CodeMirror editors (code-mirror.less) — CodeMirror 5 ships a light theme, so editor surface, gutter, line numbers, cursor, selection, active-line, and syntax tokens stayed light in dark. Dark-scoped block maps chrome to semantic --om-* tokens and remaps the default syntax hues (keyword #708, string #a11, …) — which fail contrast on the dark surface — to light palette hues, nested under .dark-mode .CodeMirror so they outrank CM's defaults.

3. Empty-state / placeholder illustrations (28 SVGs) — no-data/empty/not-found illustrations shipped light-theme fills (grays, white "paper", dark indigo) that stayed light in dark mode. Neutral fills routed through currentColor or semantic --om text/border tokens (light values ≈ originals, so light unchanged); white paper → --om-color-bg-surface; brand-blue accents left intact. Geometry untouched; connector/company logos deliberately not changed (fixed-color brand exception).

Type of change:

  • Improvement

Checklist:

  • I have read the CONTRIBUTING document.
  • PR references the implementation tickets and Gate Zero contract.
  • No raw theme-sensitive colors added in component CSS (semantic tokens; light frozen).
  • No editor/nav API or interaction change; SVG geometry unchanged.

RetriggerConfidence Score: 5/5

The current pull request appears safe to merge, with no outstanding reportable findings.

Summary

This pull request improves dark-mode presentation for the AI sidebar and CodeMirror 5 editors.

  • Gives selected sidebar items a visible brand-tinted surface and updates active and rest-state foreground colors.
  • Applies dark surfaces, gutters, selection, cursor, active-line, and syntax-token colors to CodeMirror editors.
  • Keeps the changes scoped to dark mode while preserving existing light-mode behavior.

Reviews (10) · Last reviewed commit: "Merge branch 'main' into 6573-nav-select..."

The active sidebar nav item used raw palette steps that never dark-flip:
@ask-bg-active = gray-blue-100 and @ask-brand-active = brand-800. In dark mode
the selected item rendered a near-white (#eaecf5) pill with dark-blue text —
verified on devrel.getcollate.io/ai-dashboards. Point these deferred (#6564)
roles at semantic tokens that adapt: interactive-selected (brand @16% dark /
brand-50 light) for the surface, link (brand-300 dark / brand-600 light) for the
icon/label, and bg-brand for the brand badge. Light mode stays brand-tinted.

Refs open-metadata/openmetadata-collate#6573 open-metadata/openmetadata-collate#6564

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Sep 18, 2026
@shah-harshit shah-harshit self-assigned this Sep 18, 2026
@shah-harshit shah-harshit added the skip-pr-checks Bypass PR metadata validation check label Sep 18, 2026
@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.

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.9% (102378/140434) 57.88% (62343/107698) 58.92% (20367/34565)

…nction hold

Address review: point the selected/brand nav roles at the *utility* scale
(utility-gray-blue-100, utility-brand-800, utility-brand-50) instead of
interactive-selected/link/bg-brand. Utility colors derive from --color-brand-*,
so custom branding still applies; they keep their exact light values (light-freeze)
and flip in dark (gray-blue-900 / brand-200 / brand-950). Selected surface stays
neutral gray-blue while the count badge stays brand, so they remain distinct in
both themes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The selected/pressed sidebar surface used a solid neutral gray-blue-900 in
dark, which is one palette step from the gray-blue-950 panel and is therefore
effectively invisible. The design recording shows a blue-tinted pill
(brand-500 @16%) in dark while keeping a neutral gray-blue-100 pill in light.

Route @ask-bg-active through a new --ask-selected-surface custom property that
.dark-mode flips to --om-color-interactive-selected (brand-500 @16%); light
leaves it unset and falls back to gray-blue-100, so light mode is unchanged.
This fixes all eight active/pressed surfaces at once.

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

Copy link
Copy Markdown
Contributor Author

Corrected the dark selected-pill against the design recording (source of truth).

Earlier this PR used a neutral gray-blue-900 pill in dark. Verified against the recording that this is wrong on two counts:

  1. gray-blue-900 (#101323) sits one step from the gray-blue-950 panel (#0d0f1c) → the pill is effectively invisible.
  2. The recording's dark selected pill is brand-tinted — sampled #162436 ≈ brand-500 @16% over the panel.

Fix: @ask-bg-active now routes through --ask-selected-surface, which .dark-mode flips to --om-color-interactive-selected (= --alpha(theme(--color-brand-500)/16%) in dark). Light leaves it unset → gray-blue-100 fallback, so light is unchanged (recording light pill sampled #e7e8f3 ≈ gray-blue-100). Covers all 8 active/pressed surfaces.

Note: the dark brand tint resolves at build time (theme(--color-brand-500)), so it does not track runtime custom branding — matching the recording was prioritized per the source-of-truth call. Label/icon stay on the branding-aware utility-brand-800 scale (dark brand-200 vs recording brand-300 — a minor shade, left as-is to keep light frozen).

Commit: f187de6

The active nav label and icon resolved to brand-200 in dark (utility-brand-800
dark step), one step paler than the design recording, which samples brand-300
(#84caff) at the glyph core. Route @ask-brand-active through --ask-selected-fg,
which .dark-mode sets to --color-brand-300; light stays on utility-brand-800
(brand-800), so light mode is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shah-harshit and others added 2 commits September 18, 2026 15:16
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>
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>
@shah-harshit shah-harshit changed the title fix(ui): flip the selected AI nav item to dark in dark mode fix(ui): dark-mode AI sidebar selected state + CodeMirror editors Sep 18, 2026
Rest (non-selected) nav/list icons used @ask-text-quaternary (gray-400),
which reads a step too bright on the dark surface; the design recording
samples ~gray-600. Route the four nav/list icon usages through @ask-icon-rest,
which .dark-mode flips to --color-gray-600; light keeps quaternary (frozen).
Scoped to icons only — chevrons, expand buttons, and headers keep quaternary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CodeMirror 5's default syntax hues (keyword #708, string #a11, number #164,
atom #219, …) are dark saturated colors for a light background and fail
contrast on the dark editor surface. Remap keyword/def/variable/number/string/
type/operator/error tokens to light palette hues, nested under
.dark-mode .CodeMirror so they outrank the default .cm-s-default rules. Light
editors keep the defaults (dark-scoped).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread openmetadata-ui/src/main/resources/ui/src/assets/svg/no-data-placeholder.svg Outdated
shah-harshit and others added 3 commits September 18, 2026 16:48
Switch sidebar.less and code-mirror.less from the app-level --om-color-*
aliases to the globals.css --color-* semantic tokens they resolve to
(--om-color-interactive-selected -> --color-bg-brand-primary,
--om-color-bg-secondary-hover -> --color-bg-secondary_hover, the rest 1:1).
Same computed values in both themes; no behavior change.

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 styles for the AI sidebar selected state, CodeMirror editors, and empty-state illustrations. All changes route through semantic tokens to preserve light mode and ensure proper contrast in dark mode—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

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