Skip to content

fix: use local manager logos#31

Open
piwel wants to merge 2 commits into
evolution-foundation:mainfrom
piwel:codex/local-manager-logos
Open

fix: use local manager logos#31
piwel wants to merge 2 commits into
evolution-foundation:mainfrom
piwel:codex/local-manager-logos

Conversation

@piwel

@piwel piwel commented Jul 2, 2026

Copy link
Copy Markdown

Pull Request

📋 Description

Fixes Evolution Manager branding assets by replacing broken remote Evolution logo/favicon URLs with local SVG files.

What changed:

  • Replaces https://evolution-api.com/files/evo/*.svg logo references with bundled local SVG assets.
  • Uses a resolved theme value so the correct logo is selected when the app theme is system and the OS is dark.
  • Points the favicon at a local SVG instead of the previous remote URL.
  • Centralizes logo paths in src/lib/brand.ts.

🔗 Related Issues

No related issue found.

🧪 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Style/UI changes
  • ♻️ Code refactoring (no functional changes)
  • ⚡ Performance improvements
  • 🔧 Build/CI changes
  • 🧪 Tests

🧪 Testing

Test Environment

  • Local development
  • Staging environment
  • Production-like environment

Test Cases

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Cross-browser testing (if applicable)
  • Mobile testing (if applicable)

Test Instructions

  1. Run npm run build.
  2. Open the manager UI.
  3. Verify the logo and favicon are loaded from local /assets/images/*.svg paths.
  4. Toggle light, dark, and system theme modes and verify the logo follows the resolved theme.

Validation performed:

  • npm_config_cache=/private/tmp/npm-cache-evolution-manager npm run build

📸 Screenshots

Not included.

✅ Checklist

Code Quality

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have run npm run lint and fixed any issues

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested the changes in multiple browsers (if applicable)
  • I have tested the changes on mobile devices (if applicable)

Documentation

  • I have made corresponding changes to the documentation
  • I have updated the README.md if necessary
  • I have added/updated JSDoc comments for new functions
  • I have updated type definitions if necessary

Internationalization

  • I have added translations for new text strings
  • I have tested the changes in different languages (if applicable)

Breaking Changes

  • This PR introduces breaking changes
  • I have documented the breaking changes in the description
  • I have updated the migration guide (if applicable)

🔄 Migration Guide

Not applicable.

📝 Additional Notes

The resolved theme value keeps the logo selection correct when the selected theme is system; it also listens for OS color scheme changes.

🤝 Reviewer Guidelines

Focus Areas

  • Code logic and correctness
  • Performance implications
  • Security considerations
  • User experience
  • Accessibility
  • Browser compatibility

Testing Checklist for Reviewers

  • Pull and test the branch locally
  • Verify the fix/feature works as described
  • Check for edge cases
  • Verify no regressions in existing functionality

@sourcery-ai

sourcery-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

Replaces external Evolution logo and favicon URLs with local SVG assets, centralizes brand logo paths, and introduces a resolved theme concept so dark/light logos react correctly to system theme changes.

Sequence diagram for logo selection based on resolved theme

sequenceDiagram
  participant Browser
  participant ThemeProvider
  participant DocumentRoot as documentElement
  participant Login
  participant brand

  Browser->>ThemeProvider: load ThemeProvider
  ThemeProvider->>ThemeProvider: useState(theme, resolvedTheme)
  ThemeProvider->>DocumentRoot: remove light,dark classes
  alt theme is system
    ThemeProvider->>Browser: window.matchMedia("(prefers-color-scheme: dark)")
    Browser-->>ThemeProvider: mediaQuery
    ThemeProvider->>ThemeProvider: applySystemTheme()
    ThemeProvider->>DocumentRoot: add dark or light class
    ThemeProvider->>ThemeProvider: setResolvedTheme(systemTheme)
    Browser-->>ThemeProvider: mediaQuery change events
    ThemeProvider->>ThemeProvider: applySystemTheme() on change
  else theme is explicit
    ThemeProvider->>DocumentRoot: add theme class
    ThemeProvider->>ThemeProvider: setResolvedTheme(theme)
  end

  Browser->>Login: render Login
  Login->>ThemeProvider: useTheme()
  ThemeProvider-->>Login: { resolvedTheme }
  Login->>brand: EVOLUTION_LOGO_DARK_URL or EVOLUTION_LOGO_LIGHT_URL
  brand-->>Login: logoSrc
  Login->>Browser: render img src=logoSrc
Loading

File-Level Changes

Change Details Files
Track and expose a resolved light/dark theme separate from the stored theme, including reacting to system theme changes.
  • Add a ResolvedTheme type and resolvedTheme field to ThemeProvider state and context.
  • Introduce local state to track resolvedTheme with an initial light value.
  • When theme is set to system, derive the actual theme from prefers-color-scheme, update DOM classes accordingly, and keep resolvedTheme in sync.
  • Attach a change listener on the prefers-color-scheme media query to update resolvedTheme when the system theme changes, and clean it up on unmount.
  • When theme is explicitly light or dark, update both DOM classes and resolvedTheme.
src/components/theme-provider.tsx
Switch all logo usages to local SVG assets keyed off the resolved theme and centralize their URLs in a brand module.
  • Create a new brand module exporting constants for light and dark Evolution logo URLs pointing at local assets.
  • Update Login, LicenseCallback, Sidebar, and Home components to consume resolvedTheme from the theme provider instead of theme for logo selection.
  • Replace hard-coded external logo URLs in these components with EVOLUTION_LOGO_LIGHT_URL and EVOLUTION_LOGO_DARK_URL.
  • In Home, compute a single logoSrc based on resolvedTheme and reuse it for both header and hero logos.
src/lib/brand.ts
src/pages/Login/index.tsx
src/pages/Login/LicenseCallback.tsx
src/components/sidebar.tsx
src/pages/Home.tsx
Point the favicon to a local SVG asset instead of the external URL and add the corresponding files.
  • Update the favicon tag in index.html to use a local SVG under /assets/images and correct MIME type image/svg+xml.
  • Add local SVG asset files for the favicon and for light and dark Evolution logos under public/assets/images.
index.html
public/assets/images/evolution-favicon.svg
public/assets/images/evolution-logo-dark.svg
public/assets/images/evolution-logo-light.svg

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@piwel piwel force-pushed the codex/local-manager-logos branch from f1bd003 to 1ffe2c4 Compare July 2, 2026 23:30
@piwel piwel force-pushed the codex/local-manager-logos branch from 1ffe2c4 to f358b57 Compare July 2, 2026 23:32
@piwel piwel marked this pull request as ready for review July 2, 2026 23:59

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new brand URLs are hardcoded as absolute /assets/... paths, which will break if the app is ever served from a non-root base path; consider using static imports or new URL(..., import.meta.url) (or import.meta.env.BASE_URL) so asset resolution respects the configured base URL.
  • The resolvedTheme state is initialized to 'light', so consumers will briefly see the light logo even if the system prefers dark until the effect runs; if that matters for UX, you could lazily derive the initial resolvedTheme from matchMedia when theme === 'system' (guarded for window availability).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new brand URLs are hardcoded as absolute `/assets/...` paths, which will break if the app is ever served from a non-root `base` path; consider using static imports or `new URL(..., import.meta.url)` (or `import.meta.env.BASE_URL`) so asset resolution respects the configured base URL.
- The `resolvedTheme` state is initialized to `'light'`, so consumers will briefly see the light logo even if the system prefers dark until the effect runs; if that matters for UX, you could lazily derive the initial `resolvedTheme` from `matchMedia` when `theme === 'system'` (guarded for `window` availability).

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@piwel

piwel commented Jul 3, 2026

Copy link
Copy Markdown
Author

Addressed in 3b9be4d:

  • Brand logo URLs now use import.meta.env.BASE_URL, and the favicon in index.html uses %BASE_URL%, so assets respect a non-root Vite base path.
  • resolvedTheme is lazily initialized from the stored theme and matchMedia when the theme is system, guarded for window availability, avoiding an initial light-logo flash for dark system users.

Validation: npm_config_cache=/private/tmp/npm-cache-evolution-manager npm run build.

@piwel

piwel commented Jul 3, 2026

Copy link
Copy Markdown
Author

Note for reviewers: I noticed after opening this PR that #30 already addresses the same broken branding asset issue. Sorry, I missed it earlier.

The overlap is intentional only in the problem being fixed: both PRs remove the dead evolution-api.com/files/evo/* logo/favicon URLs.

The main differences from #30 are:

  • fix: broken logo & favicon (assets point to dead evolution-api.com URLs) #30 is a smaller change that reuses the existing local PNG asset everywhere.
  • This PR adds local SVG assets for light logo, dark logo, and favicon.
  • This PR preserves different logo colors for light/dark themes, including when the app theme is set to system and the OS preference is dark.
  • This PR resolves asset URLs through Vite base-aware paths, so it should work under a configured non-root base path.

If maintainers prefer #30 as the base, I can close this PR or rework these differences into a follow-up.

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.

1 participant