From e4f8f465de2bafe1f03e87dd9455d9175d979187 Mon Sep 17 00:00:00 2001 From: esdrasrenan Date: Sun, 7 Dec 2025 04:07:38 -0300 Subject: [PATCH] Fix chat window behavior - remove auto-open on session start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove automatic window opening when agent starts a chat session - Remove automatic window focus when new messages arrive - Only show Windows notification, user opens chat manually via tray icon - Update notification message to instruct user to click Raven icon 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/desktop/src-tauri/src/chat.rs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/apps/desktop/src-tauri/src/chat.rs b/apps/desktop/src-tauri/src/chat.rs index b62f913..fbc610e 100644 --- a/apps/desktop/src-tauri/src/chat.rs +++ b/apps/desktop/src-tauri/src/chat.rs @@ -345,12 +345,14 @@ impl ChatRuntime { ); // Enviar notificacao nativa do Windows + // A janela de chat NAO abre automaticamente - + // o usuario deve clicar na notificacao ou no tray let notification_title = format!( "Chat iniciado - Chamado #{}", session.ticket_ref ); let notification_body = format!( - "{} iniciou um chat de suporte", + "{} iniciou um chat de suporte.\nClique no icone do Raven para abrir.", session.agent_name ); if let Err(e) = app @@ -364,16 +366,6 @@ impl ChatRuntime { "Falha ao enviar notificacao: {e}" ); } - - // Abrir janela de chat automaticamente - if let Err(e) = open_chat_window_internal( - &app, - &session.ticket_id, - ) { - crate::log_error!( - "Falha ao abrir janela de chat: {e}" - ); - } } } @@ -420,15 +412,7 @@ impl ChatRuntime { "Falha ao enviar notificacao de nova mensagem: {e}" ); } - - // Focar janela de chat se existir - if let Some(session) = result.sessions.first() { - let label = format!("chat-{}", session.ticket_id); - if let Some(window) = app.get_webview_window(&label) { - let _ = window.show(); - let _ = window.set_focus(); - } - } + // NAO foca a janela automaticamente - usuario abre manualmente } } } else {