diff --git a/frontend/src/app.html b/frontend/src/app.html index 0fb597d..3d39fbc 100644 --- a/frontend/src/app.html +++ b/frontend/src/app.html @@ -61,6 +61,21 @@ var el = document.getElementById('boot-fallback'); if (el && el.parentNode) el.parentNode.removeChild(el); try { sessionStorage.removeItem('ub_reloaded'); } catch (e) {} + // Slow-but-successful boots (the "white screen, then it loaded" glitch) + // would otherwise leave no trace — beacon the timing so they're visible. + // performance.now() counts from navigation start, so a slow-arriving + // HTML document is included, not just slow JS. + try { + var ms = Math.round(performance.now()); + if (ms > 4000) { + var nav = performance.getEntriesByType && performance.getEntriesByType('navigation')[0]; + var detail = 'boot-slow: ' + ms + 'ms'; + if (nav && nav.responseStart) detail += ' (html ' + Math.round(nav.responseStart) + 'ms)'; + if (navigator.connection && navigator.connection.effectiveType) + detail += ' on ' + navigator.connection.effectiveType; + report(detail); + } + } catch (e) { /* timing is best-effort */ } }; addEventListener('vite:preloadError', function (e) { report('preloadError: ' + ((e && e.payload && e.payload.message) || '')); diff --git a/frontend/src/routes/admin/+page.svelte b/frontend/src/routes/admin/+page.svelte index 0c79079..bd19ed5 100644 --- a/frontend/src/routes/admin/+page.svelte +++ b/frontend/src/routes/admin/+page.svelte @@ -458,9 +458,9 @@

Recent load errors (last {clientErrors.length})