style(ui): família visual de IA local
This commit is contained in:
1 parent
f0b7db8c12
commit
07b0eaadca
62 files changed
+918
-853
No files matched your search
+35
-33
@@ -1051,12 +1051,12 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
defaultSize={4}
|
||||
minSize={4}
|
||||
maxSize={4}
|
||||
className="border-r flex flex-col items-center py-4 gap-4 bg-muted/20 w-[60px] min-w-[60px] max-w-[60px] flex-shrink-0"
|
||||
className="border-r flex flex-col items-center py-4 gap-2 bg-surface w-[60px] min-w-[60px] max-w-[60px] flex-shrink-0"
|
||||
>
|
||||
<Button variant="ghost" size="icon" className="rounded-lg bg-primary/10 text-primary">
|
||||
<Button variant="ghost" size="icon" className="bg-accent-soft text-foreground hover:bg-accent-soft" aria-label="Chat" aria-current="page">
|
||||
<MessageSquare className="w-5 h-5" />
|
||||
</Button>
|
||||
<Button variant="ghost" size="icon" className="rounded-lg text-muted-foreground hover:text-foreground">
|
||||
<Button variant="ghost" size="icon" className="text-muted-foreground hover:text-foreground" aria-label="Servidor">
|
||||
<Server className="w-5 h-5" />
|
||||
</Button>
|
||||
<div className="flex-1" />
|
||||
@@ -1064,14 +1064,16 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
|
||||
className="rounded-lg text-muted-foreground hover:text-foreground"
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
aria-label="Alternar tema"
|
||||
>
|
||||
{mounted ? (theme === "dark" ? <Sun className="w-5 h-5" /> : <Moon className="w-5 h-5" />) : null}
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="rounded-lg text-muted-foreground hover:text-foreground"
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
aria-label="Configurações"
|
||||
onClick={() => router.push('/settings')}
|
||||
>
|
||||
<Settings className="w-5 h-5" />
|
||||
@@ -1119,10 +1121,10 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
<ResizableHandle className="hidden md:block" />
|
||||
|
||||
{/* Main Chat Area */}
|
||||
<ResizablePanel defaultSize={100} minSize={75} className="transition-all duration-300">
|
||||
<ResizablePanel defaultSize={100} minSize={75}>
|
||||
<div className="h-full flex flex-col">
|
||||
{/* Header */}
|
||||
<div className="h-14 border-b flex items-center px-3 sm:px-4 justify-between bg-background/50 backdrop-blur gap-2 sm:gap-4 flex-shrink-0" style={{ paddingLeft: 'clamp(12px, 2vw, 16px)', paddingRight: 'clamp(12px, 2vw, 16px)' }}>
|
||||
<div className="h-14 border-b flex items-center px-3 sm:px-4 justify-between bg-background gap-2 sm:gap-4 flex-shrink-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
@@ -1137,13 +1139,13 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
<PanelLeftClose className="w-4 h-4" />
|
||||
)}
|
||||
</Button>
|
||||
<div className="font-semibold flex items-center gap-2 text-sm sm:text-base">
|
||||
<div className="font-semibold flex items-center gap-2 text-sm">
|
||||
<span className="hidden sm:inline">Chat</span>
|
||||
{isGeneratingTitle && <Loader2 className="w-3 h-3 animate-spin text-muted-foreground" />}
|
||||
{isGeneratingTitle && <Loader2 className="w-3 h-3 animate-spin text-primary" />}
|
||||
{isDownloading && (
|
||||
<span className="text-xs text-muted-foreground flex items-center gap-1">
|
||||
<Loader2 className="w-3 h-3 animate-spin" />
|
||||
{progress}
|
||||
<Loader2 className="w-3 h-3 animate-spin text-primary" />
|
||||
<span className="font-mono">{progress}</span>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -1197,7 +1199,7 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
)}
|
||||
</Tooltip>
|
||||
))}
|
||||
<SelectItem value="__add_model__" className="text-primary font-medium">
|
||||
<SelectItem value="__add_model__" className="font-medium">
|
||||
<span className="flex items-center gap-2">
|
||||
<Plus className="h-4 w-4" />
|
||||
Adicionar modelo...
|
||||
@@ -1221,7 +1223,7 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
className="flex-1 overflow-y-auto scroll-smooth w-full min-h-0"
|
||||
onScroll={handleScroll}
|
||||
>
|
||||
<div className="max-w-3xl mx-auto w-full px-3 sm:px-4 md:px-6 pt-4 sm:pt-6 pb-4 transition-all duration-300" style={{ paddingLeft: 'clamp(12px, 4vw, 24px)', paddingRight: 'clamp(12px, 4vw, 24px)' }}>
|
||||
<div className="max-w-3xl mx-auto w-full px-3 sm:px-4 md:px-6 pt-4 sm:pt-6 pb-4">
|
||||
{/* Indicador de carregamento de mensagens antigas */}
|
||||
{paginationState.isLoadingMore && (
|
||||
<div className="flex items-center justify-center py-4 mb-4">
|
||||
@@ -1233,19 +1235,19 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
{/* Indicador de que há mais mensagens para carregar */}
|
||||
{paginationState.hasMore && !paginationState.isLoadingMore && messages.length > 0 && (
|
||||
<div className="flex items-center justify-center py-2 mb-4">
|
||||
<span className="text-xs text-muted-foreground/60">
|
||||
<span className="text-xs text-muted-foreground">
|
||||
Role para cima para ver mensagens anteriores ({paginationState.totalCount - messages.length} restantes)
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{messages.length === 0 ? (
|
||||
<div className="min-h-[50vh] flex flex-col items-center justify-center text-muted-foreground space-y-6">
|
||||
<div className="p-6 rounded-2xl bg-muted/30 ring-1 ring-border/50 shadow-sm">
|
||||
<MessageSquare className="w-8 h-8 text-primary/60" />
|
||||
<div className="min-h-[50vh] flex flex-col items-center justify-center text-muted-foreground gap-6">
|
||||
<div className="p-4 rounded-lg border bg-surface">
|
||||
<MessageSquare className="w-8 h-8 text-muted-foreground" />
|
||||
</div>
|
||||
<div className="text-center space-y-2">
|
||||
<p className="text-lg font-medium text-primary/80">Como posso ajudar você hoje?</p>
|
||||
<p className="text-lg font-medium text-foreground">Como posso ajudar você hoje?</p>
|
||||
<p className="text-sm text-muted-foreground">Selecione um modelo e comece uma conversa.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1392,7 +1394,7 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
|
||||
{/* Debug Info (Moved inside scroll) */}
|
||||
{(deepResearch.state.logs.length > 0 || lastWebContext) && (
|
||||
<div className="mt-12 pt-6 border-t border-dashed border-muted/50 opacity-70 hover:opacity-100 transition-opacity">
|
||||
<div className="mt-12 pt-6 border-t border-dashed border-border">
|
||||
<div className="space-y-4">
|
||||
{/* Process Log Toggle */}
|
||||
{deepResearch.state.logs.length > 0 && (
|
||||
@@ -1400,22 +1402,22 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowProcessDebug((prev) => !prev)}
|
||||
className="flex items-center gap-2 text-xs font-medium text-muted-foreground hover:text-primary transition-colors"
|
||||
className="flex items-center gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors duration-150"
|
||||
>
|
||||
<ScrollText className="w-3 h-3" />
|
||||
Debug: Processo de Pensamento
|
||||
<ChevronDown className={`w-3 h-3 transition-transform ${showProcessDebug ? 'rotate-180' : ''}`} />
|
||||
</button>
|
||||
{showProcessDebug && (
|
||||
<div className="mt-2 space-y-2 p-4 rounded-lg bg-muted/30 text-xs border border-muted/50 max-h-60 overflow-y-auto">
|
||||
<div className="mt-2 space-y-2 p-4 rounded-lg bg-surface text-xs border max-h-60 overflow-y-auto">
|
||||
<div className="flex justify-end mb-2">
|
||||
<Button variant="ghost" size="sm" onClick={handleCopyLogs} className="h-6 px-2 text-[10px]">
|
||||
<Button variant="ghost" size="sm" onClick={handleCopyLogs} className="h-8 px-2 text-xs">
|
||||
{logsCopied ? <Check className="w-3 h-3 mr-1" /> : <Copy className="w-3 h-3 mr-1" />} Copiar Logs
|
||||
</Button>
|
||||
</div>
|
||||
{deepResearch.state.logs.map((log, idx) => (
|
||||
<div key={idx} className="grid grid-cols-[60px_1fr] gap-2 border-b border-muted/20 pb-2 last:border-0">
|
||||
<span className="text-muted-foreground uppercase text-[10px]">{log.stage}</span>
|
||||
<div key={idx} className="grid grid-cols-[60px_1fr] gap-2 border-b border-border/60 pb-2 last:border-0">
|
||||
<span className="font-mono text-muted-foreground text-xs">{log.stage}</span>
|
||||
<span>{log.input ? (log.input.length > 50 ? log.input.substring(0, 50) + '...' : log.input) : '-'}</span>
|
||||
</div>
|
||||
))}
|
||||
@@ -1430,22 +1432,22 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowContextDebug((prev) => !prev)}
|
||||
className="flex items-center gap-2 text-xs font-medium text-muted-foreground hover:text-primary transition-colors"
|
||||
className="flex items-center gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors duration-150"
|
||||
>
|
||||
<Globe className="w-3 h-3" />
|
||||
Debug: Contexto Web ({lastContextSources.length} fontes)
|
||||
<ChevronDown className={`w-3 h-3 transition-transform ${showContextDebug ? 'rotate-180' : ''}`} />
|
||||
</button>
|
||||
{showContextDebug && (
|
||||
<div className="mt-2 p-4 rounded-lg bg-muted/30 text-xs border border-muted/50 space-y-3">
|
||||
<div className="mt-2 p-4 rounded-lg bg-surface text-xs border space-y-3">
|
||||
<div className="max-h-32 overflow-y-auto space-y-1">
|
||||
{lastContextSources.map((s, i) => (
|
||||
<a key={i} href={s.url} target="_blank" className="block hover:underline text-primary truncate">{s.title || s.url}</a>
|
||||
<a key={i} href={s.url} target="_blank" className="block underline-offset-2 hover:underline text-foreground truncate">{s.title || s.url}</a>
|
||||
))}
|
||||
</div>
|
||||
<div className="border-t border-muted/20 pt-2">
|
||||
<div className="border-t border-border pt-2">
|
||||
<p className="mb-1 font-semibold">Preview Contexto:</p>
|
||||
<pre className="max-h-32 overflow-y-auto p-2 bg-background rounded border text-[10px]">{lastWebContext.substring(0, 500)}...</pre>
|
||||
<pre className="max-h-32 overflow-y-auto p-2 bg-background rounded-sm border text-xs">{lastWebContext.substring(0, 500)}...</pre>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -1466,7 +1468,7 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
<div className="absolute inset-0 -top-20 bg-gradient-to-t from-background via-background/90 to-transparent pointer-events-none" />
|
||||
|
||||
{/* Input Wrapper */}
|
||||
<div className="relative max-w-3xl mx-auto px-3 sm:px-4 md:px-6 pb-4 sm:pb-6 pt-4 pointer-events-auto transition-all duration-300" style={{ paddingLeft: 'clamp(12px, 4vw, 24px)', paddingRight: 'clamp(12px, 4vw, 24px)' }}>
|
||||
<div className="relative max-w-3xl mx-auto px-3 sm:px-4 md:px-6 pb-4 sm:pb-6 pt-4 pointer-events-auto">
|
||||
<ChatInput
|
||||
onSend={handleSend}
|
||||
onStop={stop}
|
||||
@@ -1481,7 +1483,7 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
}}
|
||||
/>
|
||||
<div className="text-center mt-2">
|
||||
<p className="text-[10px] text-muted-foreground/60">OllaHub pode cometer erros. Verifique informações importantes.</p>
|
||||
<p className="text-xs text-muted-foreground">OllaHub pode cometer erros. Verifique informações importantes.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1495,13 +1497,13 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
|
||||
{!isChatsSidebarCollapsed && (
|
||||
<>
|
||||
<div
|
||||
className="fixed inset-0 bg-black/50 z-40 md:hidden transition-opacity"
|
||||
className="fixed inset-0 bg-scrim z-40 md:hidden"
|
||||
onClick={() => {
|
||||
setIsChatsSidebarCollapsed(true);
|
||||
chatsSidebarRef.current?.collapse();
|
||||
}}
|
||||
/>
|
||||
<div className="fixed left-0 top-0 bottom-0 w-[280px] min-w-[220px] max-w-[85vw] bg-background border-r z-50 md:hidden shadow-xl animate-in slide-in-from-left duration-300 overflow-y-auto">
|
||||
<div className="fixed left-0 top-0 bottom-0 w-[280px] min-w-[220px] max-w-[85vw] bg-surface border-r z-50 md:hidden shadow-float animate-in slide-in-from-left duration-200 ease-out overflow-y-auto">
|
||||
<SidebarList
|
||||
sessions={sessions}
|
||||
currentSessionId={currentSessionId}
|
||||
|
||||
Reference in new issue
Block a user