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:
@@ -430,6 +430,11 @@ pub async fn mark_read(state: BridgeState<'_>, target: Value) -> Result<Value, S
|
||||
data_of(state.request(Cmd::MarkRead { target }).await.map_err(|e| e.to_string())?)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn clear_events(state: BridgeState<'_>) -> Result<Value, String> {
|
||||
data_of(state.request(Cmd::ClearEvents).await.map_err(|e| e.to_string())?)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn health(state: BridgeState<'_>) -> Result<Value, String> {
|
||||
data_of(state.request(Cmd::Health).await.map_err(|e| e.to_string())?)
|
||||
|
||||
@@ -52,6 +52,7 @@ pub fn run() {
|
||||
bridge::set_zoom,
|
||||
bridge::event_log,
|
||||
bridge::mark_read,
|
||||
bridge::clear_events,
|
||||
bridge::health,
|
||||
bridge::get_config,
|
||||
bridge::set_config,
|
||||
|
||||
Reference in New Issue
Block a user