From 762d8dbc1aee57e06277f492516c0d797c46fa6f Mon Sep 17 00:00:00 2001 From: Claude Dev Date: Thu, 9 Apr 2026 20:36:16 +0200 Subject: [PATCH] Sidebar: Refresh-Status fuer ALLE Lagen korrekt anzeigen Progress-State wird jetzt fuer alle refreshenden Lagen angelegt, nicht nur fuer die aktuell ausgewaehlte. Sidebar-Update passiert vor dem Early-Return fuer nicht-aktuelle Lagen. Bei WebSocket-Reconnect (auch nach Ctrl+Shift+R) wird der State fuer bereits laufende Refreshes korrekt wiederhergestellt. Sidebar-Cleanup bei Refresh-Abschluss fuer alle Lagen. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/static/js/app.js | 11 +++++++---- src/static/js/components.js | 11 ++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/static/js/app.js b/src/static/js/app.js index 7dace8b..1502b2d 100644 --- a/src/static/js/app.js +++ b/src/static/js/app.js @@ -579,8 +579,10 @@ const App = { // Sidebar-Dots aktualisieren data.refreshing.forEach(id => { this._updateSidebarDot(id); - UI._updateSidebarRefreshStatus(id, 'researching', {}); + // Init progress state so sidebar renders correctly + UI.showProgress('researching', {}, id, false); }); + this.renderSidebar(); } } catch (e) { /* Kein kritischer Fehler */ } @@ -2041,12 +2043,11 @@ async handleRefresh() { // Detect first refresh: no summary means first run const inc = this.incidents.find(i => i.id === msg.incident_id); const isFirst = inc && !inc.summary; - // Always update sidebar status (visible for all incidents) - UI._updateSidebarRefreshStatus(msg.incident_id, status, msg.data); + // Update progress state for ALL incidents (sidebar + popup if current) + UI.showProgress(status, msg.data, msg.incident_id, isFirst); // Re-render sidebar so status is baked into HTML (survives future re-renders) this.renderSidebar(); if (msg.incident_id === this.currentIncidentId) { - UI.showProgress(status, msg.data, msg.incident_id, isFirst); this._updateRefreshButton(status !== 'idle'); } }, @@ -2054,6 +2055,8 @@ async handleRefresh() { async handleRefreshComplete(msg) { this._refreshingIncidents.delete(msg.incident_id); this._updateSidebarDot(msg.incident_id); + UI._removeSidebarRefreshStatus(msg.incident_id); + this.renderSidebar(); if (msg.incident_id === this.currentIncidentId) { this._updateRefreshButton(false); diff --git a/src/static/js/components.js b/src/static/js/components.js index 00f7696..76d893b 100644 --- a/src/static/js/components.js +++ b/src/static/js/components.js @@ -299,12 +299,17 @@ const UI = { this._progressTimerInterval = setInterval(() => this._tickProgressTimers(), 1000); } - // Only show UI for current incident - if (incidentId !== App.currentIncidentId) return; + // Store queue position + if (status === 'queued' && extra.queue_position) { + state._queuePos = extra.queue_position; + } - // Update sidebar status text + // Update sidebar status for ALL incidents (not just current) this._updateSidebarRefreshStatus(incidentId, status, extra); + // Only show popup/mini UI for current incident + if (incidentId !== App.currentIncidentId) return; + if (false) { // popup always shown initially state.minimized = true;