fix(desktop): adiciona permissao start-dragging e debug logging no Hub
- Adiciona core🪟allow-start-dragging para corrigir erro ACL do drag-region - Adiciona logging detalhado no ChatHubWidget para debug de clicks - Adiciona logging no comando open_chat_window para diagnostico - Ajusta ordem size/position e set_ignore_cursor_events no Hub - Remove set_hub_minimized apos build para evitar conflitos de timing 🤖 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
0cdbc082ab
commit
6430d33c7c
5 changed files with 54 additions and 13 deletions
|
|
@ -39,11 +39,21 @@ export function ChatHubWidget() {
|
|||
return () => window.removeEventListener("resize", handler)
|
||||
}, [])
|
||||
|
||||
// DEBUG: Detectar se a janela esta em modo click-through
|
||||
useEffect(() => {
|
||||
const onDown = (e: PointerEvent) => console.log("POINTER DOWN HUB", e.target)
|
||||
window.addEventListener("pointerdown", onDown)
|
||||
return () => window.removeEventListener("pointerdown", onDown)
|
||||
}, [])
|
||||
|
||||
const handleSelectSession = async (ticketId: string, ticketRef: number) => {
|
||||
console.log("handleSelectSession CALLED", { ticketId, ticketRef })
|
||||
try {
|
||||
await invoke("open_chat_window", { ticketId, ticketRef })
|
||||
// Tauri 2.x auto-converts snake_case (Rust) to camelCase (JS)
|
||||
const result = await invoke("open_chat_window", { ticketId, ticketRef })
|
||||
console.log("open_chat_window SUCCESS", result)
|
||||
} catch (err) {
|
||||
console.error("Erro ao abrir janela de chat:", err)
|
||||
console.error("open_chat_window FAILED:", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,11 +67,13 @@ export function ChatHubWidget() {
|
|||
}
|
||||
|
||||
const handleExpand = async () => {
|
||||
console.log("handleExpand CALLED")
|
||||
try {
|
||||
await invoke("set_hub_minimized", { minimized: false })
|
||||
const result = await invoke("set_hub_minimized", { minimized: false })
|
||||
console.log("set_hub_minimized SUCCESS", result)
|
||||
setTimeout(() => setIsMinimized(false), 100)
|
||||
} catch (err) {
|
||||
console.error("Erro ao expandir hub:", err)
|
||||
console.error("set_hub_minimized FAILED:", err)
|
||||
setIsMinimized(false)
|
||||
}
|
||||
}
|
||||
|
|
@ -114,7 +126,14 @@ export function ChatHubWidget() {
|
|||
return (
|
||||
<div className="pointer-events-none flex h-full w-full items-end justify-end bg-transparent pr-3">
|
||||
<button
|
||||
onClick={handleExpand}
|
||||
onClick={(e) => {
|
||||
console.log("EXPAND BUTTON CLICKED")
|
||||
e.stopPropagation()
|
||||
handleExpand()
|
||||
}}
|
||||
onPointerDown={(e) => console.log("EXPAND POINTER DOWN", e.target)}
|
||||
onMouseDown={(e) => console.log("EXPAND MOUSE DOWN", e.target)}
|
||||
onMouseUp={(e) => console.log("EXPAND MOUSE UP", e.target)}
|
||||
className="pointer-events-auto relative flex items-center gap-2 rounded-full bg-black px-4 py-2 text-white shadow-lg hover:bg-black/90"
|
||||
>
|
||||
<MessageCircle className="size-4" />
|
||||
|
|
@ -193,9 +212,16 @@ function SessionItem({
|
|||
session: MachineSession
|
||||
onClick: () => void
|
||||
}) {
|
||||
const handleClick = (e: React.MouseEvent) => {
|
||||
console.log("SESSION ITEM CLICKED", session.ticketRef)
|
||||
e.stopPropagation()
|
||||
onClick()
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={onClick}
|
||||
onClick={handleClick}
|
||||
onPointerDown={() => console.log("SESSION POINTER DOWN", session.ticketRef)}
|
||||
className="flex w-full items-center gap-3 rounded-xl p-3 text-left transition hover:bg-slate-50"
|
||||
>
|
||||
{/* Avatar */}
|
||||
|
|
|
|||
|
|
@ -1115,9 +1115,9 @@ const resolvedAppUrl = useMemo(() => {
|
|||
// Abre/minimiza chat quando aparecem novas não lidas
|
||||
if (hasSessions && totalUnread > prevUnread) {
|
||||
const session = payload.sessions[0]
|
||||
invoke("open_chat_window", { ticket_id: session.ticketId, ticket_ref: session.ticketRef }).catch(console.error)
|
||||
invoke("open_chat_window", { ticketId: session.ticketId, ticketRef: session.ticketRef }).catch(console.error)
|
||||
// Minimiza para não ser intrusivo
|
||||
invoke("set_chat_minimized", { ticket_id: session.ticketId, minimized: true }).catch(console.error)
|
||||
invoke("set_chat_minimized", { ticketId: session.ticketId, minimized: true }).catch(console.error)
|
||||
}
|
||||
|
||||
prevUnread = totalUnread
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue