feat(desktop): adiciona hub de chats para multiplas sessoes

- Cria ChatSessionList, ChatSessionItem e ChatHubWidget no desktop
- Adiciona comandos Rust para gerenciar hub window
- Quando ha multiplas sessoes, abre hub ao inves de janela individual
- Hub lista todas as sessoes ativas com badge de nao lidos
- Clicar em sessao abre/foca janela de chat especifica
- Menu do tray abre hub quando ha multiplas sessoes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rever-tecnologia 2025-12-15 12:13:47 -03:00
parent 95ab1b5f0c
commit 29fbbfaa26
6 changed files with 560 additions and 38 deletions

View file

@ -1,21 +1,22 @@
import { ChatWidget } from "./ChatWidget"
import { ChatHubWidget } from "./ChatHubWidget"
export function ChatApp() {
// Obter ticketId e ticketRef da URL
const params = new URLSearchParams(window.location.search)
const ticketId = params.get("ticketId")
const ticketRef = params.get("ticketRef")
const isHub = params.get("hub") === "true"
if (!ticketId) {
return (
<div className="flex h-screen flex-col items-center justify-center bg-white p-4">
<p className="text-sm text-red-600">Erro: ticketId não fornecido</p>
</div>
)
// Modo hub - lista de todas as sessoes
if (isHub || !ticketId) {
return <ChatHubWidget />
}
// Modo chat - conversa de um ticket especifico
return <ChatWidget ticketId={ticketId} ticketRef={ticketRef ? Number(ticketRef) : undefined} />
}
export { ChatWidget }
export { ChatHubWidget }
export * from "./types"