Skip to content

Conversation

@olexii4
Copy link
Contributor

@olexii4 olexii4 commented Jan 2, 2026

What does this PR do?

This PR fixes the branding logo loader performance issue by adding session storage caching for logo path and favicon. Previously, the loader made multiple 404 HTTP requests sequentially on every page load while detecting the correct image format, and the favicon update was delayed until the cluster config API responded.

Key Changes:

  1. Session Storage Caching - Added local constants branding-logo-path and branding-favicon in brandingLoader.ts for caching branding assets between page loads using direct window.sessionStorage access

  2. Parallel Logo Format Detection - All image formats (jpg, jpeg, png, gif, webp, svg) are checked in parallel using Promise.all. The first successful format (by priority order) is cached immediately

  3. Placeholder Favicon in HTML - Changed index.html to use a 1x1 transparent GIF placeholder instead of referencing favicon.ico. Removed the id attribute, now using link[rel="shortcut icon"] selector

  4. Favicon Preload Caching - Favicon is loaded from session storage cache immediately during the preload phase (in brandingLoader.ts) before React bootstrap starts

  5. updateFavicon Function - Exported from brandingLoader.ts, accepts DashboardFavicon | undefined:

    • If dashboardFavicon is provided, uses its base64data and mediatype
    • If undefined, fetches /dashboard/assets/branding/favicon.ico and converts to data URL
    • Caches the result in session storage and updates the DOM
  6. checkFavicon Method - Simplified in bootstrap/index.ts to call the imported updateFavicon function with the dashboard favicon from Redux state

Screenshot/screencast of this PR

What issues does this PR fix or reference?

fixes eclipse-che/che#23690

Is it tested? How?

Release Notes

Docs PR

Add BRANDING_LOGO_PATH and BRANDING_FAVICON keys to SessionStorageKey enum
for caching branding assets between page loads.

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@olexii4 olexii4 requested a review from svor January 2, 2026 22:35
@che-bot
Copy link
Contributor

che-bot commented Jan 2, 2026

Click here to review and test in web IDE: Contribute

Problem:
- Logo loader makes multiple 404 HEAD requests on every page load while
  detecting the correct image format (jpg, jpeg, png, gif, webp, svg)
- Favicon update is delayed until cluster config API responds

Solution:
- Cache detected logo format path in session storage to skip format
  detection on subsequent page loads
- Cache favicon in session storage and load it immediately during
  preload phase before React bootstrap starts
- Move favicon update logic from bootstrap to brandingLoader with
  exported updateFavicon function for bootstrap to cache new values

This eliminates redundant network requests and provides immediate
logo and favicon display on subsequent page loads within the same session.

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1438

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1438", name: che-dashboard}]}}]"

1 similar comment
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1438

kubectl patch command
kubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1438", name: che-dashboard}]}}]"

@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

❌ Patch coverage is 94.57831% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.79%. Comparing base (e8f3c6f) to head (eb074d0).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...s/dashboard-frontend/src/preload/brandingLoader.ts 94.23% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1438      +/-   ##
==========================================
+ Coverage   92.59%   92.79%   +0.19%     
==========================================
  Files         520      520              
  Lines       48819    48943     +124     
  Branches     3621     3645      +24     
==========================================
+ Hits        45206    45415     +209     
+ Misses       3575     3490      -85     
  Partials       38       38              

☔ 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.

Copy link
Contributor

@svor svor left a comment

Choose a reason for hiding this comment

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

LGTM

Screenshot 2026-01-05 at 18 01 00

@openshift-ci openshift-ci bot added the lgtm label Jan 5, 2026
@openshift-ci
Copy link

openshift-ci bot commented Jan 5, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: olexii4, svor

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@olexii4 olexii4 merged commit e089ade into main Jan 5, 2026
19 checks passed
@olexii4 olexii4 deleted the CHE-23690 branch January 5, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The branding logo loader causes multiple 404 HTTP requests and visible delay on every page load

4 participants