From 229c9aa1c751aeaa93b58c69271dbe55eda5a7f1 Mon Sep 17 00:00:00 2001 From: esdrasrenan Date: Sun, 7 Dec 2025 13:58:36 -0300 Subject: [PATCH] Match desktop chat layout with web version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change agent icon from Headphones to MessageCircle - Adjust avatar size to size-7 and icons to size-3.5 - Reposition attach button next to send button (textarea -> attach -> send) - Add Online indicator in header with animated green dot - Implement minimized state (collapsed view like web) - Hide web chat widget when running in Tauri context (avoid duplicate) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/desktop/src/chat/ChatWidget.tsx | 80 ++++++++++++++++++++-------- src/components/chat/chat-widget.tsx | 9 +++- 2 files changed, 65 insertions(+), 24 deletions(-) diff --git a/apps/desktop/src/chat/ChatWidget.tsx b/apps/desktop/src/chat/ChatWidget.tsx index 4a28c11..bf4518e 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, Minus, Loader2, Headphones, Paperclip, FileText, Image as ImageIcon, File, User } from "lucide-react" +import { Send, X, Loader2, MessageCircle, Paperclip, FileText, Image as ImageIcon, File, User, ChevronUp, Minimize2 } from "lucide-react" import type { ChatMessage, ChatMessagesResponse, SendMessageResponse } from "./types" const STORE_FILENAME = "machine-agent.json" @@ -47,6 +47,7 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) { const [ticketInfo, setTicketInfo] = useState<{ ref: number; subject: string; agentName: string } | null>(null) const [hasSession, setHasSession] = useState(false) const [pendingAttachments, setPendingAttachments] = useState([]) + const [isMinimized, setIsMinimized] = useState(false) const messagesEndRef = useRef(null) const lastFetchRef = useRef(0) @@ -292,7 +293,7 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) { } const handleMinimize = () => { - invoke("minimize_chat_window", { ticketId }) + setIsMinimized(true) } const handleClose = () => { @@ -326,7 +327,34 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) { if (!hasSession) { return (
-

Nenhuma sessão de chat ativa

+

Nenhuma sessao de chat ativa

+
+ ) + } + + // Versao minimizada (recolhida) + if (isMinimized) { + return ( +
+
) } @@ -340,15 +368,19 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) { >
- +
-

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

+
+

Chat

+ + + Online + +
{ticketInfo && (

- Chamado #{ticketInfo.ref} + #{ticketInfo.ref} - {ticketInfo.agentName ?? "Suporte"}

)}
@@ -356,13 +388,15 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) {
@@ -393,11 +427,11 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) { > {/* Avatar */}
- {isAgent ? : } + {isAgent ? : }
{/* Bubble */} @@ -474,10 +508,18 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) {
)}
+