Mountain/Vine/Server/Notification/ProgressUpdate.rs
1#![allow(non_snake_case)]
2//! Cocoon → Mountain `progress.update` notification.
3//! Cocoon's `Services/Window/Progress.ts:56` emits this on every
4//! `Progress.report({ message, increment })` callback during an
5//! extension's `vscode.window.withProgress(...)` invocation. Stock
6//! Mountain already handles `progress.report` with identical payload
7//! semantics; this atom funnels into the same `sky://` channel so the
8//! notification-surface name mismatch (update vs report) doesn't leak
9//! into the renderer contract.
10
11use serde_json::Value;
12use tauri::Emitter;
13
14use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
15
16pub async fn ProgressUpdate(Service:&MountainVinegRPCService, Parameter:&Value) {
17 let _ = Service
18 .ApplicationHandle()
19 .emit("sky://notification/progress-update", Parameter);
20 dev_log!(
21 "grpc",
22 "[Progress] update id={}",
23 Parameter.get("id").and_then(Value::as_str).unwrap_or("?")
24 );
25}