From fd0e29514aaa20c84cfffba8c43d319ca6e580d9 Mon Sep 17 00:00:00 2001 From: esdrasrenan Date: Sun, 7 Dec 2025 13:20:35 -0300 Subject: [PATCH] fix(desktop): restore custom chat window header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert to frameless window with custom header containing minimize/close buttons and drag region. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/desktop/src-tauri/src/chat.rs | 4 +- apps/desktop/src/chat/ChatWidget.tsx | 55 +++++++++++++++++++++------- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/apps/desktop/src-tauri/src/chat.rs b/apps/desktop/src-tauri/src/chat.rs index e4cfc06..7468738 100644 --- a/apps/desktop/src-tauri/src/chat.rs +++ b/apps/desktop/src-tauri/src/chat.rs @@ -718,9 +718,9 @@ fn open_chat_window_internal(app: &tauri::AppHandle, ticket_id: &str) -> Result< .inner_size(380.0, 520.0) .min_inner_size(300.0, 400.0) .position(x, y) - .decorations(true) // Usar decoracoes nativas do Windows + .decorations(false) // Sem decoracoes nativas - usa header customizado .always_on_top(true) - .skip_taskbar(false) // Mostrar na taskbar + .skip_taskbar(true) .focused(true) .visible(true) .build() diff --git a/apps/desktop/src/chat/ChatWidget.tsx b/apps/desktop/src/chat/ChatWidget.tsx index 2b64d26..f155629 100644 --- a/apps/desktop/src/chat/ChatWidget.tsx +++ b/apps/desktop/src/chat/ChatWidget.tsx @@ -4,7 +4,7 @@ import { listen } from "@tauri-apps/api/event" import { Store } from "@tauri-apps/plugin-store" import { appLocalDataDir, join } from "@tauri-apps/api/path" import { open } from "@tauri-apps/plugin-dialog" -import { Send, X, Loader2, Headphones, Paperclip, FileText, Image as ImageIcon, File } from "lucide-react" +import { Send, X, Minus, Loader2, Headphones, Paperclip, FileText, Image as ImageIcon, File } from "lucide-react" import type { ChatMessage, ChatMessagesResponse, SendMessageResponse } from "./types" const STORE_FILENAME = "machine-agent.json" @@ -291,6 +291,14 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) { } } + const handleMinimize = () => { + invoke("minimize_chat_window", { ticketId }) + } + + const handleClose = () => { + invoke("close_chat_window", { ticketId }) + } + const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault() @@ -325,20 +333,39 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) { return (
- {/* Header */} -
-
- -
-
-

- {ticketInfo?.agentName ?? "Suporte"} -

- {ticketInfo && ( -

- Chamado #{ticketInfo.ref} + {/* Header - arrastavel */} +

+
+
+ +
+
+

+ {ticketInfo?.agentName ?? "Suporte"}

- )} + {ticketInfo && ( +

+ Chamado #{ticketInfo.ref} +

+ )} +
+
+
+ +