Skip to content

[frontend] Fix logo not following user's selected theme (#14435)#14689

Merged
SamuelHassine merged 2 commits intomasterfrom
claude/fix-logo-loading-issue
Mar 6, 2026
Merged

[frontend] Fix logo not following user's selected theme (#14435)#14689
SamuelHassine merged 2 commits intomasterfrom
claude/fix-logo-loading-issue

Conversation

@Claude
Copy link
Contributor

@Claude Claude AI commented Mar 1, 2026

When users configure different logos for dark and light themes and select a theme in their profile settings, the displayed logo follows the platform default theme instead of the user's selected theme.

Root Cause

The LeftBar component queries platform_theme directly from GraphQL and uses its logos, bypassing the theme resolution system that determines the user's active theme.

Changes

LeftBar.jsx

  • Remove GraphQL query for platform_theme.theme_logo and platform_theme.theme_logo_collapsed
  • Use theme.logo and theme.logo_collapsed from the MUI theme object, which already contains logos from the user's active theme via the useActiveThemeAppThemeProviderThemeDark/ThemeLight flow
// Before: queries platform default theme
const platformTheme = data.settings?.platform_theme;
const navOpenLogo = platformTheme?.theme_logo || (draftContext ? LogoTextOrange : theme.logo);

// After: uses active theme from MUI context
const navOpenLogo = draftContext ? LogoTextOrange : theme.logo;

The theme object is already populated with the correct logos based on user preference in Root.tsxuseActiveThemeAppThemeProvider, so LeftBar should use it directly rather than re-querying platform settings.

Original prompt

This section details on the original issue you should resolve

<issue_title>Platform Theme Not Loading Correct Logo</issue_title>
<issue_description>## Description
When a platform logo is configured for both the dark and light themes, the logo displayed does not follow the user’s selected theme.

If the platform default theme is set to dark, and a user selects the light theme in their profile settings, the system still loads the logo configured for the dark theme instead of the light theme logo.

The same issue occurs in reverse. If the platform default theme is set to light, and the user selects the dark theme in their profile settings, the system loads the logo configured for the light theme instead of the dark theme logo.

The logo appears to follow the platform default theme rather than the user’s selected theme.

Environment

6.9.17

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Add a logo URL to the dark and light themes, ensuring they are different.
  2. Set the default theme to dark or light
  3. Set the default theme under the user's profile to the opposite of the default theme.
  4. Observe the wrong logo is loaded

Expected Output

The correct logo is loaded depending on the theme selected by the user.

Actual Output

Regardless of the theme chosen, the logo set in the Default theme is loaded.
</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@SamuelHassine ## Copilot Fix Instructions

Problem: The platform logo displayed always follows the platform default theme instead of the user's selected theme. If the default is dark and the user picks light, they still see the dark theme logo.

Root cause: The logo URL is being read from the platform's default theme configuration rather than from the user's active/selected theme.

Key files to investigate:

  • opencti-platform/opencti-front/src/public/components/login/LoginLogo.tsx — login page logo
  • opencti-platform/opencti-front/src/private/components/nav/LeftBarHeader.tsx — main nav logo
  • opencti-platform/opencti-front/src/private/components/nav/LeftBar.jsx — sidebar
  • opencti-platform/opencti-front/src/private/components/settings/Settings.tsx — settings/config

Fix approach:

  1. In the components that render the logo, find where the logo URL is resolved. It likely reads from a settings/config object that contains platform_theme_dark_logo and platform_theme_light_logo (or similar).
  2. The bug is that the code selects which logo to display based on the platform default theme setting rather than the current user's active theme (available via useTheme() or a theme context).
  3. Fix: use the user's current theme mode (dark/light) from the theme context/hook to determine which logo URL to display, not the platform default.
  4. Check both the login page logo component and the main app navigation logo component — both likely have the same bug.

Expected change: Where the logo URL is selected, replace the platform default theme check with the user's active theme mode. Something like: const logo = theme.palette.mode === 'dark' ? settings.platform_theme_dark_logo : settings.platform_theme_light_logo;

@copilot</comment_new>

@Claude Claude AI changed the title [WIP] Fix platform logo loading for selected theme Fix logo not following user's selected theme Mar 1, 2026
@SamuelHassine SamuelHassine requested a review from esrevi March 1, 2026 06:12
@SamuelHassine SamuelHassine marked this pull request as ready for review March 1, 2026 06:12
@SamuelHassine SamuelHassine changed the title Fix logo not following user's selected theme [frontend] Fix logo not following user's selected theme (#14435) Mar 1, 2026
@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Thank you for your contribution, but we need you to sign your commits. Please see https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

1 similar comment
@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Thank you for your contribution, but we need you to sign your commits. Please see https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.37%. Comparing base (1e2dad1) to head (fdd3df1).
⚠️ Report is 39 commits behind head on master.

Files with missing lines Patch % Lines
...encti-front/src/private/components/nav/LeftBar.jsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #14689   +/-   ##
=======================================
  Coverage   32.37%   32.37%           
=======================================
  Files        3098     3098           
  Lines      211019   211018    -1     
  Branches    38241    38241           
=======================================
  Hits        68310    68310           
+ Misses     142709   142708    -1     
Flag Coverage Δ
opencti-client-python 45.48% <ø> (ø)
opencti-front 2.83% <0.00%> (+<0.01%) ⬆️
opencti-graphql 67.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SamuelHassine SamuelHassine force-pushed the claude/fix-logo-loading-issue branch from 97ff62b to 651d1d3 Compare March 2, 2026 11:49
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Please attach at least one issue to your Pull Request

2 similar comments
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Please attach at least one issue to your Pull Request

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Please attach at least one issue to your Pull Request

Claude AI and others added 2 commits March 2, 2026 09:48
Co-authored-by: SamuelHassine <1334279+SamuelHassine@users.noreply.github.com>
@SamuelHassine SamuelHassine force-pushed the claude/fix-logo-loading-issue branch from 651d1d3 to fdd3df1 Compare March 2, 2026 14:48
@Archidoit
Copy link
Member

Working well :)

@SamuelHassine SamuelHassine merged commit 7ec3bc0 into master Mar 6, 2026
36 checks passed
@SamuelHassine SamuelHassine deleted the claude/fix-logo-loading-issue branch March 6, 2026 10:32
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.

Platform Theme Not Loading Correct Logo

3 participants