From fdae8beb06c64840316127ca3c1affb0b8e1c54c Mon Sep 17 00:00:00 2001 From: VPS 4 Deploy Agent Date: Sun, 28 Jun 2026 06:32:58 +0200 Subject: [PATCH] =?UTF-8?q?feat(inbox):=20prioriza=20nome=20da=20agenda=20?= =?UTF-8?q?+=20=C3=ADcone=20Secret=C3=A1ria=20na=20ThinSidebar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Nome exibido: contact.name (agenda) → verifiedName/notify (nome do WhatsApp) → pushName da última msg, em vez de cair direto no número quando não há nome salvo na agenda. - ThinSidebar: ícone (BrainCircuit) que direciona para /secretaria. Co-Authored-By: Claude Opus 4.8 --- .../newwhats.local/frontend/components/ThinSidebar.tsx | 9 +++++++++ .../newwhats.local/frontend/store/chatStore.ts | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/newwhats.clube67.com/newwhats.local/frontend/components/ThinSidebar.tsx b/newwhats.clube67.com/newwhats.local/frontend/components/ThinSidebar.tsx index 3f6176c..eeda15f 100644 --- a/newwhats.clube67.com/newwhats.local/frontend/components/ThinSidebar.tsx +++ b/newwhats.clube67.com/newwhats.local/frontend/components/ThinSidebar.tsx @@ -4,6 +4,7 @@ import { Megaphone, Users, Settings, + BrainCircuit, } from 'lucide-react'; import { getAvatarProxyUrl } from '../utils/inboxUtils'; import { useRouter } from 'next/router'; @@ -52,6 +53,14 @@ export default function ThinSidebar({ activeTab, setActiveTab, activeInstance }: {renderIcon('chats', MessageCircle, 'Conversas')} {renderIcon('broadcasts', Megaphone, 'Transmissões')} {renderIcon('groups', Users, 'Sessões')} + {/* Secretária IA — abre a tela de configuração da secretária virtual */} + {/* Bottom Icons */} diff --git a/newwhats.clube67.com/newwhats.local/frontend/store/chatStore.ts b/newwhats.clube67.com/newwhats.local/frontend/store/chatStore.ts index 11b1024..501e978 100644 --- a/newwhats.clube67.com/newwhats.local/frontend/store/chatStore.ts +++ b/newwhats.clube67.com/newwhats.local/frontend/store/chatStore.ts @@ -22,7 +22,14 @@ function mapBackendChat(raw: any): Chat { createdAt: raw.createdAt ?? null, isPinned: raw.isPinned ?? false, isArchived: raw.isArchived ?? false, - contactName: raw.contact?.name ?? raw.contactName ?? null, + // Prioridade do nome: agenda (contact.name) → nome do WhatsApp + // (verifiedName de Business → notify/pushName) → pushName da última msg. + contactName: raw.contact?.name + ?? raw.contact?.verifiedName + ?? raw.contact?.notify + ?? raw.contactName + ?? raw.lastMessage?.pushName + ?? null, contactAvatarUrl: raw.contact?.avatarUrl ?? raw.contactAvatarUrl ?? null, contactAvatarVersion: raw.contact?.avatarVersion ?? raw.contactAvatarVersion ?? null, contactPhone: raw.contact?.phone ?? raw.contactPhone ?? null,