Skip to content

Fixes open-metadata/openmetadata-collate#8792: Dark-mode logo and monogram support in Platform Settings > Theme - #38435

Merged
Rohit0301 merged 8 commits into
mainfrom
Rohit0301/dark-mode-icon-support
Nov 23, 2026
Merged

Rohit0301 merged 8 commits into
mainfrom
Rohit0301/dark-mode-icon-support

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#8792

Admins could set one logo and monogram URL, so a dark-ink logo disappeared on dark surfaces. This PR adds optional dark-mode logo and monogram URLs in Platform Settings → Theme (new settings modal) and renders the right variant everywhere the brand logo appears, based on the user's active theme.

  • Schema: logoConfiguration.json gains optional customLogoDarkUrlPath and customMonogramDarkUrlPath. No migration: both fields are optional and absent means "use the light URL".
  • Rendering (BrandImage): uses the dark URL only when the dark theme is active and a dark URL is set; otherwise the light URL, then the brand default. Classic mode is light-only, so it never changes there.
  • Signed-out pages (sign-in, register, forgot/reset password) render without ThemeProvider but are dark when the #theme-restore boot script applied dark-mode; useResolvedTheme() reads that root class (same as LoginClassBase), so these pages show the dark logo in dark mode.
  • AI shell sidebar (SidebarBrand) previously ignored custom logos and always showed the build's mark. It now shows the admin's custom logo/monogram when one applies to the active theme (still the build's sidebar mark otherwise). This is the only signed-in surface with a dark theme, so without it the dark variant would never be visible after sign-in.
  • Theme view/edit rebuilt to the design: Light/Dark captions above fixed-size preview tiles (Browser tab for the favicon), "+ Add a dark mode version" with a removable "Dark mode logo/monogram URL" field, live errors for malformed URLs ("Enter a full URL starting with https://") and URLs that don't load as images, a "Checking image…" state, Save disabled while a URL edited in this session is invalid, checking or failing to load (a saved logo that no longer loads never blocks an unrelated change), and a best-effort "This logo is hard to see in dark mode." warning (WCAG contrast of the image's visible pixels against the dark tile; needs CORS on the image host, skipped otherwise).
  • Classic Appearance settings page: no UI change. Its save now spreads the existing customLogoConfig first, so it no longer wipes the dark URLs set in the new modal (its Reset still clears everything).
  • Collate counterpart: open-metadata/openmetadata-collate#8858 removes Collate's copy of CustomLogoConfiguration.md so it serves these docs (no other Collate change needed).

Type of change:

  • New feature

High-level design:

  • Data: two optional string fields on LogoConfiguration; TS types regenerated (logoConfiguration.ts, uiThemePreference.ts). Java POJOs are generated at build.
  • Theme resolution: useResolvedTheme() (theme-provider.tsx) returns the provider's theme, or the root dark-mode class when no provider is mounted. BrandImage picks (isDark && darkUrl) || lightUrl || default. All existing BrandImage call sites (both sidebars, sign-in, register, forgot/reset password, both app-install screens) get theme-awareness with no call-site changes.
  • Settings UI (components/discovery/personal-space/Profile/tabs/platform-settings/):
    • ThemeSettings.utils.ts: LOGO_URL_FIELDS describes each field and its optional dark variant; form ↔ config mapping includes the dark keys, so Save and Reset handle them. isHardToSeeOnDark() is a pure contrast function.
    • useImageCheck.ts: debounced (400 ms) per-URL status idle | invalid | loading | loaded | error plus the contrast check.
    • LogoUrlField.tsx: one field group (captions, input, previews, message, dark variant). The form is passed explicitly because core HookForm provides its own react-hook-form context.
    • LogoPreview.tsx: light/dark tile. The dark tile scopes dark-mode so tokens resolve to the dark palette whatever the active theme; an empty URL previews the brand default.
  • Alternatives rejected: a theme prop on every BrandImage call site (more churn, easy to miss one); blocking Save only on submit-time validation (the design asks for live feedback).
  • Compatibility: with no dark URLs set, every surface renders exactly as before; deployments without custom logos keep the build's brand marks.

