-
Notifications
You must be signed in to change notification settings - Fork 0
Auditoria wip 20260503 #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
21d3485
03644de
6c13d53
b2a0a39
8a7e228
1352972
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| import { useState } from 'react'; | ||
| import { Mail, Settings, Key, Clock, Signature, Bell, Shield, Info, Wifi, Plus, Building2, RefreshCw } from 'lucide-react'; | ||
| import { Eye } from 'lucide-react'; // tracking icon | ||
| import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card'; | ||
| import { Button } from '@/components/ui/button'; | ||
| import { Input } from '@/components/ui/input'; | ||
|
|
@@ -8,6 +9,7 @@ import { Switch } from '@/components/ui/switch'; | |
| import { Separator } from '@/components/ui/separator'; | ||
| import { Badge } from '@/components/ui/badge'; | ||
| import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; | ||
| import { EmailTrackingDashboard } from './EmailTrackingDashboard'; | ||
| import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; | ||
| import { Alert, AlertDescription } from '@/components/ui/alert'; | ||
| import { GmailAccountSelector } from '@/components/gmail/GmailAccountSelector'; | ||
|
|
@@ -66,7 +68,7 @@ export function EmailSettingsPage() { | |
| </div> | ||
|
|
||
| <Tabs defaultValue="accounts"> | ||
| <TabsList className="grid w-full grid-cols-5"> | ||
| <TabsList className="grid w-full grid-cols-6"> | ||
| <TabsTrigger value="accounts" className="gap-1.5 text-xs"> | ||
| <Key className="h-3.5 w-3.5" />Gmail | ||
| </TabsTrigger> | ||
|
|
@@ -80,9 +82,10 @@ export function EmailSettingsPage() { | |
| <Clock className="h-3.5 w-3.5" />SLA | ||
| </TabsTrigger> | ||
| <TabsTrigger value="imap" className="gap-1.5 text-xs"> | ||
| <Wifi className="h-3.5 w-3.5" />IMAP/SMTP | ||
| <TabsTrigger value="tracking" className="gap-1.5 text-xs"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In the settings tabs list, the new tracking trigger is opened before the existing Useful? React with 👍 / 👎. |
||
| <Eye className="h-3.5 w-3.5" /> Rastreio | ||
| </TabsTrigger> | ||
| </TabsList> | ||
| <Wifi className="h-3.5 w-3.5" />IMAP/SMTP | ||
|
|
||
| {/* ── Tab: Gmail ─────────────────────────────────────────────── */} | ||
|
Comment on lines
70
to
90
|
||
| <TabsContent value="accounts" className="space-y-6"> | ||
|
|
@@ -345,6 +348,10 @@ export function EmailSettingsPage() { | |
| </CardContent> | ||
| </Card> | ||
| </TabsContent> | ||
| {/* ── Tab: Rastreio ─────────────────────────────────────────── */} | ||
| <TabsContent value="tracking" className="space-y-6"> | ||
| <EmailTrackingDashboard /> | ||
| </TabsContent> | ||
| </Tabs> | ||
| </div> | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||
| import { useState, useRef, useCallback } from 'react'; | ||||||
| import { useState as useStateRender } from 'react'; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Import duplicado e não utilizado.
🧹 Remover import não utilizado import { useState, useRef, useCallback } from 'react';
-import { useState as useStateRender } from 'react';📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| import { cn } from '@/lib/utils'; | ||||||
| import { motion, AnimatePresence } from 'framer-motion'; | ||||||
| import { Star, Trash2, Sticker, Plus, Loader2, Clock } from 'lucide-react'; | ||||||
|
|
@@ -39,8 +40,14 @@ export function StickerGrid({ | |||||
| }: StickerGridProps) { | ||||||
| const [deleteTarget, setDeleteTarget] = useState<StickerItem | null>(null); | ||||||
| const [hoveredId, setHoveredId] = useState<string | null>(null); | ||||||
| const [visibleCount, setVisibleCount] = useState(48); | ||||||
| const loadMoreRef = useRef<HTMLDivElement>(null); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
O ref é criado mas nunca referenciado no componente. Parece ser um resíduo de implementação incompleta de scroll infinito. 🧹 Remover ref não utilizado const [visibleCount, setVisibleCount] = useState(48);
- const loadMoreRef = useRef<HTMLDivElement>(null);
const gridRef = useRef<HTMLDivElement>(null);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| const gridRef = useRef<HTMLDivElement>(null); | ||||||
|
|
||||||
| // GAP 14: Progressive rendering - load more stickers as user scrolls | ||||||
| const visibleStickers = stickers.slice(0, visibleCount); | ||||||
| const hasMoreToShow = stickers.length > visibleCount; | ||||||
|
|
||||||
| const handleKeyDown = useCallback((e: React.KeyboardEvent, sticker: StickerItem) => { | ||||||
| if (e.key === 'Enter' || e.key === ' ') { | ||||||
| e.preventDefault(); | ||||||
|
|
@@ -63,8 +70,14 @@ export function StickerGrid({ | |||||
|
|
||||||
| if (loading) { | ||||||
| return ( | ||||||
| <div className="flex items-center justify-center py-12" role="status" aria-label="Carregando figurinhas"> | ||||||
| <Loader2 className="w-6 h-6 text-muted-foreground animate-spin" /> | ||||||
| <div className="grid grid-cols-4 gap-2 p-2" role="status" aria-label="Carregando figurinhas"> | ||||||
| {Array.from({ length: 12 }).map((_, i) => ( | ||||||
| <div | ||||||
| key={i} | ||||||
| className="aspect-square rounded-lg bg-muted animate-pulse" | ||||||
| style={{ animationDelay: `${i * 50}ms` }} | ||||||
| /> | ||||||
| ))} | ||||||
| <span className="sr-only">Carregando figurinhas...</span> | ||||||
| </div> | ||||||
| ); | ||||||
|
|
@@ -98,7 +111,7 @@ export function StickerGrid({ | |||||
| <div className="p-2" ref={gridRef} role="grid" aria-label="Grade de figurinhas"> | ||||||
| <div className={cn('grid gap-1.5', gridColsMap[gridSize])}> | ||||||
| <AnimatePresence> | ||||||
| {stickers.map((sticker, idx) => ( | ||||||
| {visibleStickers.map((sticker, idx) => ( | ||||||
| <Tooltip key={sticker.id}> | ||||||
| <TooltipTrigger asChild> | ||||||
| <motion.button | ||||||
|
|
@@ -198,6 +211,14 @@ export function StickerGrid({ | |||||
| </Tooltip> | ||||||
| ))} | ||||||
| </AnimatePresence> | ||||||
| {hasMoreToShow && ( | ||||||
| <button | ||||||
| onClick={() => setVisibleCount(prev => prev + 48)} | ||||||
| className="col-span-full py-2 text-xs text-primary hover:underline" | ||||||
| > | ||||||
| Carregar mais ({stickers.length - visibleCount} restantes) | ||||||
| </button> | ||||||
| )} | ||||||
| </div> | ||||||
| </div> | ||||||
| </ScrollArea> | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incompatibilidade de assinatura:
gmailModifyLabelsespera argumentos posicionais, não objeto.A função
gmailModifyLabelsemgmailApi.ts(linhas 301-309) tem assinatura posicional:Mas aqui está sendo chamada com objeto. O cast
as Functionesconde o erro de tipos, e em runtime o_accountIdreceberá o objeto inteiro.🐛 Correção proposta
const handleToggleStar = async () => { const wasStarred = isStarred; setIsStarred(!wasStarred); try { - await (gmailModifyLabels as Function)({ - accountId, - messageId: (message as Record<string, unknown>).message_id as string, - addLabels: wasStarred ? [] : ['STARRED'], - removeLabels: wasStarred ? ['STARRED'] : [], - }); + await gmailModifyLabels( + accountId, + message.message_id, + wasStarred ? [] : ['STARRED'], + wasStarred ? ['STARRED'] : [], + ); } catch { setIsStarred(wasStarred); } };🤖 Prompt for AI Agents