From 07b0eaadca71f9a7969b764992b669904508e6c6 Mon Sep 17 00:00:00 2001 From: Evandro Fonseca Junior Date: Mon, 16 Nov 2026 00:42:44 -0300 Subject: [PATCH] =?UTF-8?q?style(ui):=20fam=C3=ADlia=20visual=20de=20IA=20?= =?UTF-8?q?local?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DESIGN.md | 82 ++++ app/chat/page.tsx | 68 ++-- app/globals.css | 366 ++++++++---------- app/layout.tsx | 17 +- app/page.tsx | 12 +- app/settings/page.tsx | 38 +- app/setup/page.tsx | 8 +- app/tasks/page.tsx | 20 +- components/chat/chat-input.tsx | 45 +-- components/chat/chat-message.tsx | 47 +-- components/chat/code-block.tsx | 12 +- components/chat/error-display.tsx | 16 +- components/chat/markdown-renderers.tsx | 20 +- components/chat/mcp-json-editor.tsx | 8 +- components/chat/mcp-server-selector.tsx | 4 +- components/chat/message-actions.tsx | 14 +- components/chat/message-background.tsx | 6 +- components/chat/message-step-thinking.tsx | 51 +-- components/chat/model-download-dialog.tsx | 14 +- components/chat/post-processing-panel.tsx | 27 +- components/chat/processing-indicator.tsx | 53 +-- components/chat/prompt-generator.tsx | 2 +- components/chat/reasoning-chain.tsx | 36 +- components/chat/search-progress.tsx | 10 +- components/chat/sidebar-list.tsx | 51 +-- components/chat/sources-carousel.tsx | 10 +- components/chat/sources-compact.tsx | 10 +- components/chat/sources-display.tsx | 20 +- components/chat/streaming-indicator.tsx | 5 +- components/chat/system-panel.tsx | 6 +- components/chat/thinking-indicator.tsx | 10 +- components/chat/web-search-status.tsx | 30 +- components/landing/hero.tsx | 14 +- components/landing/stopped-card.tsx | 19 +- components/modals/install-modal.tsx | 67 ++-- components/modals/update-dialog.tsx | 8 +- .../notifications/welcome-notification.tsx | 11 +- components/python-bootstrap-progress.tsx | 4 +- components/scraping-progress-indicator.tsx | 20 +- components/settings/GpuDashboard.tsx | 18 +- components/settings/HardwareDashboard.tsx | 16 +- components/setup/gpu-selector.tsx | 19 +- components/setup/hardware-scan.tsx | 10 +- components/setup/model-selector.tsx | 8 +- components/titlebar.tsx | 16 +- components/ui/badge.tsx | 10 +- components/ui/button.tsx | 14 +- components/ui/card.tsx | 2 +- components/ui/checkbox.tsx | 2 +- components/ui/dialog.tsx | 8 +- components/ui/dropdown-menu.tsx | 18 +- components/ui/input.tsx | 2 +- components/ui/progress.tsx | 4 +- components/ui/resizable.tsx | 2 +- components/ui/select.tsx | 12 +- components/ui/slider.tsx | 2 +- components/ui/switch.tsx | 4 +- components/ui/tabs.tsx | 4 +- components/ui/textarea.tsx | 2 +- components/ui/tooltip.tsx | 2 +- package.json | 1 + pnpm-lock.yaml | 334 +++++++++------- 62 files changed, 918 insertions(+), 853 deletions(-) create mode 100644 DESIGN.md diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 0000000..729fb09 --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,82 @@ +# OllaHub — sistema visual +Derivado de `specs/DESIGN-familia.md` (família visual dos apps de IA local, 2026-11-16). Em caso de dúvida, a família manda. + +Leitura: refino · Operate · web (Next 16 + Tailwind v4 + shadcn). Identidade, comportamento, copy e layout continuam os mesmos: muda o sistema, não a estrutura das telas. + +## Princípios +1. Ferramenta local, sem cerimônia: o conteúdo (conversa, modelo) domina e o cromo some. +2. Acento num lugar só por tela: ação primária, foco, item ativo e o indicador de "gerando". Nunca em fundo grande, gradiente ou decoração. +3. Dados técnicos (modelo, endpoint, porta, tokens, tempo) em mono; todo o resto em sans. + +## Cor (OKLCH) +Neutros com leve tom frio, matiz 265. + +| Papel | Escuro (padrão) | Claro | +|---|---|---| +| `bg` | oklch(0.16 0.008 265) | oklch(0.99 0.003 265) | +| `surface` | oklch(0.20 0.009 265) | oklch(0.97 0.004 265) | +| `elevated` (menu, modal) | oklch(0.24 0.010 265) | oklch(1 0 0) | +| `hover` | oklch(0.28 0.010 265) | oklch(0.94 0.005 265) | +| `border` | oklch(0.32 0.010 265) | oklch(0.90 0.006 265) | +| `text` | oklch(0.96 0.004 265) | oklch(0.20 0.010 265) | +| `text-2` | oklch(0.76 0.008 265) | oklch(0.42 0.010 265) | +| `text-3` (rótulo, meta) | oklch(0.64 0.010 265) | oklch(0.54 0.010 265) | +| `success` | oklch(0.74 0.15 150) | oklch(0.52 0.14 150) | +| `warning` | oklch(0.82 0.15 85) | oklch(0.60 0.13 75) | +| `danger` | oklch(0.68 0.19 25) | oklch(0.55 0.20 25) | + +Acento (`accent-fg` = texto sobre o acento; `accent-soft` = acento a 14% sobre `bg`, misturado em oklab para não desviar o matiz, usado em seleção e item ativo): + +| `accent` escuro | `accent` claro | `accent-fg` | Origem | +|---|---|---|---| +| oklch(0.80 0.16 70) âmbar | oklch(0.62 0.15 60) | oklch(0.20 0.04 60) | o #FE9A00 do OllaHubBackend | + +Contraste: `text-3` sobre `bg` e `surface` ≥ 4,5:1; `accent-fg` sobre `accent` ≥ 4,5:1. + +## Tipografia +- Geist e Geist Mono, empacotadas localmente pelo pacote `geist` (usa `next/font/local`; o app roda offline). Fallback: system-ui / ui-monospace. +- Escala 1,2 com base 14 px: `text-xs` 12 · `text-sm` 14 · `text-lg` 17 · `text-xl` 20 · `text-2xl` 24 · `text-3xl` 29. Corpo 14; mensagem do usuário 17. +- Pesos: 400 corpo, 500 rótulo de controle, 600 título. Sem caixa alta em rótulo. Entrelinha 1,5 no corpo, 1,25 nos títulos. Mensagens até 72ch. + +## Espaço, raio, sombra +- Espaçamento só da escala 4 · 8 · 12 · 16 · 20 · 24 · 32 · 40 · 48 · 64. +- Raio: `rounded-sm` 6 (chip, badge), `rounded-md` 8 (botão, input), `rounded-lg`/`rounded-xl` 12 (painel, card de mensagem, diálogo), `rounded-full` só em avatar, ponto e pill de status. +- Sombra só no que flutua (menu, popover, modal, toast): `shadow-float` = `0 1px 2px oklch(0.10 0.01 265 / 0.30), 0 8px 24px oklch(0.10 0.01 265 / 0.35)`. Cards e painéis usam borda. + +## Estados +hover (`bg-hover`), foco visível (outline de 2 px em `accent` com 2 px de offset), ativo/selecionado (`bg-accent-soft` + `text-foreground`), desabilitado (opacidade 0,45, sem hover), carregando/gerando (spinner/barra em `text-primary`/`bg-primary`, `prefers-reduced-motion` respeitado), vazio (frase com o próximo passo), erro (`text-destructive` com causa e ação). + +## Movimento +150–200 ms, ease-out (`--ease-out`), só opacidade e transform. Sem animação decorativa, sem `transition-all`, sem transição de largura. + +## Fora +Gradiente decorativo, glow, glassmorphism (`backdrop-blur`), sombra em card, emoji como ícone, o mesmo raio em tudo, cinza neutro puro, cores de paleta fixas (`green-500`, `blue-500`…). + +## Mapa de tokens (migração shadcn → família) +Os papéis da família são variáveis CSS em `app/globals.css`; os nomes do shadcn apontam para eles, sem alias extra. + +| shadcn / antigo | Papel da família | +|---|---| +| `background` | `bg` | +| `foreground` | `text` | +| `card` | `surface` | +| `popover` | `elevated` | +| `primary` | `accent` | +| `primary-foreground` | `accent-fg` | +| `secondary` | `hover` | +| `muted` | `surface` | +| `muted-foreground` | `text-3` | +| `destructive` | `danger` | +| `border`, `input` | `border` | +| `ring` | `accent` | +| `accent` antigo (fundo de hover do shadcn) | `hover` (`bg-hover`); `accent` agora é o acento da família | +| `accent-foreground` | removido; usar `text-foreground` | +| `sidebar-*` | removidos; a lista usa `surface`/`border`/`hover`/`text` | +| `chart-*`, `message-*` | removidos (exceto `message-high-contrast`) | +| `--radius` | removido; `radius-sm/md/lg/xl` = 6/8/12/12 (lg era 10, xl era 14) | +| tamanhos de texto | ajustados à escala 12/14/17/20/24/29; `text-[10px]` → `text-xs` | +| fonte | `next/font/google` → pacote `geist` (local) | +| `green/red/yellow/orange/blue-*` | `success` / `danger` / `warning` / neutro ou `accent-soft` | +| `bg-black/50` em overlays | `bg-scrim` | + +Utilitários novos do tema: `bg-surface`, `bg-elevated`, `bg-hover`, `text-text-2`, `text-success`, `text-warning`, `bg-accent-soft`, `text-accent-fg`, `bg-scrim`, `shadow-float`. diff --git a/app/chat/page.tsx b/app/chat/page.tsx index d9b6d33..f6f43a8 100644 --- a/app/chat/page.tsx +++ b/app/chat/page.tsx @@ -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" > - -
@@ -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" ? : ) : null} -
+
Chat - {isGeneratingTitle && } + {isGeneratingTitle && } {isDownloading && ( - - {progress} + + {progress} )}
@@ -1197,7 +1199,7 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente )} ))} - + 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} > -
+
{/* Indicador de carregamento de mensagens antigas */} {paginationState.isLoadingMore && (
@@ -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 && (
- + Role para cima para ver mensagens anteriores ({paginationState.totalCount - messages.length} restantes)
)} {messages.length === 0 ? ( -
-
- +
+
+
-

Como posso ajudar você hoje?

+

Como posso ajudar você hoje?

Selecione um modelo e comece uma conversa.

@@ -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) && ( -
+
{/* Process Log Toggle */} {deepResearch.state.logs.length > 0 && ( @@ -1400,22 +1402,22 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente {showProcessDebug && ( -
+
-
{deepResearch.state.logs.map((log, idx) => ( -
- {log.stage} +
+ {log.stage} {log.input ? (log.input.length > 50 ? log.input.substring(0, 50) + '...' : log.input) : '-'}
))} @@ -1430,22 +1432,22 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente {showContextDebug && ( -
+
{lastContextSources.map((s, i) => ( - {s.title || s.url} + {s.title || s.url} ))}
-
+

Preview Contexto:

-
{lastWebContext.substring(0, 500)}...
+
{lastWebContext.substring(0, 500)}...
)} @@ -1466,7 +1468,7 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente
{/* Input Wrapper */} -
+
-

OllaHub pode cometer erros. Verifique informações importantes.

+

OllaHub pode cometer erros. Verifique informações importantes.

@@ -1495,13 +1497,13 @@ Ao responder sobre fatos atuais ou notícias, inicie mencionando explicitamente {!isChatsSidebarCollapsed && ( <>
{ setIsChatsSidebarCollapsed(true); chatsSidebarRef.current?.collapse(); }} /> -
+
diff --git a/app/page.tsx b/app/page.tsx index 1d66491..72a7f7a 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -45,15 +45,15 @@ export default function Home() { if (status === 'checking') { return ( -
- - Verificando sistema... +
+ + Verificando sistema...
); } return ( -
+
{/* Notificação de boas-vindas */} @@ -64,9 +64,9 @@ export default function Home() { {/* Layout for Stopped State */} {status === 'installed_stopped' && ( -
+
-

OllaHub

+

OllaHub

Detectamos o Ollama, mas ele não está rodando.

diff --git a/app/settings/page.tsx b/app/settings/page.tsx index 418d46e..5fb4cfe 100644 --- a/app/settings/page.tsx +++ b/app/settings/page.tsx @@ -232,11 +232,11 @@ export default function SettingsPage() {
-
+
-

Configurações

-

+

Configurações

+

Gerencie as preferências do OllaHub

@@ -244,7 +244,7 @@ export default function SettingsPage() { variant="ghost" size="icon" onClick={() => router.push('/chat')} - className="rounded-lg shrink-0" + className="shrink-0 text-muted-foreground hover:text-foreground" title="Fechar configurações" > @@ -252,24 +252,24 @@ export default function SettingsPage() {
- - - + + + Visão Geral - + General - + Web Search - + Sources - + Tasks - + System @@ -316,11 +316,11 @@ export default function SettingsPage() { className="shrink-0" > {isCheckingConnection ? ( - + ) : connectionStatus === 'success' ? ( - + ) : connectionStatus === 'error' ? ( - + ) : ( 'Verificar' )} @@ -561,7 +561,7 @@ export default function SettingsPage() { {settings.webSearch.engineOrder.map((engine, index) => (
@@ -819,7 +819,7 @@ export default function SettingsPage() { }; return ( - +
@@ -1044,7 +1044,7 @@ export default function SettingsPage() {
-
+
{isLoadingLogs ? (
@@ -1138,7 +1138,7 @@ export default function SettingsPage() { {updater.updateAvailable && (
Nova Versão Disponível - + {updater.updateInfo?.version}
diff --git a/app/setup/page.tsx b/app/setup/page.tsx index 718ff92..63e9380 100644 --- a/app/setup/page.tsx +++ b/app/setup/page.tsx @@ -19,22 +19,22 @@ export default function SetupPage() { return (
-
+
-

Configuração Inicial

+

Configuração Inicial

Vamos preparar o ambiente ideal para você.

{!loading && specs && gpus.length > 0 && ( -
+
)} {!loading && specs && ( -
+
-
+
-

Tarefas Agendadas

-

+

Tarefas Agendadas

+

Gerencie tarefas que executam automaticamente em segundo plano

@@ -119,7 +119,7 @@ export default function TasksPage() { variant="ghost" size="icon" onClick={() => router.push('/chat')} - className="rounded-lg shrink-0" + className="shrink-0 text-muted-foreground hover:text-foreground" title="Voltar para o chat" > @@ -140,7 +140,7 @@ export default function TasksPage() { @@ -167,7 +167,7 @@ export default function TasksPage() { @@ -196,13 +196,13 @@ export default function TasksPage() { {task.label} {task.enabled ? ( - - + + Ativa ) : ( - + Pausada )} @@ -232,6 +232,8 @@ export default function TasksPage() { variant="ghost" size="icon" onClick={() => deleteTask(task.id)} + className="text-muted-foreground hover:bg-destructive/10 hover:text-destructive" + aria-label="Excluir task" > diff --git a/components/chat/chat-input.tsx b/components/chat/chat-input.tsx index 1a30786..6bd1f4f 100644 --- a/components/chat/chat-input.tsx +++ b/components/chat/chat-input.tsx @@ -105,21 +105,21 @@ export function ChatInput({ return (
-
+