Tests:

Use cases covered

  • Dark theme with dark URLs set → dark logo/monogram in the AI sidebar (expanded and collapsed), signed-out pages and app-install screens.
  • Dark theme without dark URLs → light custom logo; nothing set → brand default.
  • Classic mode with a stored dark preference → stays light (no regression).
  • Theme edit: add/remove dark version, save/reset include the dark keys, malformed URL, non-image URL, checking state, Save disabled while blocked, hard-to-see warning.

Unit tests

  • Added/updated Jest tests:
    • BrandImage.test.tsx: dark/light selection and all fallbacks (19 tests).
    • theme-provider.test.tsx: useResolvedTheme with no provider (root class) and with a provider.
    • SidebarBrand.test.tsx: build mark when nothing is set, custom logo/monogram when set, dark-only logo used only in dark.
    • AppearanceConfigSettingsPage.test.tsx: classic save keeps the dark URLs.
    • ThemeSettings.test.tsx: dark previews, add/save/remove, live invalid/error messages blocking Save for an edited URL, a saved failing URL not blocking Save, hard-to-see warning.
    • ThemeSettings.utils.test.ts: round-trip incl. dark keys, Reset payload, http(s)-only URLs, isHardToSeeOnDark.
    • useImageCheck.test.ts: idle/invalid/loading/loaded/error.
  • Ran: npx jest src/components/discovery/personal-space/Profile src/components/platform/ai-shell src/components/common/BrandImage src/context/UntitledUIThemeProvider src/components/Sidebar src/components/MyData/LeftSidebar src/pages/LoginPage src/pages/ForgotPassword src/pages/ResetPassword src/pages/SignUp src/pages/AppInstall src/components/Settings/Applications → 222 suites, 1,934 tests passed (before the review-fix commit); after it, the touched suites re-ran: platform-settings, AppearanceConfigSettingsPage, ai-shell/Sidebar, UntitledUIThemeProvider → all passed (264 + 6 + Sidebar/theme suites).
  • Also: tsc --noEmit (only the existing unrelated error in OMSelectWidget.tsx), ESLint + Prettier on changed files clean, tw-audit no errors, yarn i18n produces no changes.
  • Coverage % not measured.

Backend integration tests

  • Not applicable (no backend API changes; two optional schema fields).
  • make java_affected ARGS="--scope focused" selected no tests. SystemResourceIT / ConfigResourceIT (which round-trip the theme preference) were not run locally; they run in the merge queue.
  • Manual backend check on a server built from this branch: PUT /api/v1/system/settings with both dark fields → 200, GET /api/v1/system/settings/customUiThemePreference returns them.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Updated playwright/e2e/Features/ProfilePlatformSettings.spec.ts → "theme: saves colours and logo, and Reset clears them": new invalid-URL copy with Save disabled, image URLs routed to a real SVG, and the add dark logo → save → Reset round trip. yarn lint:playwright passes (0 errors).
  • Not run locally; runs in the merge queue. CustomThemeConfig.spec.ts (classic page) is unaffected by UI changes.

Manual testing performed

  1. Built the backend from this branch (mvn -DskipTests install -pl openmetadata-service -am), ran migrations and OpenMetadataApplication against a fresh MySQL database and a separate ES index prefix; UI via vite dev server.
  2. Served demo assets over HTTP with CORS: logo.svg (orange mark, dark text), logo-dark.svg (white text), mark.svg (dark ink), mark-dark.svg (orange), favicon.svg, broken.pdf; plus a slow endpoint for the checking state.
  3. Saved light + dark URLs, then screenshotted every logo surface signed out and signed in, light and dark, in AI and classic mode; then the edit states; then all URLs cleared (defaults). Screenshots below.

UI screenshots:

Recording not attached (screenshots agreed instead).

Signed out (sign-in, register, forgot / reset password)

Dark-mode signed-out pages now show the dark monogram (previously they used the dark-ink light one).

signin Light Dark
signin light signin dark
signup Light Dark
signup light signup dark
forgot-password Light Dark
forgot-password light forgot-password dark
reset-password Light Dark
reset-password light reset-password dark

Signed in — AI mode sidebar (custom logo, light vs dark variant)

Sidebar expanded (logo) Light Dark
Sidebar expanded (logo) light Sidebar expanded (logo) dark
Sidebar collapsed (monogram) Light Dark
Sidebar collapsed (monogram) light Sidebar collapsed (monogram) dark

Settings → Platform Settings → Theme

View: custom logos saved Light Dark
View: custom logos saved light View: custom logos saved dark
Edit: dark versions set Light Dark
Edit: dark versions set light Edit: dark versions set dark
Edit: no dark version + hard-to-see warning Light Dark
Edit: no dark version + hard-to-see warning light Edit: no dark version + hard-to-see warning dark
Edit: invalid URL + image load error (Save disabled) Light Dark
Edit: invalid URL + image load error (Save disabled) light Edit: invalid URL + image load error (Save disabled) dark
Edit: checking image (Save disabled) Light Dark
Edit: checking image (Save disabled) light Edit: checking image (Save disabled) dark

App install (BrandImage monogram)

AI mode app install Light Dark
AI mode app install light AI mode app install dark

Classic mode (light-only; stored dark preference ignored — no regression)

Screen Light preference Dark preference
home-sidebar-expanded classic home-sidebar-expanded light pref classic home-sidebar-expanded dark pref
home-sidebar-collapsed classic home-sidebar-collapsed light pref classic home-sidebar-collapsed dark pref
app-install classic app-install light pref classic app-install dark pref
appearance-settings classic appearance-settings light pref classic appearance-settings dark pref

No custom logos (fallback to built-in brand marks)

Sign-in Light Dark
Sign-in light Sign-in dark
AI sidebar Light Dark
AI sidebar light AI sidebar dark
Theme view Light Dark
Theme view light Theme view dark
Theme edit Light Dark
Theme edit light Theme edit dark

