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) <noreply@anthropic.com>
Dieser Commit ist enthalten in:
Claude Dev
2026-04-09 20:25:51 +02:00
Ursprung 86ff35977e
Commit 9bfdf051c9

Datei anzeigen

@@ -304,6 +304,7 @@ const UI = {
if (!overlay || !popup) return; if (!overlay || !popup) return;
overlay.style.display = 'flex'; overlay.style.display = 'flex';
this._initClickOutside();
// Blocking (no close) for first refresh // Blocking (no close) for first refresh
if (state.isFirst) { 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. * Zusammenfassung mit Inline-Zitaten und Quellenverzeichnis rendern.
*/ */