diff --git a/public/bundles/bundle-1.0.27.zip b/public/bundles/bundle-1.0.27.zip index 1118821..78eb7db 100644 Binary files a/public/bundles/bundle-1.0.27.zip and b/public/bundles/bundle-1.0.27.zip differ diff --git a/public/bundles/bundle-1.0.28.zip b/public/bundles/bundle-1.0.28.zip index df0f010..679312e 100644 Binary files a/public/bundles/bundle-1.0.28.zip and b/public/bundles/bundle-1.0.28.zip differ diff --git a/public/bundles/bundle-latest.zip b/public/bundles/bundle-latest.zip index df0f010..679312e 100644 Binary files a/public/bundles/bundle-latest.zip and b/public/bundles/bundle-latest.zip differ diff --git a/public/bundles/manifest.json b/public/bundles/manifest.json index 2773837..5ea79af 100644 --- a/public/bundles/manifest.json +++ b/public/bundles/manifest.json @@ -1,9 +1,9 @@ { "version": "1.0.28", - "buildId": "23b496aa", - "releasedAt": "2026-11-21T20:50:12.604Z", + "buildId": "c26de28b", + "releasedAt": "2026-11-21T20:57:34.475Z", "bundleUrl": "/bundles/bundle-1.0.28.zip", "latestUrl": "/bundles/bundle-latest.zip", - "checksum": "f81a1438f916e7d2a612d3b01620a488e8cffc0c75659720a8e6ab9d597babe0", - "sizeBytes": 71309 + "checksum": "6a1134c67a3cb35376d10c37da034d6e015edfeefed8c31a1f1cd4617ce1e3ef", + "sizeBytes": 71641 } \ No newline at end of file diff --git a/public/index.html b/public/index.html index 0e84f08..cb9a6f1 100644 --- a/public/index.html +++ b/public/index.html @@ -286,31 +286,31 @@
-
+
Agente
Terminal Maestri Conectado
-
- - - - + - - +
diff --git a/public/style.css b/public/style.css index 094e6d2..868522c 100644 --- a/public/style.css +++ b/public/style.css @@ -1016,7 +1016,7 @@ main { display: flex; flex-direction: column; justify-content: flex-end; - padding-top: max(1.5rem, calc(0.75rem + env(safe-area-inset-top, 0px))); + padding-top: max(0.5rem, env(safe-area-inset-top, 0px)); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); } @@ -1025,7 +1025,8 @@ main { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.65); - backdrop-filter: blur(2px); + backdrop-filter: blur(4px); + -webkit-backdrop-filter: blur(4px); } .chat-content { @@ -1033,10 +1034,8 @@ main { background: var(--bg-card); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; - height: 93vh; - height: 93dvh; - max-height: 95vh; - max-height: 95dvh; + height: 100%; + max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5); @@ -1045,65 +1044,135 @@ main { } .chat-header { - padding-top: max(0.85rem, calc(0.5rem + env(safe-area-inset-top, 0px))); - padding-bottom: 0.85rem; - padding-left: max(1rem, calc(0.75rem + env(safe-area-inset-left, 0px))); - padding-right: max(1.25rem, calc(1rem + env(safe-area-inset-right, 0px))); - border-bottom: 1px solid var(--border); + position: relative; display: flex; - justify-content: space-between; - align-items: center; - background: rgba(10, 15, 29, 0.6); + flex-direction: column; + gap: 0.6rem; + padding: 0.75rem 1rem 0.65rem; + padding-left: max(1rem, calc(0.75rem + env(safe-area-inset-left, 0px))); + padding-right: max(1rem, calc(0.75rem + env(safe-area-inset-right, 0px))); + background: rgba(10, 15, 29, 0.85); + backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); + border-bottom: 1px solid var(--border); flex-shrink: 0; - gap: 0.5rem; } +/* Row 1: Informações do Agente e Botão Fechar */ .chat-agent-info { display: flex; align-items: center; - gap: 0.6rem; + gap: 0.65rem; + min-width: 0; + width: 100%; + padding-right: 52px; /* Reserva espaço livre para o botão de fechar no canto superior direito */ + box-sizing: border-box; +} + +.chat-agent-info .status-dot { + flex-shrink: 0; + width: 10px; + height: 10px; +} + +.chat-agent-meta, +.chat-agent-info > div { min-width: 0; flex: 1 1 auto; overflow: hidden; } -.chat-agent-info > div { - min-width: 0; +#chat-agent-name { + display: block; + font-size: 1.05rem; + font-weight: 700; + color: #f8fafc; + line-height: 1.3; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; + letter-spacing: -0.01em; } +#chat-agent-subtitle { + font-size: 0.74rem; + color: #38bdf8; + line-height: 1.3; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-top: 0.1rem; +} + +/* Row 2: Barra de Ações Rápidas do Terminal (5 botões de utilidades) */ .chat-header-actions { display: flex; align-items: center; - gap: 0.35rem; - flex-shrink: 0; - margin-right: max(0.25rem, env(safe-area-inset-right, 0px)); + gap: 8px; /* Mínimo 8px de respiro livre entre as áreas de toque */ + flex-wrap: wrap; + width: 100%; + padding-top: 0.35rem; + border-top: 1px solid rgba(255, 255, 255, 0.06); } -#btn-close-chat, -.btn-close-chat { - margin-left: 0.35rem; - margin-right: max(0.35rem, calc(0.2rem + env(safe-area-inset-right, 0px))); - flex-shrink: 0; - border-radius: 50%; - width: 40px; - height: 40px; - min-width: 40px; - min-height: 40px; +/* Botões de Ação do Header (Mínimo 44x44px de área de toque) */ +.chat-header-actions .btn-icon { + width: 44px; + height: 44px; + min-width: 44px; + min-height: 44px; + padding: 0; + border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; - background: rgba(255, 255, 255, 0.08); + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.09); + color: #94a3b8; + cursor: pointer; + touch-action: manipulation; + transition: all 0.15s ease; + user-select: none; + -webkit-tap-highlight-color: transparent; + flex-shrink: 0; +} + +.chat-header-actions .btn-icon:hover { + background: rgba(255, 255, 255, 0.1); + border-color: rgba(255, 255, 255, 0.18); + color: #f8fafc; +} + +.chat-header-actions .btn-icon:active { + transform: scale(0.94); + background: rgba(255, 255, 255, 0.15); +} + +/* Botão Fechar: posicionado confortavelmente no canto superior direito */ +#btn-close-chat, +.btn-close-chat { + position: absolute; + top: 0.65rem; + right: max(0.85rem, calc(0.5rem + env(safe-area-inset-right, 0px))); + width: 44px; + height: 44px; + min-width: 44px; + min-height: 44px; + border-radius: 50%; + display: inline-flex; + align-items: center; + justify-content: center; + background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); - color: var(--text-secondary); + color: #94a3b8; font-size: 1.5rem; line-height: 1; cursor: pointer; touch-action: manipulation; z-index: 30; - transition: all 0.2s ease; + transition: all 0.18s ease; + margin: 0; + -webkit-tap-highlight-color: transparent; } #btn-close-chat:hover, @@ -1118,34 +1187,42 @@ main { #btn-close-chat:active, .btn-close-chat:active { transform: scale(0.92); - background: rgba(239, 68, 68, 0.3); + background: rgba(239, 68, 68, 0.35); +} + +@media (min-width: 641px) { + .chat-header { + flex-direction: row; + justify-content: space-between; + align-items: center; + gap: 1rem; + padding: 0.85rem 1.25rem; + } + .chat-agent-info { + padding-right: 0; + width: auto; + flex: 1 1 auto; + } + .chat-header-actions { + width: auto; + padding-top: 0; + border-top: none; + justify-content: flex-end; + } + #btn-close-chat, + .btn-close-chat { + position: static; + margin-left: 0.25rem; + } } @media (max-width: 480px) { .chat-header { padding-left: max(0.75rem, calc(0.5rem + env(safe-area-inset-left, 0px))); - padding-right: max(1rem, calc(0.75rem + env(safe-area-inset-right, 0px))); - gap: 0.35rem; + padding-right: max(0.75rem, calc(0.5rem + env(safe-area-inset-right, 0px))); } .chat-header-actions { - gap: 0.2rem; - margin-right: max(0.2rem, env(safe-area-inset-right, 0px)); - } - .chat-header-actions .btn-icon:not(.btn-close-chat) { - min-width: 36px; - min-height: 36px; - padding: 0.35rem; - font-size: 0.95rem; - } - #btn-close-chat, - .btn-close-chat { - width: 38px; - height: 38px; - min-width: 38px; - min-height: 38px; - font-size: 1.4rem; - margin-left: 0.25rem; - margin-right: max(0.35rem, calc(0.2rem + env(safe-area-inset-right, 0px))); + gap: 8px; } } diff --git a/test/frontend-app.test.js b/test/frontend-app.test.js index 078af88..3bf8e7a 100644 --- a/test/frontend-app.test.js +++ b/test/frontend-app.test.js @@ -3149,4 +3149,46 @@ Também verificamos running command e compiling no buffer. window.removeAgentTyping(true); assert.strictEqual(document.getElementById('chat-typing-indicator'), null, 'removeAgentTyping(true) deve remover completamente o card ao encerrar'); }); + + test('36. Layout e Usabilidade do Cabeçalho do Chat (UX Craft - Espaçamento, Safe-Area e Áreas de Toque)', async () => { + // 1. Elementos do cabeçalho + const chatHeader = document.querySelector('.chat-header'); + const agentInfo = document.querySelector('.chat-agent-info'); + const chatAgentName = document.getElementById('chat-agent-name'); + const chatAgentSubtitle = document.getElementById('chat-agent-subtitle'); + const headerActions = document.querySelector('.chat-header-actions'); + const btnDownloads = document.getElementById('btn-session-downloads'); + const btnTui = document.getElementById('btn-tui-toggle'); + const btnNotif = document.getElementById('chat-notif-toggle-btn'); + const btnRestart = document.getElementById('btn-restart-terminal'); + const btnRefresh = document.getElementById('btn-refresh-chat'); + const btnClose = document.getElementById('btn-close-chat'); + + assert.ok(chatHeader, '.chat-header deve existir'); + assert.ok(agentInfo, '.chat-agent-info deve existir'); + assert.ok(chatAgentName, '#chat-agent-name deve existir'); + assert.ok(chatAgentSubtitle, '#chat-agent-subtitle deve existir'); + assert.ok(headerActions, '.chat-header-actions deve existir'); + + // 2. Todos os 6 botões interativos devem ter área mínima de toque de 44x44px + const buttons = [btnDownloads, btnTui, btnNotif, btnRestart, btnRefresh, btnClose]; + for (const btn of buttons) { + assert.ok(btn, `Botão ${btn?.id} deve existir no DOM`); + assert.strictEqual(btn.style.minWidth, '44px', `Botão ${btn.id} deve ter min-width de 44px`); + assert.strictEqual(btn.style.minHeight, '44px', `Botão ${btn.id} deve ter min-height de 44px`); + } + + // 3. Ordem dos elementos no DOM preservada + assert.strictEqual(btnRestart.nextElementSibling?.id, 'btn-refresh-chat'); + assert.strictEqual(btnRefresh.nextElementSibling?.id, 'btn-close-chat'); + + // 4. Validação das regras de CSS do cabeçalho no arquivo style.css + const cssContent = fs.readFileSync(path.resolve('public', 'style.css'), 'utf8'); + assert.ok(cssContent.includes('.chat-header {'), 'Deve conter definição de .chat-header no CSS'); + assert.ok(cssContent.includes('gap: 8px;'), 'Deve conter espaçamento mínimo de 8px entre os botões de ação'); + assert.ok(cssContent.includes('padding-right: 52px;'), 'chat-agent-info deve reservar espaço para o botão fechar'); + assert.ok(cssContent.includes('.chat-header-actions .btn-icon {'), 'Deve conter estilos para os botões do header'); + assert.ok(cssContent.includes('min-width: 44px;'), 'CSS deve garantir min-width de 44px'); + assert.ok(cssContent.includes('min-height: 44px;'), 'CSS deve garantir min-height de 44px'); + }); });