fix(ui): update favicon dynamically based on app theme#4225
Open
GuillaumeLecomte1 wants to merge 3 commits intoDokploy:canaryfrom
Open
fix(ui): update favicon dynamically based on app theme#4225GuillaumeLecomte1 wants to merge 3 commits intoDokploy:canaryfrom
GuillaumeLecomte1 wants to merge 3 commits intoDokploy:canaryfrom
Conversation
Add icon-light.svg and icon-dark.svg with fixed fills (black/white) instead of relying on CSS prefers-color-scheme media query. Update WhitelabelingProvider to use useTheme() and switch favicon based on resolvedTheme (dark/light/unknown). When custom faviconUrl is set, it takes precedence. Closes Dokploy#4100.
The previous implementation returned null when config was not yet loaded, preventing the theme-aware favicon from rendering during initial page load. Now uses optional chaining (config?.metaTitle, config?.customCss) throughout so the <link rel="icon"> always renders with the correct theme-aware favicon regardless of config loading state. Fixes P1 issue from code review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The favicon did not switch between light and dark variants when toggling the app theme because it relied on OS prefers-color-scheme media query instead of the app-level theme state.
Changes
New files:
Modified:
Closes #4100
Greptile Summary
This PR fixes favicon theming by adding
icon-dark.svgandicon-light.svgvariants and usingresolvedThemefromnext-themesto select the correct one at the app level, rather than relying on the OSprefers-color-schememedia query. The early-return guard was also removed so the theme-aware<link rel="icon">renders immediately on page load.Confidence Score: 5/5
Safe to merge — the implementation is correct and all edge cases are handled.
The changes are well-implemented. The ternary correctly handles the undefined pre-hydration state by falling back to the existing icon. Custom faviconUrl takes precedence. The key prop prevents duplicate link elements. SVG fills are correct for each theme variant.
No files require special attention.
Reviews (2): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile