fix(desktop): restore custom chat window header
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 <noreply@anthropic.com>
This commit is contained in:
parent
c217a40030
commit
fd0e29514a
2 changed files with 43 additions and 16 deletions
|
|
@ -718,9 +718,9 @@ fn open_chat_window_internal(app: &tauri::AppHandle, ticket_id: &str) -> Result<
|
||||||
.inner_size(380.0, 520.0)
|
.inner_size(380.0, 520.0)
|
||||||
.min_inner_size(300.0, 400.0)
|
.min_inner_size(300.0, 400.0)
|
||||||
.position(x, y)
|
.position(x, y)
|
||||||
.decorations(true) // Usar decoracoes nativas do Windows
|
.decorations(false) // Sem decoracoes nativas - usa header customizado
|
||||||
.always_on_top(true)
|
.always_on_top(true)
|
||||||
.skip_taskbar(false) // Mostrar na taskbar
|
.skip_taskbar(true)
|
||||||
.focused(true)
|
.focused(true)
|
||||||
.visible(true)
|
.visible(true)
|
||||||
.build()
|
.build()
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { listen } from "@tauri-apps/api/event"
|
||||||
import { Store } from "@tauri-apps/plugin-store"
|
import { Store } from "@tauri-apps/plugin-store"
|
||||||
import { appLocalDataDir, join } from "@tauri-apps/api/path"
|
import { appLocalDataDir, join } from "@tauri-apps/api/path"
|
||||||
import { open } from "@tauri-apps/plugin-dialog"
|
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"
|
import type { ChatMessage, ChatMessagesResponse, SendMessageResponse } from "./types"
|
||||||
|
|
||||||
const STORE_FILENAME = "machine-agent.json"
|
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) => {
|
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||||
if (e.key === "Enter" && !e.shiftKey) {
|
if (e.key === "Enter" && !e.shiftKey) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
@ -325,20 +333,39 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen flex-col bg-white">
|
<div className="flex h-screen flex-col bg-white">
|
||||||
{/* Header */}
|
{/* Header - arrastavel */}
|
||||||
<div className="flex items-center gap-3 border-b border-slate-200 bg-slate-50 px-4 py-3">
|
<div
|
||||||
<div className="flex size-10 items-center justify-center rounded-full bg-black text-white">
|
data-tauri-drag-region
|
||||||
<Headphones className="size-5" />
|
className="flex items-center justify-between border-b border-slate-200 bg-slate-50 px-4 py-3"
|
||||||
</div>
|
>
|
||||||
<div>
|
<div className="flex items-center gap-3">
|
||||||
<p className="text-sm font-semibold text-slate-900">
|
<div className="flex size-10 items-center justify-center rounded-full bg-black text-white">
|
||||||
{ticketInfo?.agentName ?? "Suporte"}
|
<Headphones className="size-5" />
|
||||||
</p>
|
</div>
|
||||||
{ticketInfo && (
|
<div>
|
||||||
<p className="text-xs text-slate-500">
|
<p className="text-sm font-semibold text-slate-900">
|
||||||
Chamado #{ticketInfo.ref}
|
{ticketInfo?.agentName ?? "Suporte"}
|
||||||
</p>
|
</p>
|
||||||
)}
|
{ticketInfo && (
|
||||||
|
<p className="text-xs text-slate-500">
|
||||||
|
Chamado #{ticketInfo.ref}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-1">
|
||||||
|
<button
|
||||||
|
onClick={handleMinimize}
|
||||||
|
className="rounded p-1.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600"
|
||||||
|
>
|
||||||
|
<Minus className="size-4" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={handleClose}
|
||||||
|
className="rounded p-1.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600"
|
||||||
|
>
|
||||||
|
<X className="size-4" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue