feat(app): event_log and mark_read bridge commands

This commit is contained in:
2026-06-10 08:15:22 +07:00
parent 21fe1308cc
commit d08a446b6f
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -298,3 +298,16 @@ pub async fn delete_group(state: BridgeState<'_>, group_id: String) -> Result<Va
pub async fn focus(state: BridgeState<'_>, surface_id: String) -> Result<Value, String> {
data_of(state.request(Cmd::Focus { surface_id: SurfaceId(surface_id) }).await.map_err(|e| e.to_string())?)
}
// ---- M3 event log commands ----
#[tauri::command]
pub async fn event_log(state: BridgeState<'_>, limit: Option<u32>) -> Result<Value, String> {
data_of(state.request(Cmd::EventLog { limit }).await.map_err(|e| e.to_string())?)
}
#[tauri::command]
pub async fn mark_read(state: BridgeState<'_>, target: Value) -> Result<Value, String> {
let target: spacesh_proto::MarkReadTarget = serde_json::from_value(target).map_err(|e| format!("invalid mark_read target: {e}"))?;
data_of(state.request(Cmd::MarkRead { target }).await.map_err(|e| e.to_string())?)
}