Elffuss BraidHub

utopia-ia/elffuss-claw public

Workspace: the browser's private folder has a name, as in Elffuss Code

workspace.js is shared with Elffuss Code; this is Code's copy from its
integration branch (c950388). The root of the browser's private storage
(OPFS) has no name of its own: '' read as "no folder", so a workspace kept
there could not be used. It is now shown under a name the app gives in the
page language, "OPFS (navegador)" / "OPFS (browser)" (wsOpfsName). The file
is byte-identical to Code's again.
Changeset4b66a67212ad4e2a32c100155409f753893d026f30baaaf8a14ef7db1e812bb5
AuthorKikoCis <kikocisneros@gmail.com> · 2026-10-11 18:08 +02:00
CommitterKikoCis <kikocisneros@gmail.com> · 2026-10-11 18:08 +02:00
Parentsa42c0b1d8bb4

Browse the files at this changeset

3 files changed

modified web/js/i18n.js +2 −0
@@ -96,6 +96,7 @@
9696 // y lo que se queda.
9797 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.",
9898 wsWiped: "Borrado del navegador",
99+ wsOpfsName: "OPFS (navegador)",
99100 useTitle: "Consumo ahora",
100101 useRam: "Memoria del navegador",
101102 useDisk: "En disco (modelos y datos)",
@@ -340,6 +341,7 @@
340341 wsWipe: "Wipe browser data",
341342 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.",
342343 wsWiped: "Browser data wiped",
344+ wsOpfsName: "OPFS (browser)",
343345 useTitle: "Usage right now",
344346 useRam: "Browser memory",
345347 useDisk: "On disk (models and data)",
modified web/js/kernel.js +1 −1
@@ -1243,7 +1243,7 @@
12431243 // ── Espacio de trabajo: qué se puede guardar en tu disco / ver / borrar ──
12441244 // El manifiesto es lo ÚNICO que Claw le cuenta al core sobre sus almacenes.
12451245 workspace.init({
1246- app: 'claw', ns: 'elffuss', db,
1246+ app: 'claw', ns: 'elffuss', db, opfsName: t('wsOpfsName'),
12471247 stores: [
12481248 // Las etiquetas son getters: se leen al pintar «Qué hay guardado», en el idioma
12491249 // 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 @@
2424 let autosaveCfg = { enabled: false, debounceMs: 3000 };
2525 let autosaveTimer = null;
2626
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 }) {
2831 cfg = { app, ns, db, stores: stores || [] };
32+ if (opfsName) nombreOPFS = opfsName;
2933 }
3034
3135 export function supported() {
@@ -38,9 +42,13 @@
3842 const emit = () => { const s = statusSync(); listeners.forEach(f => { try { f(s); } catch { /* */ } }); };
3943 export function onChange(fn) { listeners.push(fn); return () => { listeners = listeners.filter(f => f !== fn); }; }
4044
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+
4149 function statusSync() {
4250 return {
43- supported: supported(), folder: dirHandle ? dirHandle.name : null, ready,
51+ supported: supported(), folder: nombreDe(dirHandle), ready,
4452 dirty: [...dirty], lastSaveAt, lastError, autosave: autosaveCfg.enabled,
4553 };
4654 }
@@ -62,7 +70,7 @@
6270 dirHandle = h;
6371 ready = await perm(h);
6472 emit();
65- return { name: h.name, ready, reason: ready ? null : 'prompt' };
73+ return { name: nombreDe(h), ready, reason: ready ? null : 'prompt' };
6674 }
6775
6876 // Elegir carpeta (requiere gesto de usuario).
@@ -73,7 +81,7 @@
7381 ready = true;
7482 await cfg.db.set('kv', HANDLE_KEY, h);
7583 emit();
76- return { name: h.name, ready: true };
84+ return { name: nombreDe(h), ready: true };
7785 }
7886
7987 // Reutilizar un handle que la app ya tiene (Code: la carpeta del proyecto).
@@ -83,7 +91,7 @@
8391 ready = await perm(handle);
8492 await cfg.db.set('kv', HANDLE_KEY, handle);
8593 emit();
86- return { name: handle.name, ready };
94+ return { name: nombreDe(handle), ready };
8795 }
8896
8997 // Re-conceder permiso tras recargar (requiere gesto de usuario).
@@ -95,7 +103,7 @@
95103 ready = ok;
96104 emit();
97105 if (!ok) throw new Error('permiso denegado');
98- return { name: dirHandle.name, ready: true };
106+ return { name: nombreDe(dirHandle), ready: true };
99107 }
100108
101109 export async function forget() {