feat(dashboard): delete conversation turns (per-turn ✕ + 전체 삭제)
Add a per-turn ✕ button on each 대화 카드 and a "🗑 전체 삭제" button in the turn filter bar. Monitor gains delete_turn(id)/clear_turns() which broadcast turn_deleted/turns_cleared; the page removes them live (all connected clients). Routes: POST /api/turns/delete, POST /api/turns/clear. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -258,6 +258,26 @@ class Monitor:
|
||||
self._events.clear()
|
||||
self._broadcast({"type": "logs_cleared"})
|
||||
|
||||
def delete_turn(self, turn_id: int) -> bool:
|
||||
"""Remove one conversation turn by id (dashboard per-turn '✕')."""
|
||||
found = False
|
||||
with self._lock:
|
||||
for t in list(self._turns):
|
||||
if t.id == turn_id:
|
||||
self._turns.remove(t)
|
||||
found = True
|
||||
break
|
||||
if found:
|
||||
self._broadcast({"type": "turn_deleted", "id": turn_id})
|
||||
return found
|
||||
|
||||
def clear_turns(self) -> None:
|
||||
"""Wipe all conversation turns (dashboard '대화 전체 삭제'). Broadcasts a
|
||||
reset so every connected page clears its turn list too."""
|
||||
with self._lock:
|
||||
self._turns.clear()
|
||||
self._broadcast({"type": "turns_cleared"})
|
||||
|
||||
# -- turns ------------------------------------------------------------ #
|
||||
def turn(self, source: str = "voice") -> Turn:
|
||||
with self._lock:
|
||||
|
||||
Reference in New Issue
Block a user