Warteschlange: Positionen nach Cancel/Error/Complete neu nummerieren

Wenn ein Fall aus der Queue entfernt wird (Cancel, Fehler, Abschluss),
bleiben die #-Nummern der verbleibenden Eintraege jetzt nicht mehr
stecken. _reindexQueuePositions() sortiert nach alter Position und
nummeriert sequentiell neu (#1, #2, ...).

Aufgerufen in: handleRefreshCancelled, handleRefreshError,
handleRefreshComplete.
Dieser Commit ist enthalten in:
claude-dev
2026-04-11 19:50:59 +00:00
Ursprung f4f1df916e
Commit 89cc920bdc
2 geänderte Dateien mit 20 neuen und 0 gelöschten Zeilen

Datei anzeigen

@@ -2085,6 +2085,8 @@ async handleRefresh() {
this._refreshingIncidents.delete(msg.incident_id); this._refreshingIncidents.delete(msg.incident_id);
this._updateSidebarDot(msg.incident_id); this._updateSidebarDot(msg.incident_id);
UI._removeSidebarRefreshStatus(msg.incident_id); UI._removeSidebarRefreshStatus(msg.incident_id);
delete UI._progressState[msg.incident_id];
UI._reindexQueuePositions();
this.renderSidebar(); this.renderSidebar();
if (msg.incident_id === this.currentIncidentId) { if (msg.incident_id === this.currentIncidentId) {
@@ -2191,6 +2193,7 @@ async handleRefresh() {
this._updateSidebarDot(msg.incident_id, 'error'); this._updateSidebarDot(msg.incident_id, 'error');
UI._removeSidebarRefreshStatus(msg.incident_id); UI._removeSidebarRefreshStatus(msg.incident_id);
delete UI._progressState[msg.incident_id]; delete UI._progressState[msg.incident_id];
UI._reindexQueuePositions();
this.renderSidebar(); this.renderSidebar();
if (msg.incident_id === this.currentIncidentId) { if (msg.incident_id === this.currentIncidentId) {
this._updateRefreshButton(false); this._updateRefreshButton(false);
@@ -2210,6 +2213,7 @@ async handleRefresh() {
this._updateSidebarDot(msg.incident_id); this._updateSidebarDot(msg.incident_id);
UI._removeSidebarRefreshStatus(msg.incident_id); UI._removeSidebarRefreshStatus(msg.incident_id);
delete UI._progressState[msg.incident_id]; delete UI._progressState[msg.incident_id];
UI._reindexQueuePositions();
this.renderSidebar(); this.renderSidebar();
if (msg.incident_id === this.currentIncidentId) { if (msg.incident_id === this.currentIncidentId) {
this._updateRefreshButton(false); this._updateRefreshButton(false);

Datei anzeigen

@@ -650,6 +650,22 @@ const UI = {
if (item) item.classList.remove('refreshing-item', 'queued-item'); if (item) item.classList.remove('refreshing-item', 'queued-item');
}, },
_reindexQueuePositions() {
// Collect all queued incidents and renumber sequentially
const queued = [];
for (const [id, state] of Object.entries(this._progressState)) {
if (state && state.step === 'queued') queued.push({ id: Number(id), pos: state._queuePos || 999 });
}
queued.sort((a, b) => a.pos - b.pos);
queued.forEach((item, idx) => {
const newPos = idx + 1;
const state = this._progressState[item.id];
if (state) state._queuePos = newPos;
const statusEl = document.getElementById('sidebar-refresh-' + item.id);
if (statusEl) statusEl.innerHTML = '<span>Warteschlange (#' + newPos + ')</span>';
});
},
// === Click-outside to auto-minimize popup === // === Click-outside to auto-minimize popup ===
_initClickOutside() { _initClickOutside() {