From c5c31aa32320cbab457ba3813cfa4b824ef7664f Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 19 Apr 2026 23:20:17 +0200 Subject: [PATCH] fix(ui): log-fallback warning is a toast, not a blocking alert() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit alert() in Electron halts the renderer main thread until the user clicks OK — the upload table, status bar and progress all freeze. During a 170-file batch the dialog popped up mid-upload and froze everything for however long the user took to dismiss it (which is why stats updates lagged to one every 3-5s instead of the usual 1s cadence). Replaced with the same showCopyToast used elsewhere, with an 8s duration so the message is still readable. showCopyToast now accepts an optional durationMs argument. --- renderer/app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/renderer/app.js b/renderer/app.js index 8b2879a..625cce2 100644 --- a/renderer/app.js +++ b/renderer/app.js @@ -118,7 +118,11 @@ async function init() { }); window.api.onShutdownCountdown(handleShutdownCountdown); window.api.onUploadLogFallback((data) => { - alert('Der konfigurierte Log-Pfad konnte nicht beschrieben werden.\n\nNeue Einträge werden zwischenzeitlich hier gespeichert:\n' + (data && data.fallbackPath ? data.fallbackPath : '(Fallback)') + '\n\nBitte in den Einstellungen einen gültigen Pfad setzen.'); + // Non-blocking toast instead of alert() — alert() in Electron halts the + // entire renderer main thread (including the upload table) until the user + // clicks OK. During a big batch that freezes everything. + const path = data && data.fallbackPath ? data.fallbackPath : '(Fallback)'; + showCopyToast(`Log-Pfad nicht beschreibbar — schreibe nach: ${path}`, 8000); }); window.api.onAccountRotationLog((entry) => { // Surface only the user-visible rotation events as toasts; full detail @@ -3891,12 +3895,12 @@ function escapeAttr(str) { return String(str).replace(_ATTR_ESC_RE, (c) => _ATTR_ESC_MAP[c]); } -function showCopyToast(msg) { +function showCopyToast(msg, durationMs) { const toast = document.getElementById('copyToast'); toast.textContent = msg; toast.classList.add('show'); clearTimeout(toast._timer); - toast._timer = setTimeout(() => toast.classList.remove('show'), 1500); + toast._timer = setTimeout(() => toast.classList.remove('show'), durationMs || 1500); } // --- Resize handle for recent-files panel ---