From 925778619178a822b875334564f6ca1f0d2e8fff Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 14 Nov 2025 11:28:17 +0200 Subject: [PATCH 001/237] reduce load speed --- Frontend/web/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frontend/web/index.html b/Frontend/web/index.html index 3bb4dfc8..1b438bb8 100644 --- a/Frontend/web/index.html +++ b/Frontend/web/index.html @@ -438,7 +438,7 @@ ); loadMainDartJs(); } - }, 4000); + }, 500); var finishLoad = new Date(); var loadTime = (finishLoad.getTime() - startLoad.getTime()); console.log("Load Time: " + loadTime); From 20d5bc400474b80bac745ea9cbe0b0122ea56526 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 14 Nov 2025 12:07:36 +0200 Subject: [PATCH 002/237] increase load --- Frontend/web/index.html | 197 ++++++++++++++++++++-------------------- 1 file changed, 99 insertions(+), 98 deletions(-) diff --git a/Frontend/web/index.html b/Frontend/web/index.html index 1b438bb8..27d81740 100644 --- a/Frontend/web/index.html +++ b/Frontend/web/index.html @@ -362,112 +362,113 @@ }); +  From 64443a50765ce734c647f7143c4e5aa932dca629 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 14 Nov 2025 12:22:21 +0200 Subject: [PATCH 003/237] web loadtime --- Frontend/web/index.html | 51 ++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/Frontend/web/index.html b/Frontend/web/index.html index 27d81740..3dfe24f1 100644 --- a/Frontend/web/index.html +++ b/Frontend/web/index.html @@ -365,7 +365,7 @@     var serviceWorkerVersion = '{{flutter_service_worker_version}}';     var scriptLoaded = false; -    function loadMainDartJs() { +    function loadMainDartJs(isUpdate) {       console.log('Loading app...');       if (scriptLoaded) {         return; @@ -380,6 +380,17 @@         onEntrypointLoaded: function (engineInitializer) {           engineInitializer.initializeEngine().then(function (appRunner) {             appRunner.runApp(); +            + // --- NEW PROMPT LOCATION --- + if (isUpdate) { + // Only show prompt AFTER the old app (the one currently running) has loaded + console.log('New app version installed. Prompting for reload.'); + if (confirm('A new version of the app is available. Refresh now to update?')) { + window.location.reload(); + } + } + // --------------------------- +           });         }       }); @@ -389,7 +400,7 @@     function getCleanVersion(version) {       return version.replace(/"/g, '');     } - +         if ('serviceWorker' in navigator) {       var startLoad = new Date();       // Service workers are supported. Use them. @@ -399,22 +410,16 @@         navigator.serviceWorker.register(serviceWorkerUrl)           .then((reg) => { + + // Flag to track if this registration resulted in an update + let isUpdateInstallation = false; +             function waitForActivation(serviceWorker) {               serviceWorker.addEventListener('statechange', () => {                 if (serviceWorker.state == 'activated') {                   console.log('Installed new service worker.'); -                  loadMainDartJs(); -                  // Optional: Prompt user to reload for the new version to take effect -                  // The user is currently running the OLD cached version of the app. -                  // This prompt is generally preferred over the previous logic. -                  if (navigator.serviceWorker.controller) { -                    // Only prompt if this isn't the first time loading. -                    console.log('New app version activated. Prompting for reload.'); -                    // You can replace this confirm with a better UI notification. -                    if (confirm('A new version of the app is available. Refresh now to update?')) { -                      window.location.reload(); -                    } -                  } +                  // Pass the update flag to loadMainDartJs +                  loadMainDartJs(isUpdateInstallation);                 }               });             } @@ -425,26 +430,27 @@             console.log('Active Service Worker Version: ' + (currentSWVersion || 'None'));             const isMatch = currentSWVersion === cleanServiceWorkerVersion;             console.log('Latest Service Worker Installed: ' + isMatch); - +                         if (!reg.active && (reg.installing || reg.waiting)) {               // First time load: wait for activation.               console.log('No Service Worker Available - Installing New Service Worker.');               waitForActivation(reg.installing || reg.waiting);             } else if (!isMatch) {               // New version available: force update. + isUpdateInstallation = true; // Set flag when update is initiated               console.log('New service worker available. Updating and waiting for activation.');               reg.update();               waitForActivation(reg.installing);             } else {               // Existing service worker is still good.               console.log('Service Worker up-to-date, Loading app.'); -              loadMainDartJs(); +              loadMainDartJs(false); // No update, pass false             }           }) - .catch((error) => { - console.error('Service Worker registration failed:', error); - loadMainDartJs(); // Fallback if registration fails completely - }); +          .catch((error) => { +              console.error('Service Worker registration failed:', error); +              loadMainDartJs(false); // Fallback if registration fails completely +          });         // If service worker doesn't succeed in a reasonable amount of time, @@ -454,7 +460,7 @@             console.warn(               'Failed to load app from a service worker. Falling back to plain - From 47ca6d7311fe2eeb45bf0cfe8897220d50c4165d Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 14 Nov 2025 12:33:35 +0200 Subject: [PATCH 004/237] revert --- Frontend/web/index.html | 51 +++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/Frontend/web/index.html b/Frontend/web/index.html index 3dfe24f1..27d81740 100644 --- a/Frontend/web/index.html +++ b/Frontend/web/index.html @@ -365,7 +365,7 @@     var serviceWorkerVersion = '{{flutter_service_worker_version}}';     var scriptLoaded = false; -    function loadMainDartJs(isUpdate) { +    function loadMainDartJs() {       console.log('Loading app...');       if (scriptLoaded) {         return; @@ -380,17 +380,6 @@         onEntrypointLoaded: function (engineInitializer) {           engineInitializer.initializeEngine().then(function (appRunner) {             appRunner.runApp(); -            - // --- NEW PROMPT LOCATION --- - if (isUpdate) { - // Only show prompt AFTER the old app (the one currently running) has loaded - console.log('New app version installed. Prompting for reload.'); - if (confirm('A new version of the app is available. Refresh now to update?')) { - window.location.reload(); - } - } - // --------------------------- -           });         }       }); @@ -400,7 +389,7 @@     function getCleanVersion(version) {       return version.replace(/"/g, '');     } -     +     if ('serviceWorker' in navigator) {       var startLoad = new Date();       // Service workers are supported. Use them. @@ -410,16 +399,22 @@         navigator.serviceWorker.register(serviceWorkerUrl)           .then((reg) => { - - // Flag to track if this registration resulted in an update - let isUpdateInstallation = false; -             function waitForActivation(serviceWorker) {               serviceWorker.addEventListener('statechange', () => {                 if (serviceWorker.state == 'activated') {                   console.log('Installed new service worker.'); -                  // Pass the update flag to loadMainDartJs -                  loadMainDartJs(isUpdateInstallation); +                  loadMainDartJs(); +                  // Optional: Prompt user to reload for the new version to take effect +                  // The user is currently running the OLD cached version of the app. +                  // This prompt is generally preferred over the previous logic. +                  if (navigator.serviceWorker.controller) { +                    // Only prompt if this isn't the first time loading. +                    console.log('New app version activated. Prompting for reload.'); +                    // You can replace this confirm with a better UI notification. +                    if (confirm('A new version of the app is available. Refresh now to update?')) { +                      window.location.reload(); +                    } +                  }                 }               });             } @@ -430,27 +425,26 @@             console.log('Active Service Worker Version: ' + (currentSWVersion || 'None'));             const isMatch = currentSWVersion === cleanServiceWorkerVersion;             console.log('Latest Service Worker Installed: ' + isMatch); -             +             if (!reg.active && (reg.installing || reg.waiting)) {               // First time load: wait for activation.               console.log('No Service Worker Available - Installing New Service Worker.');               waitForActivation(reg.installing || reg.waiting);             } else if (!isMatch) {               // New version available: force update. - isUpdateInstallation = true; // Set flag when update is initiated               console.log('New service worker available. Updating and waiting for activation.');               reg.update();               waitForActivation(reg.installing);             } else {               // Existing service worker is still good.               console.log('Service Worker up-to-date, Loading app.'); -              loadMainDartJs(false); // No update, pass false +              loadMainDartJs();             }           }) -          .catch((error) => { -              console.error('Service Worker registration failed:', error); -              loadMainDartJs(false); // Fallback if registration fails completely -          }); + .catch((error) => { + console.error('Service Worker registration failed:', error); + loadMainDartJs(); // Fallback if registration fails completely + });         // If service worker doesn't succeed in a reasonable amount of time, @@ -460,7 +454,7 @@             console.warn(               'Failed to load app from a service worker. Falling back to plain + From 1f73aa3b87aad91f312510e2b7228d8d1cab24fb Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 14 Nov 2025 12:47:15 +0200 Subject: [PATCH 005/237] web load v2 --- Frontend/web/index.html | 187 ++++++++++++++++++++-------------------- 1 file changed, 93 insertions(+), 94 deletions(-) diff --git a/Frontend/web/index.html b/Frontend/web/index.html index 27d81740..704d4df0 100644 --- a/Frontend/web/index.html +++ b/Frontend/web/index.html @@ -363,111 +363,110 @@ From 1387fb1af5808271822d520b9e299d11c72500f4 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 14 Nov 2025 12:52:11 +0200 Subject: [PATCH 006/237] increase timeut time --- Frontend/web/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frontend/web/index.html b/Frontend/web/index.html index 704d4df0..228440e0 100644 --- a/Frontend/web/index.html +++ b/Frontend/web/index.html @@ -456,7 +456,7 @@ ); loadMainDartJs(); } - }, 500); + }, 3000); var finishLoad = new Date(); var loadTime = (finishLoad.getTime() - startLoad.getTime()); console.log("Load Time: " + loadTime); From 609c8d46db32cea9a002aafd0b6b6d26e5f2e821 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 14 Nov 2025 13:04:04 +0200 Subject: [PATCH 007/237] cancel timeout on load --- Frontend/web/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Frontend/web/index.html b/Frontend/web/index.html index 228440e0..7376fc04 100644 --- a/Frontend/web/index.html +++ b/Frontend/web/index.html @@ -371,6 +371,11 @@ return; } scriptLoaded = true; + // Cancel Timeut + if (window.swFallbackTimeout) { + clearTimeout(window.swFallbackTimeout); + console.log('Service worker loaded successfully - fallback timeout cancelled.'); + } {{flutter_js}} {{flutter_build_config}} _flutter.loader.load({ @@ -456,7 +461,7 @@ ); loadMainDartJs(); } - }, 3000); + }, 4000); var finishLoad = new Date(); var loadTime = (finishLoad.getTime() - startLoad.getTime()); console.log("Load Time: " + loadTime); From 8a2debcaa840b45af92790839bdc9de22ec95951 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Fri, 14 Nov 2025 13:53:20 +0200 Subject: [PATCH 008/237] optimisation web pt 2 --- Frontend/web/index.html | 160 ++++------------------------------------ 1 file changed, 14 insertions(+), 146 deletions(-) diff --git a/Frontend/web/index.html b/Frontend/web/index.html index 7376fc04..006730a2 100644 --- a/Frontend/web/index.html +++ b/Frontend/web/index.html @@ -21,9 +21,10 @@ - + + - + @@ -104,61 +105,6 @@ } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + .bottomLeft { + position: absolute; + bottom: 0; + left: 0; + } + + .bottomRight { + position: absolute; + bottom: 0; + right: 0; + } + + - - - - - - - - - - - -