feat(app): clear all events from the Event Center (red trash icon)
Adds Cmd::ClearEvents + Evt::EventsCleared: the daemon drops the persistent event log (keeping next_id monotonic), persists, and broadcasts so every client empties its list. A red trash icon next to 'Mark all read' triggers it; disabled when the list is empty. Threaded through proto, the daemon handler, the Tauri bridge, and socketBridge. Includes an EventLog::clear test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -648,6 +648,13 @@ async fn handle_request(
|
||||
let _ = out.send(ok(id, serde_json::Value::Null)).await;
|
||||
}
|
||||
|
||||
Cmd::ClearEvents => {
|
||||
event_log.clear();
|
||||
event_persister.mark_dirty(event_log.snapshot());
|
||||
broadcast_evt(clients, &Envelope::Evt(Evt::EventsCleared));
|
||||
let _ = out.send(ok(id, serde_json::Value::Null)).await;
|
||||
}
|
||||
|
||||
Cmd::Shutdown => {
|
||||
let _ = out.send(ok(id, serde_json::Value::Null)).await;
|
||||
std::process::exit(0);
|
||||
|
||||
Reference in New Issue
Block a user