From 1f35a6d7096b54539eee180be52f8c3a66c407c6 Mon Sep 17 00:00:00 2001 From: ncoronel Date: Tue, 22 Sep 2026 10:02:53 -0300 Subject: [PATCH] feat(store-header): add fetchpriority and loading attributes to images for performance optimization --- src/app/app.spec.ts | 11 +++++- src/app/app.ts | 1 + .../immersive-store-header.component.html | 24 ++++++++++--- .../immersive-store-header.component.scss | 16 +++++++-- .../standard-store-header.component.html | 9 ++++- .../store-layout.component.spec.ts | 35 ++++++++++++++----- .../continuous-image-carousel.component.html | 2 ++ 7 files changed, 81 insertions(+), 17 deletions(-) diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts index ce72eea..1b15138 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.spec.ts @@ -90,6 +90,11 @@ describe('App', () => { expect( document.head.querySelector('link[rel~="icon"]')?.getAttribute('href'), ).toBe(tenant.favicon); + expect( + document.head + .querySelector('link[rel~="icon"]') + ?.getAttribute('fetchpriority'), + ).toBe('high'); }); it('renders the tenant not found screen when the tenant is missing', async () => { @@ -114,6 +119,10 @@ describe('App', () => { expect( document.head.querySelector('link[rel~="icon"]')?.getAttribute('href'), ).toBe("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E"); + expect( + document.head + .querySelector('link[rel~="icon"]') + ?.getAttribute('fetchpriority'), + ).toBe('high'); }); - }); diff --git a/src/app/app.ts b/src/app/app.ts index 268c29d..fcb49a6 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -78,6 +78,7 @@ export class App { } favicon.setAttribute('href', faviconHref); + favicon.setAttribute('fetchpriority', 'high'); }); } diff --git a/src/app/core/layout/store-layout/store-header/immersive-store-header.component.html b/src/app/core/layout/store-layout/store-header/immersive-store-header.component.html index f76de46..3904be6 100644 --- a/src/app/core/layout/store-layout/store-header/immersive-store-header.component.html +++ b/src/app/core/layout/store-layout/store-header/immersive-store-header.component.html @@ -1,8 +1,16 @@
-
+
+ @if (showHero() && backgroundImageUrl(); as backgroundImage) { + + } +