Add Windows native notifications for chat sessions
- Add tauri-plugin-notification for native Windows notifications - Send notification when new chat session is started - Configure notification permissions in capabilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f45ee91804
commit
b194d77d57
5 changed files with 97 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ use std::sync::Arc;
|
|||
use std::time::Duration;
|
||||
use tauri::async_runtime::JoinHandle;
|
||||
use tauri::{Emitter, Manager, WebviewWindowBuilder, WebviewUrl};
|
||||
use tauri_plugin_notification::NotificationExt;
|
||||
use tokio::sync::Notify;
|
||||
|
||||
// ============================================================================
|
||||
|
|
@ -340,6 +341,27 @@ impl ChatRuntime {
|
|||
},
|
||||
);
|
||||
|
||||
// Enviar notificacao nativa do Windows
|
||||
let notification_title = format!(
|
||||
"Chat iniciado - Chamado #{}",
|
||||
session.ticket_ref
|
||||
);
|
||||
let notification_body = format!(
|
||||
"{} iniciou um chat de suporte",
|
||||
session.agent_name
|
||||
);
|
||||
if let Err(e) = app
|
||||
.notification()
|
||||
.builder()
|
||||
.title(¬ification_title)
|
||||
.body(¬ification_body)
|
||||
.show()
|
||||
{
|
||||
crate::log_warn!(
|
||||
"Falha ao enviar notificacao: {e}"
|
||||
);
|
||||
}
|
||||
|
||||
// Abrir janela de chat automaticamente
|
||||
if let Err(e) = open_chat_window_internal(
|
||||
&app,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue