utopia-ia/elffuss-claw public
Changesets · Branches · Tags · Compare
| Changeset | 4b66a67212ad4e2a32c100155409f753893d026f30baaaf8a14ef7db1e812bb5 |
|---|---|
| Author | KikoCis <kikocisneros@gmail.com> · 2026-10-11 18:08 +02:00 |
| Committer | KikoCis <kikocisneros@gmail.com> · 2026-10-11 18:08 +02:00 |
| Parents | a42c0b1d8bb4 |
3 files changed
modified web/js/i18n.js +2 −0
| @@ -96,6 +96,7 @@ | ||
| 96 | 96 | // y lo que se queda. |
| 97 | 97 | wsWipeConfirm: "¿Borrar TODO lo que Claw guarda en este navegador?\n\nSe borra: apps, tareas, memoria, conversación, skills, automatizaciones, carpetas autorizadas, permisos, claves de los proveedores externos, ajustes y la BÓVEDA con todos sus secretos (no se pueden recuperar).\n\nSe queda: los modelos descargados (se vacían con «Vaciar caché del modelo») y los ficheros de tus carpetas, que no se tocan.", |
| 98 | 98 | wsWiped: "Borrado del navegador", |
| 99 | + wsOpfsName: "OPFS (navegador)", | |
| 99 | 100 | useTitle: "Consumo ahora", |
| 100 | 101 | useRam: "Memoria del navegador", |
| 101 | 102 | useDisk: "En disco (modelos y datos)", |
| @@ -340,6 +341,7 @@ | ||
| 340 | 341 | wsWipe: "Wipe browser data", |
| 341 | 342 | wsWipeConfirm: "Wipe EVERYTHING Claw stores in this browser?\n\nDeleted: apps, tasks, memory, conversation, skills, automations, authorized folders, permissions, external provider keys, settings and the VAULT with all its secrets (they cannot be recovered).\n\nKept: downloaded models (clear them with “Clear model cache”) and the files in your folders, which are not touched.", |
| 342 | 343 | wsWiped: "Browser data wiped", |
| 344 | + wsOpfsName: "OPFS (browser)", | |
| 343 | 345 | useTitle: "Usage right now", |
| 344 | 346 | useRam: "Browser memory", |
| 345 | 347 | useDisk: "On disk (models and data)", |
modified web/js/kernel.js +1 −1
| @@ -1243,7 +1243,7 @@ | ||
| 1243 | 1243 | // ── Espacio de trabajo: qué se puede guardar en tu disco / ver / borrar ── |
| 1244 | 1244 | // El manifiesto es lo ÚNICO que Claw le cuenta al core sobre sus almacenes. |
| 1245 | 1245 | workspace.init({ |
| 1246 | - app: 'claw', ns: 'elffuss', db, | |
| 1246 | + app: 'claw', ns: 'elffuss', db, opfsName: t('wsOpfsName'), | |
| 1247 | 1247 | stores: [ |
| 1248 | 1248 | // Las etiquetas son getters: se leen al pintar «Qué hay guardado», en el idioma |
| 1249 | 1249 | // de la página (antes salían en español también en inglés). |
modified web/js/workspace.js +14 −6
| @@ -24,8 +24,12 @@ | ||
| 24 | 24 | let autosaveCfg = { enabled: false, debounceMs: 3000 }; |
| 25 | 25 | let autosaveTimer = null; |
| 26 | 26 | |
| 27 | -export function init({ app, ns, db, stores }) { | |
| 27 | +// `nombreOPFS`: cómo se llama, en el idioma de la interfaz, la carpeta del | |
| 28 | +// almacenamiento privado del navegador (no tiene nombre propio). Lo da la app. | |
| 29 | +let nombreOPFS = 'OPFS'; | |
| 30 | +export function init({ app, ns, db, stores, opfsName }) { | |
| 28 | 31 | cfg = { app, ns, db, stores: stores || [] }; |
| 32 | + if (opfsName) nombreOPFS = opfsName; | |
| 29 | 33 | } |
| 30 | 34 | |
| 31 | 35 | export function supported() { |
| @@ -38,9 +42,13 @@ | ||
| 38 | 42 | const emit = () => { const s = statusSync(); listeners.forEach(f => { try { f(s); } catch { /* */ } }); }; |
| 39 | 43 | export function onChange(fn) { listeners.push(fn); return () => { listeners = listeners.filter(f => f !== fn); }; } |
| 40 | 44 | |
| 45 | +// La raíz del almacenamiento privado del navegador (OPFS) no tiene nombre: '' | |
| 46 | +// se leía como «sin carpeta» y la carpeta elegida no se podía usar. | |
| 47 | +const nombreDe = h => h ? (h.name || nombreOPFS) : null; | |
| 48 | + | |
| 41 | 49 | function statusSync() { |
| 42 | 50 | return { |
| 43 | - supported: supported(), folder: dirHandle ? dirHandle.name : null, ready, | |
| 51 | + supported: supported(), folder: nombreDe(dirHandle), ready, | |
| 44 | 52 | dirty: [...dirty], lastSaveAt, lastError, autosave: autosaveCfg.enabled, |
| 45 | 53 | }; |
| 46 | 54 | } |
| @@ -62,7 +70,7 @@ | ||
| 62 | 70 | dirHandle = h; |
| 63 | 71 | ready = await perm(h); |
| 64 | 72 | emit(); |
| 65 | - return { name: h.name, ready, reason: ready ? null : 'prompt' }; | |
| 73 | + return { name: nombreDe(h), ready, reason: ready ? null : 'prompt' }; | |
| 66 | 74 | } |
| 67 | 75 | |
| 68 | 76 | // Elegir carpeta (requiere gesto de usuario). |
| @@ -73,7 +81,7 @@ | ||
| 73 | 81 | ready = true; |
| 74 | 82 | await cfg.db.set('kv', HANDLE_KEY, h); |
| 75 | 83 | emit(); |
| 76 | - return { name: h.name, ready: true }; | |
| 84 | + return { name: nombreDe(h), ready: true }; | |
| 77 | 85 | } |
| 78 | 86 | |
| 79 | 87 | // Reutilizar un handle que la app ya tiene (Code: la carpeta del proyecto). |
| @@ -83,7 +91,7 @@ | ||
| 83 | 91 | ready = await perm(handle); |
| 84 | 92 | await cfg.db.set('kv', HANDLE_KEY, handle); |
| 85 | 93 | emit(); |
| 86 | - return { name: handle.name, ready }; | |
| 94 | + return { name: nombreDe(handle), ready }; | |
| 87 | 95 | } |
| 88 | 96 | |
| 89 | 97 | // Re-conceder permiso tras recargar (requiere gesto de usuario). |
| @@ -95,7 +103,7 @@ | ||
| 95 | 103 | ready = ok; |
| 96 | 104 | emit(); |
| 97 | 105 | if (!ok) throw new Error('permiso denegado'); |
| 98 | - return { name: dirHandle.name, ready: true }; | |
| 106 | + return { name: nombreDe(dirHandle), ready: true }; | |
| 99 | 107 | } |
| 100 | 108 | |
| 101 | 109 | export async function forget() { |