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:
EJClaw
2026-08-27 02:17:16 +09:00
parent 8539acd0f8
commit 5966f6dedb
2 changed files with 66 additions and 2 deletions

View File

@@ -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: