Skip to content

fix: show favicon on login/registration pages and update color to blue#1615

Merged
lyubov-voloshko merged 4 commits into
rocket-admin:mainfrom
karinakharchenko:favicon-fix
Feb 20, 2026
Merged

fix: show favicon on login/registration pages and update color to blue#1615
lyubov-voloshko merged 4 commits into
rocket-admin:mainfrom
karinakharchenko:favicon-fix

Conversation

@karinakharchenko

Copy link
Copy Markdown
Collaborator

Uncomment favicon links in index.html and index.saas.html so favicons display before authentication. Update favicon background from purple to blue (#2463EB). Simplify white-label favicon override in app component.

Uncomment favicon links in index.html and index.saas.html so favicons
display before authentication. Update favicon background from purple
to blue (#2463EB). Simplify white-label favicon override in app component.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@lyubov-voloshko lyubov-voloshko marked this pull request as ready for review February 20, 2026 13:34
Copilot AI review requested due to automatic review settings February 20, 2026 13:34
@lyubov-voloshko lyubov-voloshko merged commit f6bc012 into rocket-admin:main Feb 20, 2026
8 of 10 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enables the application favicon to display on unauthenticated routes (login/registration), updates the favicon background color to blue, and refactors favicon handling for white-label configurations.

Changes:

  • Updates favicon assets (SVG + adds ICO/PNG variants) and changes background color to #2463EB.
  • Adjusts index.html favicon <link> block (intended to make favicons visible pre-auth).
  • Refactors AppComponent to centralize default favicon insertion and simplify white-label favicon override.

Reviewed changes

Copilot reviewed 1 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/src/index.html Modifies favicon <link> block in the document <head>.
frontend/src/assets/favicon.svg Changes favicon background color from purple to blue.
frontend/src/assets/favicon.ico Adds default ICO favicon asset.
frontend/src/assets/favicon-32x32.png Adds 32x32 PNG favicon asset.
frontend/src/assets/favicon-16x16.png Adds 16x16 PNG favicon asset.
frontend/src/app/app.component.ts Adds setDefaultFavicon() and changes how default/white-label favicons are applied.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +388 to +408
private setDefaultFavicon() {
const faviconIco = document.createElement('link');
faviconIco.rel = 'icon';
faviconIco.type = 'image/x-icon';
faviconIco.href = 'assets/favicon.ico';

const favicon16 = document.createElement('link');
favicon16.rel = 'icon';
favicon16.type = 'image/png';
favicon16.setAttribute('sizes', '16x16');
favicon16.href = 'assets/favicon-16x16.png';

const favicon32 = document.createElement('link');
favicon32.rel = 'icon';
favicon32.type = 'image/png';
favicon32.setAttribute('sizes', '32x32');
favicon32.href = 'assets/favicon-32x32.png';

document.head.appendChild(faviconIco);
document.head.appendChild(favicon16);
document.head.appendChild(favicon32);

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

setDefaultFavicon() unconditionally appends three new icon elements each time it’s called, which can create duplicates (it’s called both in ngOnInit when no token and again when whiteLabelSettings.favicon is missing). Consider de-duping by removing existing favicon links first or by reusing/storing references (e.g., with ids) and updating hrefs instead of appending repeatedly.

Copilot uses AI. Check for mistakes.
Comment on lines 186 to 191
let expirationToken = localStorage.getItem('token_expiration');

if (!expirationToken) {
this.setUserLoggedIn(false);
this.setDefaultFavicon();
}

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

Calling setDefaultFavicon() only in ngOnInit when there is no token covers initial unauthenticated loads, but it won’t run again when a user logs out (AppComponent isn’t recreated). This can leave the previous white-label favicon visible on /login or /registration after logout. Consider also resetting the favicon in logOut()/logoutAndRedirectToRegistration() or on route transitions to auth pages.

Copilot uses AI. Check for mistakes.
Comment thread frontend/src/index.html
Comment on lines 9 to +11
<!--<link rel="icon" type="image/x-icon" href="assets/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png"> -->
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">-->

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

The favicon tags are still inside an HTML comment (opened at line 9). As written, browsers will ignore all three favicon links, so this change won’t actually “uncomment” them. Remove the surrounding (or move the comment markers so the tags are not commented) to ensure favicons load on the login/registration pages.

Copilot uses AI. Check for mistakes.
Comment thread frontend/src/index.html
Comment on lines 9 to +11
<!--<link rel="icon" type="image/x-icon" href="assets/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png"> -->
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">-->

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

PR description mentions uncommenting favicon links in both index.html and index.saas.html, but index.saas.html still has the favicon tags commented out. If SaaS builds use index.saas.html, favicons still won’t appear there; please apply the same change to index.saas.html (or update the PR description if it’s not needed).

Copilot uses AI. Check for mistakes.
Comment on lines +327 to +330
const newLink = document.createElement('link');
newLink.rel = 'icon';
newLink.href = whiteLabelSettings.favicon;
document.head.appendChild(newLink);

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

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

When a white-label favicon is present, this always appends a new without removing/updating existing icon links. That can leave multiple favicons in (including the defaults) and the chosen favicon may become browser-dependent. Prefer updating an existing icon link or clearing prior "link[rel~='icon']" entries before inserting the white-label favicon (and consider setting an appropriate type, e.g. image/png).

Suggested change
const newLink = document.createElement('link');
newLink.rel = 'icon';
newLink.href = whiteLabelSettings.favicon;
document.head.appendChild(newLink);
const head = document.head || document.getElementsByTagName('head')[0];
const existingIcons = head.querySelectorAll("link[rel~='icon']");
existingIcons.forEach((icon) => head.removeChild(icon));
const newLink = document.createElement('link');
newLink.rel = 'icon';
newLink.type = 'image/png';
newLink.href = whiteLabelSettings.favicon;
head.appendChild(newLink);

Copilot uses AI. Check for mistakes.
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.

4 participants