From 7e270bcd3b8647b5b05044f8c5ee844eefc961d4 Mon Sep 17 00:00:00 2001
From: esdrasrenan
Date: Sun, 7 Dec 2025 13:24:40 -0300
Subject: [PATCH] Update chat layout to match web version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Client messages on left with white background and border
- Agent messages on right with black background
- Added circular avatars (User icon for client, Headphones for agent)
- Improved spacing and visual consistency
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5
---
apps/desktop/src/chat/ChatWidget.tsx | 109 +++++++++++++++------------
1 file changed, 61 insertions(+), 48 deletions(-)
diff --git a/apps/desktop/src/chat/ChatWidget.tsx b/apps/desktop/src/chat/ChatWidget.tsx
index f155629..4a28c11 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 } from "lucide-react"
+import { Send, X, Minus, Loader2, Headphones, Paperclip, FileText, Image as ImageIcon, File, User } from "lucide-react"
import type { ChatMessage, ChatMessagesResponse, SendMessageResponse } from "./types"
const STORE_FILENAME = "machine-agent.json"
@@ -381,58 +381,71 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) {
) : (
-
- {messages.map((msg) => (
-
+
+ {messages.map((msg) => {
+ // No desktop: isFromMachine=true significa mensagem do cliente (maquina)
+ // Layout igual à web: cliente à esquerda, agente à direita
+ const isAgent = !msg.isFromMachine
+ return (
- {!msg.isFromMachine && (
-
- {msg.authorName}
-
- )}
-
{msg.body}
- {/* Anexos */}
- {msg.attachments && msg.attachments.length > 0 && (
-
- {msg.attachments.map((att) => (
-
- {getFileIcon(att.name)}
- {att.name}
- {att.size && (
-
- ({Math.round(att.size / 1024)}KB)
-
- )}
-
- ))}
-
- )}
-
- {formatTime(msg.createdAt)}
-
+ {isAgent ?
:
}
+
+
+ {/* Bubble */}
+
+ {!isAgent && (
+
+ {msg.authorName}
+
+ )}
+
{msg.body}
+ {/* Anexos */}
+ {msg.attachments && msg.attachments.length > 0 && (
+
+ {msg.attachments.map((att) => (
+
+ {getFileIcon(att.name)}
+ {att.name}
+ {att.size && (
+
+ ({Math.round(att.size / 1024)}KB)
+
+ )}
+
+ ))}
+
+ )}
+
+ {formatTime(msg.createdAt)}
+
+
-
- ))}
+ )
+ })}
)}