From 9bfdf051c93a8d8bdfccc5fbe53cc6637fdcb793 Mon Sep 17 00:00:00 2001 From: Claude Dev Date: Thu, 9 Apr 2026 20:25:51 +0200 Subject: [PATCH] Fortschritt: Popup minimiert sich bei Klick ausserhalb automatisch Klick irgendwo ausserhalb des Popups minimiert es zur Mini-Bar. Beim ersten Durchlauf (blocking) bleibt das Popup offen. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/static/js/components.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/static/js/components.js b/src/static/js/components.js index de20bd7..49fdf9d 100644 --- a/src/static/js/components.js +++ b/src/static/js/components.js @@ -304,6 +304,7 @@ const UI = { if (!overlay || !popup) return; overlay.style.display = 'flex'; + this._initClickOutside(); // Blocking (no close) for first refresh if (state.isFirst) { @@ -622,6 +623,31 @@ const UI = { }, + // === Click-outside to auto-minimize popup === + _initClickOutside() { + if (this._clickOutsideInit) return; + this._clickOutsideInit = true; + document.addEventListener('click', (e) => { + const overlay = document.getElementById('progress-overlay'); + if (!overlay || overlay.style.display === 'none') return; + const popup = document.getElementById('progress-popup'); + if (!popup) return; + // Ignore clicks inside the popup itself + if (popup.contains(e.target)) return; + // Ignore clicks on the mini bar + const mini = document.getElementById('progress-mini'); + if (mini && mini.contains(e.target)) return; + // Don't minimize during first refresh (blocking) + const currentId = App.currentIncidentId; + const state = this._progressState[currentId]; + if (state && state.isFirst) return; + // Auto-minimize + if (state && !state.minimized) { + this.minimizeProgress(currentId); + } + }); + }, + /** * Zusammenfassung mit Inline-Zitaten und Quellenverzeichnis rendern. */