Skip to main content

Vine/Server/Notification/
OutputChannelHide.rs

1//! Cocoon `outputChannel.hide` notification. Forwards to Sky as
2//! `sky://output/show { visible: false, channel }` so the workbench
3//! panel can dismiss the channel via the same handler that processes
4//! `show()` calls.
5
6use serde_json::{Value, json};
7
8use crate::{Host::VineHost, dev_log};
9
10pub async fn OutputChannelHide(Host:&dyn VineHost, Parameter:&Value) {
11	let Channel = Parameter
12		.get("channel")
13		.or_else(|| Parameter.get("name"))
14		.or_else(|| Parameter.get("handle"))
15		.and_then(Value::as_str)
16		.unwrap_or("");
17
18	Host.EmitToRenderer(
19		"sky://output/show",
20		json!({
21			"visible": false,
22			"channel": Channel,
23		}),
24	);
25
26	dev_log!("grpc", "[OutputChannel] hide channel={}", Channel);
27}