utopia-ia/elffuss-claw public
Changesets · Branches · Tags · Compare
| Changeset | 5a6e072cf3b8d1fa7c319a8844b7c4760e561edddf7dcef988ba2c87b2a0e3eb |
|---|---|
| Author | KikoCis <kikocisneros@gmail.com> · 2026-10-11 18:31 +02:00 |
| Committer | KikoCis <kikocisneros@gmail.com> · 2026-10-11 18:31 +02:00 |
| Parents | e28a6a0b8e80 |
4 files changed
modified tests/ux-skills.mjs +9 −1
| @@ -47,13 +47,21 @@ | ||
| 47 | 47 | && await p.locator('#panel-skills .repo-skills .card', { hasText: 'reloj-bonito' }).count() === 1); |
| 48 | 48 | await explorar.click(); |
| 49 | 49 | |
| 50 | -const instalar = tarjeta.locator('.repo-skills .card', { hasText: 'reloj-bonito' }).locator('button'); | |
| 50 | +const tarjetaSkill = tarjeta.locator('.repo-skills .card', { hasText: 'reloj-bonito' }); | |
| 51 | +const instalar = tarjetaSkill.locator('button', { hasText: 'Instala' }); | |
| 51 | 52 | await instalar.click(); |
| 52 | 53 | ok('«Instalar» deja el botón desactivado en «Instalada ✓»', await hasta(async () => |
| 53 | 54 | (await instalar.innerText()) === 'Instalada ✓' && await instalar.isDisabled())); |
| 54 | 55 | ok('…el contador sube y la skill aparece en lo instalado', (await contador()) === 'Instaladas: 1' |
| 55 | 56 | && await p.locator('#panel-skills .skills-instaladas [data-ruta="reloj-bonito"]').count() === 1); |
| 56 | 57 | ok('…y el chat explica cómo usarla', /Skill «reloj-bonito» instalada/.test(await p.locator('#log').innerText())); |
| 58 | +const verEnChat = tarjetaSkill.locator('button', { hasText: 'Ver cómo usarla en el chat' }); | |
| 59 | +ok('la tarjeta enlaza a ese mensaje del chat', await verEnChat.count() === 1); | |
| 60 | +await verEnChat.click(); | |
| 61 | +ok('…que lo pone a la vista, con el foco y resaltado', await hasta(() => p.evaluate(() => { | |
| 62 | + const a = document.activeElement; | |
| 63 | + return a?.classList.contains('msg') && /Skill «reloj-bonito» instalada/.test(a.textContent) && a.classList.contains('resaltado'); | |
| 64 | +}))); | |
| 57 | 65 | const inst = p.locator('#panel-skills .skills-instaladas [data-ruta="reloj-bonito"]'); |
| 58 | 66 | await inst.locator('summary').click(); |
| 59 | 67 | ok('se puede ver lo que se le da al modelo', /Crea un reloj grande/.test(await inst.locator('.skill-text').innerText())); |
modified web/css/elffuss.css +2 −0
| @@ -75,6 +75,8 @@ | ||
| 75 | 75 | .dot.loading { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; } |
| 76 | 76 | .dot.on { background: var(--ok); } |
| 77 | 77 | .dot.gpu { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); } |
| 78 | +/* Un mensaje del chat al que se acaba de llevar (ui.irAlMensaje). */ | |
| 79 | +.msg.resaltado { outline: 2px solid var(--accent2); outline-offset: 2px; transition: outline-color .3s; } | |
| 78 | 80 | /* El estado del cerebro en palabras, junto al punto (el color solo no basta). |
| 79 | 81 | El margen negativo lo arrima al punto: el hueco entre controles es mayor. */ |
| 80 | 82 | .model-st-txt { font-size: .72rem; color: var(--muted); white-space: nowrap; flex: none; margin-left: -5px; } |
modified web/js/i18n.js +2 −0
| @@ -267,6 +267,7 @@ | ||
| 267 | 267 | webGallery: 'Galería con {n} imágenes de «{q}» abierta en el visualizador.', |
| 268 | 268 | // Estado del cerebro en corto, a la vista junto al punto (ui.modelStatus) |
| 269 | 269 | modelStOffShort: 'Básico', modelStLoadingShort: 'Cargando…', modelStOnShort: 'Listo', modelStGpuShort: 'Listo · GPU', |
| 270 | + skillSeeChat: 'Ver cómo usarla en el chat', | |
| 270 | 271 | }, |
| 271 | 272 | en: { |
| 272 | 273 | welcome: 'An operating system with a soul that lives in your browser. Here apps aren’t installed: they’re created when you ask, appearing on the right. I can use your folders (with permission), store encrypted secrets, schedule tasks and browse for you. Everything stays on your machine.', |
| @@ -515,6 +516,7 @@ | ||
| 515 | 516 | webImagesBad: 'unexpected answer from the image search', webNoImages: 'No images for “{q}”.', |
| 516 | 517 | webGallery: 'Gallery with {n} images of “{q}” open in the viewer.', |
| 517 | 518 | modelStOffShort: 'Basic', modelStLoadingShort: 'Loading…', modelStOnShort: 'Ready', modelStGpuShort: 'Ready · GPU', |
| 519 | + skillSeeChat: 'See how to use it in the chat', | |
| 518 | 520 | }, |
| 519 | 521 | uk: { |
| 520 | 522 | claim: "застосунків не існує: їх створюють", |
modified web/js/ui.js +18 −2
| @@ -35,6 +35,19 @@ | ||
| 35 | 35 | return div; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | +// Llevar a un mensaje del chat: en el móvil, al lado del chat; el mensaje a la | |
| 39 | +// vista, con el foco (para el teclado y el lector de pantalla) y resaltado un | |
| 40 | +// momento para que se vea cuál es. | |
| 41 | +export function irAlMensaje(div) { | |
| 42 | + if (!div?.isConnected) return; | |
| 43 | + if (isMobile()) flipTo('chat'); | |
| 44 | + div.tabIndex = -1; | |
| 45 | + div.scrollIntoView({ block: 'center', behavior: matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth' }); | |
| 46 | + div.focus({ preventScroll: true }); | |
| 47 | + div.classList.add('resaltado'); | |
| 48 | + setTimeout(() => div.classList.remove('resaltado'), 1600); | |
| 49 | +} | |
| 50 | + | |
| 38 | 51 | // Una línea de la conversación que escucha el copiloto (viene del Translator): |
| 39 | 52 | // quién habla y qué dice, con su estilo, no como un mensaje del usuario. |
| 40 | 53 | export function addTranscripcion(quien, texto) { |
| @@ -1388,7 +1401,9 @@ | ||
| 1388 | 1401 | b.textContent = tr('installedOk'); |
| 1389 | 1402 | b.className = 'ghost'; |
| 1390 | 1403 | pintarInstaladas(instaladas); |
| 1391 | - onSkillInstalledCb(entry); // → mensaje «cómo usarla» en el chat | |
| 1404 | + const msg = onSkillInstalledCb(entry); // → mensaje «cómo usarla» en el chat | |
| 1405 | + // …y desde la tarjeta se llega a ese mensaje (antes había que buscarlo). | |
| 1406 | + if (msg) c.append(btn(tr('skillSeeChat'), 'ghost', () => irAlMensaje(msg))); | |
| 1392 | 1407 | } catch (e) { b.disabled = false; b.textContent = tr('install'); toast('⚠️ ' + e.message); } |
| 1393 | 1408 | }); |
| 1394 | 1409 | b.disabled = on; |
| @@ -1462,8 +1477,9 @@ | ||
| 1462 | 1477 | onSettingsChangedCb = onSettingsChanged || (() => {}); |
| 1463 | 1478 | // al instalar una skill: mensaje «cómo usarla» en el chat + volver al chat en móvil |
| 1464 | 1479 | onSkillInstalledCb = entry => { |
| 1465 | - addMsg('assistant', skills.usageMessage(entry)); // addMsg renderiza markdown en 'assistant' | |
| 1480 | + const div = addMsg('assistant', skills.usageMessage(entry)); // addMsg renderiza markdown en 'assistant' | |
| 1466 | 1481 | if (isMobile()) flipTo('chat'); |
| 1482 | + return div; | |
| 1467 | 1483 | }; |
| 1468 | 1484 | |
| 1469 | 1485 | // Historial del prompt: ↑/↓ recuperan lo enviado (como una shell). Persistente. |