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;