Fix: Abbrechen-Dialog, Overlay-Stacking, Queue-Cancel
1. Confirm-Dialog z-index ueber Progress-Popup (10000 > 9000) 2. Progress-Popup wird ausgeblendet waehrend Confirm-Dialog offen 3. Kein dunkler-werdendes Overlay bei mehrfachem Abbrechen-Klick 4. Abbrechen funktioniert jetzt auch fuer Lagen in der Warteschlange (werden direkt aus der Queue entfernt statt auf Start zu warten) 5. Cancel-Status wird im Popup-Titel angezeigt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -437,22 +437,59 @@ class AgentOrchestrator:
|
||||
return True
|
||||
|
||||
async def cancel_refresh(self, incident_id: int) -> bool:
|
||||
"""Fordert Abbruch eines laufenden Refreshes an."""
|
||||
if self._current_task != incident_id:
|
||||
return False
|
||||
self._cancel_requested.add(incident_id)
|
||||
logger.info(f"Cancel angefordert fuer Lage {incident_id}")
|
||||
if self._ws_manager:
|
||||
try:
|
||||
vis, cb, tid = await self._get_incident_visibility(incident_id)
|
||||
except Exception:
|
||||
vis, cb, tid = "public", None, None
|
||||
await self._ws_manager.broadcast_for_incident({
|
||||
"type": "status_update",
|
||||
"incident_id": incident_id,
|
||||
"data": {"status": "cancelling", "detail": "Wird abgebrochen..."},
|
||||
}, vis, cb, tid)
|
||||
return True
|
||||
"""Fordert Abbruch eines laufenden oder wartenden Refreshes an."""
|
||||
# Check if it's the currently running task
|
||||
if self._current_task == incident_id:
|
||||
self._cancel_requested.add(incident_id)
|
||||
logger.info(f"Cancel angefordert fuer laufende Lage {incident_id}")
|
||||
if self._ws_manager:
|
||||
try:
|
||||
vis, cb, tid = await self._get_incident_visibility(incident_id)
|
||||
except Exception:
|
||||
vis, cb, tid = "public", None, None
|
||||
await self._ws_manager.broadcast_for_incident({
|
||||
"type": "status_update",
|
||||
"incident_id": incident_id,
|
||||
"data": {"status": "cancelling", "detail": "Wird abgebrochen..."},
|
||||
}, vis, cb, tid)
|
||||
return True
|
||||
|
||||
# Check if it's in the queue (not yet started)
|
||||
if incident_id in self._queued_ids:
|
||||
self._queued_ids.discard(incident_id)
|
||||
# Remove from asyncio queue (rebuild without this ID)
|
||||
removed = False
|
||||
new_items = []
|
||||
while not self._queue.empty():
|
||||
try:
|
||||
item = self._queue.get_nowait()
|
||||
iid = item[0] if isinstance(item, tuple) else item
|
||||
if iid == incident_id:
|
||||
removed = True
|
||||
self._queue.task_done()
|
||||
else:
|
||||
new_items.append(item)
|
||||
except Exception:
|
||||
break
|
||||
for item in new_items:
|
||||
self._queue.put_nowait(item)
|
||||
|
||||
logger.info(f"Lage {incident_id} aus Warteschlange entfernt (removed={removed})")
|
||||
|
||||
# Send cancelled event
|
||||
if self._ws_manager:
|
||||
try:
|
||||
vis, cb, tid = await self._get_incident_visibility(incident_id)
|
||||
except Exception:
|
||||
vis, cb, tid = "public", None, None
|
||||
await self._ws_manager.broadcast_for_incident({
|
||||
"type": "refresh_cancelled",
|
||||
"incident_id": incident_id,
|
||||
"data": {"status": "cancelled"},
|
||||
}, vis, cb, tid)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def _check_cancelled(self, incident_id: int):
|
||||
"""Prüft ob Abbruch angefordert wurde und wirft CancelledError."""
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren