utopia-ia/elffuss-code public
Changesets · Branches · Tags · Compare
| Changeset | 7aca986db5871ca6f7f09f510cc8c77ab1cd6f9ce2e242e5e965e15cea601c78 |
|---|---|
| Author | KikoCis <kikocisneros@gmail.com> · 2026-10-10 16:44 +02:00 |
| Committer | KikoCis <kikocisneros@gmail.com> · 2026-10-11 14:15 +02:00 |
| Parents | 9397a186eb6c |
2 files changed
modified web/js/providers/rules.js +1 −1
| @@ -9,7 +9,7 @@ | ||
| 9 | 9 | • «lee <archivo>» · «abre <archivo>» |
| 10 | 10 | • «busca <texto>» |
| 11 | 11 | • «escribe <archivo>: <contenido>» |
| 12 | -Para programar de verdad, carga el modelo local (selector 🧠) o configura uno en ⚙️.`; | |
| 12 | +Para programar de verdad, elige un modelo en ⚙️ Ajustes → Cerebro (o pulsa el punto de estado del modelo, arriba a la derecha).`; | |
| 13 | 13 | |
| 14 | 14 | export async function chat(history, systemPrompt) { |
| 15 | 15 | const last = history[history.length - 1]; |
modified web/sw.js +8 −2
| @@ -26,18 +26,24 @@ | ||
| 26 | 26 | // notificaciones normales (new Notification()) no soportan acciones, las que |
| 27 | 27 | // pasan por el SW (registration.showNotification) sí. Al pulsar, avisamos a |
| 28 | 28 | // la pestaña (postMessage) para que mande la propuesta a la cola real. |
| 29 | +// | |
| 30 | +// A la ventana del IDE, no a la primera que haya: con el Lab abierto (lab.html) | |
| 31 | +// el aviso podía irse a él y perderse. Y si no hay ninguna ventana abierta, se | |
| 32 | +// abre el IDE con la acción en la URL (?notif=…) para que la Mente aparezca en | |
| 33 | +// cuanto el proyecto esté abierto; antes se abría «/» y la propuesta se perdía. | |
| 29 | 34 | self.addEventListener('notificationclick', event => { |
| 30 | 35 | const action = event.action; // 'execute' | 'open' | '' (clic en el cuerpo) |
| 31 | 36 | const data = event.notification.data || {}; |
| 32 | 37 | event.notification.close(); |
| 33 | 38 | event.waitUntil((async () => { |
| 34 | 39 | const clientsList = await self.clients.matchAll({ type: 'window', includeUncontrolled: true }); |
| 35 | - const client = clientsList[0]; | |
| 40 | + const esIDE = c => { try { const u = new URL(c.url); return !/\/lab\.html$/.test(u.pathname); } catch { return false; } }; | |
| 41 | + const client = clientsList.find(esIDE); | |
| 36 | 42 | if (client) { |
| 37 | 43 | client.postMessage({ type: 'notif-action', action, md: data.md }); |
| 38 | 44 | client.focus?.(); |
| 39 | 45 | } else if (self.clients.openWindow) { |
| 40 | - await self.clients.openWindow('/'); | |
| 46 | + await self.clients.openWindow('./?notif=' + (action === 'execute' ? 'execute' : 'open')); | |
| 41 | 47 | } |
| 42 | 48 | })()); |
| 43 | 49 | }); |