From bfe2f84f4fc8f37517eaadfa3274eb0ff79b47ab Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Fri, 15 May 2026 01:37:57 +0300 Subject: feat: add system toast delivery --- src/app/api.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/app/api.rs') diff --git a/src/app/api.rs b/src/app/api.rs index 46429ffe..1fb11118 100644 --- a/src/app/api.rs +++ b/src/app/api.rs @@ -84,11 +84,17 @@ impl App { if self.local_terminal_notifications && matches!( self.state.toast_config.delivery, - crate::config::ToastDelivery::Terminal + crate::config::ToastDelivery::Terminal | crate::config::ToastDelivery::System ) { + let notify = match self.state.toast_config.delivery { + crate::config::ToastDelivery::Terminal => crate::terminal_notify::show_notification, + crate::config::ToastDelivery::System => crate::platform::show_desktop_notification, + _ => unreachable!("toast delivery was checked above"), + }; + if let Some(version) = update_ready_version { - let _ = crate::terminal_notify::show_notification( + let _ = notify( &format!("v{version} available"), Some("detach, then run `herdr update`"), ); @@ -127,7 +133,7 @@ impl App { ToastKind::Finished => "finished", ToastKind::UpdateInstalled => "updated", }; - let _ = crate::terminal_notify::show_notification( + let _ = notify( &format!("{} {}", agent_label, event_text), Some(&crate::app::actions::notification_context( ws, -- cgit v1.2.3