Elffuss BraidHub

utopia-ia/elffuss-claw public

Skills: an installed skill's card leads to its message in the chat

Left partly fixed by ux-fix (audit control #30, «Instalar» on a repo
skill): installing posts a "how to use it" message in the chat, but nothing
in the Skills panel pointed to it. After an install the card now has "Ver
cómo usarla en el chat" / "See how to use it in the chat", which brings the
chat side forward on phones, scrolls that message into view, moves focus to
it and outlines it for a moment (ui.irAlMensaje).

ux-skills.mjs follows the link and checks focus and outline on that
message; its install button is now found by its text, since the card has a
second button after the install.
Changeset5a6e072cf3b8d1fa7c319a8844b7c4760e561edddf7dcef988ba2c87b2a0e3eb
AuthorKikoCis <kikocisneros@gmail.com> · 2026-10-11 18:31 +02:00
CommitterKikoCis <kikocisneros@gmail.com> · 2026-10-11 18:31 +02:00
Parentse28a6a0b8e80

Browse the files at this changeset

4 files changed

modified tests/ux-skills.mjs +9 −1
@@ -47,13 +47,21 @@
4747 && await p.locator('#panel-skills .repo-skills .card', { hasText: 'reloj-bonito' }).count() === 1);
4848 await explorar.click();
4949
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' });
5152 await instalar.click();
5253 ok('«Instalar» deja el botón desactivado en «Instalada ✓»', await hasta(async () =>
5354 (await instalar.innerText()) === 'Instalada ✓' && await instalar.isDisabled()));
5455 ok('…el contador sube y la skill aparece en lo instalado', (await contador()) === 'Instaladas: 1'
5556 && await p.locator('#panel-skills .skills-instaladas [data-ruta="reloj-bonito"]').count() === 1);
5657 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+})));
5765 const inst = p.locator('#panel-skills .skills-instaladas [data-ruta="reloj-bonito"]');
5866 await inst.locator('summary').click();
5967 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 @@
7575 .dot.loading { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
7676 .dot.on { background: var(--ok); }
7777 .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; }
7880 /* El estado del cerebro en palabras, junto al punto (el color solo no basta).
7981 El margen negativo lo arrima al punto: el hueco entre controles es mayor. */
8082 .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 @@
267267 webGallery: 'Galería con {n} imágenes de «{q}» abierta en el visualizador.',
268268 // Estado del cerebro en corto, a la vista junto al punto (ui.modelStatus)
269269 modelStOffShort: 'Básico', modelStLoadingShort: 'Cargando…', modelStOnShort: 'Listo', modelStGpuShort: 'Listo · GPU',
270+ skillSeeChat: 'Ver cómo usarla en el chat',
270271 },
271272 en: {
272273 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 @@
515516 webImagesBad: 'unexpected answer from the image search', webNoImages: 'No images for “{q}”.',
516517 webGallery: 'Gallery with {n} images of “{q}” open in the viewer.',
517518 modelStOffShort: 'Basic', modelStLoadingShort: 'Loading…', modelStOnShort: 'Ready', modelStGpuShort: 'Ready · GPU',
519+ skillSeeChat: 'See how to use it in the chat',
518520 },
519521 uk: {
520522 claim: "застосунків не існує: їх створюють",
modified web/js/ui.js +18 −2
@@ -35,6 +35,19 @@
3535 return div;
3636 }
3737
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+
3851 // Una línea de la conversación que escucha el copiloto (viene del Translator):
3952 // quién habla y qué dice, con su estilo, no como un mensaje del usuario.
4053 export function addTranscripcion(quien, texto) {
@@ -1388,7 +1401,9 @@
13881401 b.textContent = tr('installedOk');
13891402 b.className = 'ghost';
13901403 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)));
13921407 } catch (e) { b.disabled = false; b.textContent = tr('install'); toast('⚠️ ' + e.message); }
13931408 });
13941409 b.disabled = on;
@@ -1462,8 +1477,9 @@
14621477 onSettingsChangedCb = onSettingsChanged || (() => {});
14631478 // al instalar una skill: mensaje «cómo usarla» en el chat + volver al chat en móvil
14641479 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'
14661481 if (isMobile()) flipTo('chat');
1482+ return div;
14671483 };
14681484
14691485 // Historial del prompt: ↑/↓ recuperan lo enviado (como una shell). Persistente.