Not captured: the favicon (browser tab chrome isn't visible in headless screenshots); it has no dark variant and its behaviour is unchanged.

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: I updated the migration scripts or explained why it is not needed. (Not needed: optional fields; absent = use light URL.)
  • For a UI feature or feature task: Docker build + recording — not done; screenshots from a locally built server instead (see above).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
    Reviewed 4c0bd75 (two passes). Pass 1 found two 🔴, both fixed in 4c0bd75: the Playwright theme test broken by the image check / Save blocking, and the classic page save dropping the dark URLs. Pass 2: no 🔴. Answered 🟡: (1) http: is accepted while the copy says https — kept to match the design copy without rejecting existing http logo URLs; (2) no IT asserts the two new keys round-trip — they are plain optional schema fields, verified manually against a server built from this branch (PUT → GET returns both).
  • Decision check: adds ADR:2026-11-23-dark-logo-variants-fall-back-to-the-light-url (dark-key fallback, merge-on-write for customLogoConfig, session-edited URLs block Save).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The latest changes appear safe to merge.

Summary

Adds optional dark-mode logos and monograms, theme-aware rendering, and live image checks in Theme settings. The latest changes raise the expanded sidebar logo and header to 40px.

  • Brand images show the dark version when the active theme is dark.
  • Theme settings let admins preview and check separate dark logo versions.
  • The AI sidebar uses configured logos when they match the active theme.
  • Classic Appearance saves keep dark logo URLs already set in Theme settings.

Reviews (12) · Last reviewed commit: "fix(ui): show the AI sidebar logo at the..." · Reviewed by Greptile

Add optional customLogoDarkUrlPath and customMonogramDarkUrlPath to the
logo configuration. BrandImage uses the dark variant only when the dark
theme is active and one is set, falling back to the light URL, then the
brand default; pre-auth pages read the theme the boot script applied.

The AI shell sidebar now shows an admin-set custom logo (it showed only
the build's mark), so the dark variant is visible after sign-in.

Rebuild the Theme view and edit form to the design: light/dark previews
with captions, an add/remove dark mode version field, live invalid-URL
and image-load errors that block saving, a checking state, and a
best-effort "hard to see in dark mode" warning.
- Only logo URLs edited in this session block Save, so a saved logo that
  no longer loads cannot hold up an unrelated theme change.
- The classic Appearance page keeps the dark-mode URLs when it saves.
- The AI sidebar resolves the custom logo for the active theme and keeps
  the build's sidebar mark when nothing applies.
- Update the Platform Settings Playwright theme flow for the new copy,
  the image check and the dark-logo round trip.
@Rohit0301
Rohit0301 requested a review from a team as a code owner November 23, 2026 06:39
@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.

Save no longer waits on the CORS image request used for the
hard-to-see-in-dark-mode warning; the warning arrives separately.
Replace the Moon01 glyph with the Moon SVG from the design.
…r prop

Add ADR:2026-11-23-dark-logo-variants-fall-back-to-the-light-url for the
fallback, merge-on-write and Save-blocking rules. Colour logo field
messages and captions through Typography's color prop.
…round

The sidebar wordmark (built-in or custom) fills the 32px header row
instead of 24px. The app-install connector line now stops either side
of the tick, so the tick needs no background to mask it.
The header row and wordmark grow from 32px to 40px, matching the 40px
BrandImage in the classic left sidebar.
@gitar-bot

gitar-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 2 closed / 2 findings

Adding optional dark-theme logo settings changes configuration and brand rendering across UI surfaces; incorrect theme selection could display an unsuitable logo.

Adds optional dark-mode logo and monogram URLs in Platform Settings > Theme, with theme-aware rendering across the AI sidebar, signed-out pages, and app-install screens. The new contract and fallback rule are now documented in a decision record, and Typography text colour now uses the color prop. No open issues remain.

✅ 2 closed
✅ Quality: New dark-logo schema contract and fallback rule are not recorded

📄 openmetadata-spec/src/main/resources/json/schema/configuration/logoConfiguration.json:13-16 📄 openmetadata-spec/src/main/resources/json/schema/configuration/logoConfiguration.json:25-28 📄 openmetadata-ui/src/main/resources/ui/src/components/common/BrandImage/BrandImage.tsx:53-58 📄 openmetadata-ui/src/main/resources/ui/src/pages/AppearanceConfigSettingsPage/AppearanceConfigSettingsPage.tsx:94-95 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/LogoUrlField.tsx:334-340
This PR adds two LogoConfiguration fields, customLogoDarkUrlPath and customMonogramDarkUrlPath. That is a JSON Schema contract that Collate and any other writer of customUiThemePreference must follow. Nothing in docs/decisions/ says how these keys behave. The description also states rules that exist only in prose: "BrandImage uses the dark URL only when the dark theme is active and a dark URL is set; otherwise it falls back to the light URL, then the brand default", "The classic Appearance page save spreads the existing customLogoConfig first so it does not wipe the dark URLs", and "a saved logo that no longer loads does not block unrelated changes". The repo squash-merges, so those rules never reach the tree. A record would say: "customLogoDarkUrlPath/customMonogramDarkUrlPath are optional dark-theme variants. A renderer uses one only when the resolved theme is dark and it is non-empty, otherwise the light key, then the build default. Every writer of customLogoConfig merges over the stored value rather than replacing it. Only logo URLs edited in the current session can block Save."

✅ Quality: Typography text colour set via className instead of the color prop

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/LogoUrlField.tsx:60-67 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/platform-settings/LogoUrlField.tsx:78-80
FieldMessage and Caption colour core Typography with className (tw:text-error-primary, tw:text-warning-primary, tw:text-tertiary). Core Typography already has a color prop with exact equivalents: danger, warning and secondary map to those same classes. The core-styling decision and the styling rules both say not to set text colour through className on core components. If core changes its colour mapping, these overrides will silently drift from it. Pass color and keep className for layout only.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@Rohit0301
Rohit0301 merged commit 8b18e8f into main Nov 23, 2026
59 of 64 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/dark-mode-icon-support branch November 23, 2026 12:12
@Rohit0301 Rohit0301 mentioned this pull request Nov 23, 2026
2 tasks done
Rohit0301 added a commit that referenced this pull request Nov 24, 2026
* fix(ui): align entity header badges with title actions (#38436)

The badges box was pinned to the top of the header row while the title
actions were centred against the 40px service logo, leaving the DQ alert
icon and status badge ~4px higher than the copy/learning icons. Render
badges in the same h-8 actions row instead.

(cherry picked from commit 7ccb672)

* Fixes #36069: Keep Browse Estate tree expanded to the remaining path after removing a browse chip (#38470)

* fix(ui): keep Browse Estate tree expanded to the remaining browse path after removing a chip

Removing a browse chip rebuilds the explore tree from its static roots and
re-keys every lazily loaded level, so the previous expansion was lost and the
tree collapsed to the service-type level. The tree now expands the loaded
ancestors of the active browsePath level by level, which also makes browse
deep links and reloads open at the browsed node.

Fixes #36069

* fix(ui): expand the category root holding the browse path on reload

Category roots carry no filterField, so a browse path outside the
default-expanded Databases root (e.g. a dashboard service) never had its root
opened on reload or deep link. Under a browse path each root's totalCount is
scoped to that path, so expand the roots with matches.

* fix(ui): expand category roots only once their counts match the browse path

Selecting a tree node changes browsePath before the root counts refresh, so
the stale unfiltered totals opened every populated category. Track the
browsePath the root counts were refreshed for and ignore root counts until
they match the current path.

(cherry picked from commit 6aeece9)

* Fixes open-metadata/openmetadata-collate#8792: Dark-mode logo and monogram support in Platform Settings > Theme (#38435)

* feat(ui): dark-mode logo and monogram in Platform Settings > Theme

Add optional customLogoDarkUrlPath and customMonogramDarkUrlPath to the
logo configuration. BrandImage uses the dark variant only when the dark
theme is active and one is set, falling back to the light URL, then the
brand default; pre-auth pages read the theme the boot script applied.

The AI shell sidebar now shows an admin-set custom logo (it showed only
the build's mark), so the dark variant is visible after sign-in.

Rebuild the Theme view and edit form to the design: light/dark previews
with captions, an add/remove dark mode version field, live invalid-URL
and image-load errors that block saving, a checking state, and a
best-effort "hard to see in dark mode" warning.

* fix(ui): address self-review of dark-mode logos

- Only logo URLs edited in this session block Save, so a saved logo that
  no longer loads cannot hold up an unrelated theme change.
- The classic Appearance page keeps the dark-mode URLs when it saves.
- The AI sidebar resolves the custom logo for the active theme and keeps
  the build's sidebar mark when nothing applies.
- Update the Platform Settings Playwright theme flow for the new copy,
  the image check and the dark-logo round trip.

* fix(ui): mark a logo URL loaded before the optional contrast check

Save no longer waits on the CORS image request used for the
hard-to-see-in-dark-mode warning; the warning arrives separately.

* chore(ui): use the design's Moon icon for the dark-mode preview captions

Replace the Moon01 glyph with the Moon SVG from the design.

* docs: record the dark-mode logo variant contract; use Typography color prop

Add ADR:2026-11-23-dark-logo-variants-fall-back-to-the-light-url for the
fallback, merge-on-write and Save-blocking rules. Colour logo field
messages and captions through Typography's color prop.

* style(ui): organize imports in LogoUrlField

* fix(ui): enlarge the AI sidebar logo; drop the app-install tick background

The sidebar wordmark (built-in or custom) fills the 32px header row
instead of 24px. The app-install connector line now stops either side
of the tick, so the tick needs no background to mask it.

* fix(ui): show the AI sidebar logo at the classic sidebar's 40px

The header row and wordmark grow from 32px to 40px, matching the 40px
BrandImage in the classic left sidebar.

(cherry picked from commit 8b18e8f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants