From 8db7c3c81031d00025aac90ebc9f6440580b6dfd Mon Sep 17 00:00:00 2001 From: Seu Nome Date: Mon, 8 Dec 2025 17:05:34 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20adiciona=20Card=20ao=20hist=C3=B3rico=20?= =?UTF-8?q?de=20chat=20e=20lint=20no=20deploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Histórico de chat: - Adiciona Card branco igual à linha do tempo - Corrige acentuações (Histórico, sessão, sessões) CI/CD: - Adiciona step de lint antes do build no workflow de deploy - Se o lint falhar, o deploy é cancelado (fail fast) - Evita que código com erros de lint seja deployado 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci-cd-web-desktop.yml | 9 +++ .../tickets/ticket-chat-history.tsx | 76 ++++++++++--------- 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci-cd-web-desktop.yml b/.github/workflows/ci-cd-web-desktop.yml index 886d0b9..d4f6567 100644 --- a/.github/workflows/ci-cd-web-desktop.yml +++ b/.github/workflows/ci-cd-web-desktop.yml @@ -226,6 +226,15 @@ jobs: restore-keys: | ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml', 'bun.lock') }}- + - name: Lint check (fail fast before build) + run: | + cd "$EFFECTIVE_APP_DIR" + docker run --rm \ + -v "$EFFECTIVE_APP_DIR":/app \ + -w /app \ + sistema_web:node22-bun \ + bash -lc "set -euo pipefail; bun install --frozen-lockfile --filter '!appsdesktop'; bun run lint" + - name: Install and build (Next.js) env: PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING: "1" diff --git a/src/components/tickets/ticket-chat-history.tsx b/src/components/tickets/ticket-chat-history.tsx index 99a4695..6ca63ff 100644 --- a/src/components/tickets/ticket-chat-history.tsx +++ b/src/components/tickets/ticket-chat-history.tsx @@ -8,6 +8,7 @@ import { api } from "@/convex/_generated/api" import type { Id } from "@/convex/_generated/dataModel" import { useAuth } from "@/lib/auth-client" import { Button } from "@/components/ui/button" +import { Card, CardContent } from "@/components/ui/card" import { Spinner } from "@/components/ui/spinner" import { cn } from "@/lib/utils" import { @@ -147,7 +148,7 @@ function ChatSessionCard({ session, isExpanded, onToggle }: { session: ChatSessi return (
- {/* Header da sessao */} + {/* Header da sessão */}
{isExpanded ? ( @@ -308,7 +309,7 @@ function DayGroupCard({ )} - {/* Sessoes do dia */} + {/* Sessões do dia */} {isExpanded && (
{dayGroup.sessions.map((session) => ( @@ -405,46 +406,47 @@ export function TicketChatHistory({ ticketId }: ChatHistoryProps) { setVisibleDays((prev) => prev + DAYS_PER_PAGE) } - // Nao mostrar se nao ha historico + // Não mostrar se não há histórico if (!chatHistory || chatHistory.sessions.length === 0) { return null } return ( -
- {/* Header */} -
-
- -

Historico de chat

+ + + {/* Header */} +
+
+

Histórico de chat

+

+ {chatHistory.sessions.length} {chatHistory.sessions.length === 1 ? "sessão" : "sessões"} - {chatHistory.totalMessages} mensagens +

+
- - {chatHistory.sessions.length} {chatHistory.sessions.length === 1 ? "sessao" : "sessoes"} - {chatHistory.totalMessages} mensagens - -
- {/* Grupos por dia */} -
- {displayedDays.map((dayGroup) => ( - toggleDay(dayGroup.dateKey)} - expandedSessions={expandedSessions} - onToggleSession={toggleSession} - /> - ))} -
- - {/* Carregar mais dias */} - {hasMoreDays && ( -
- + {/* Grupos por dia */} +
+ {displayedDays.map((dayGroup) => ( + toggleDay(dayGroup.dateKey)} + expandedSessions={expandedSessions} + onToggleSession={toggleSession} + /> + ))}
- )} -
+ + {/* Carregar mais dias */} + {hasMoreDays && ( +
+ +
+ )} + + ) }