diff options
Diffstat (limited to 'claude_logbook/template.html')
| -rw-r--r-- | claude_logbook/template.html | 246 |
1 files changed, 123 insertions, 123 deletions
diff --git a/claude_logbook/template.html b/claude_logbook/template.html index 7c8ba76..c018320 100644 --- a/claude_logbook/template.html +++ b/claude_logbook/template.html @@ -1,18 +1,18 @@ <!doctype html> -<html lang="es"> +<html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="color-scheme" content="light dark"> <meta name="robots" content="noindex, nofollow"> -<title>Sesiones de Claude Code</title> +<title>Claude Code sessions</title> <script> - // Corre antes del primer pintado para que el tema elegido no parpadee: - // primero la preferencia guardada, si no la del sistema. + // Runs before the first paint so the chosen theme does not flicker: + // the saved preference first, otherwise the system one. (function () { var saved = null; - try { saved = localStorage.getItem('cs-tema'); } catch (e) {} + try { saved = localStorage.getItem('cl-theme'); } catch (e) {} var dark = saved ? saved === 'dark' : matchMedia('(prefers-color-scheme: dark)').matches; document.documentElement.dataset.theme = dark ? 'dark' : 'light'; @@ -20,9 +20,9 @@ </script> <style> - /* Una paleta por tema y nada más: el data-theme lo pone el script de arriba - antes de pintar, así que no hace falta repetir los valores dentro de una - @media. El botón del toolbar cambia ese mismo atributo. */ + /* One palette per theme and nothing else: data-theme is set by the script + above before painting, so there is no need to repeat the values inside an + @media. The toolbar button toggles that same attribute. */ :root, :root[data-theme="light"] { --ground: #EDEEF2; @@ -237,7 +237,7 @@ outline-offset: 1px; } - /* ---------- tabla ---------- */ + /* ---------- table ---------- */ .grid { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); } @@ -367,7 +367,7 @@ .none { padding: 48px 20px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 13px; } .count { font-family: var(--mono); font-size: 11.5px; color: var(--faint); padding: 10px 2px 0; letter-spacing: .04em; } - /* ---------- lector ---------- */ + /* ---------- reader ---------- */ .scrim { position: fixed; @@ -570,7 +570,7 @@ .reader { width: 100%; border-left: 0; } } - /* ---------- pestañas y memorias ---------- */ + /* ---------- tabs and memories ---------- */ .tabs { display: flex; @@ -639,7 +639,7 @@ .ty-feedback { color: var(--copper, var(--amber)); border-color: var(--amber-lo); } .ty-reference { color: var(--muted); } - /* Una memoria fuera de MEMORY.md sigue en disco pero no se carga en contexto. */ + /* A memory missing from MEMORY.md is still on disk but is not loaded into context. */ .chip-unlisted { color: var(--amber); border-color: var(--amber-lo); background: var(--amber-bg); } .mem-body { @@ -727,22 +727,22 @@ <div class="wrap"> <header class="masthead"> <span class="eyebrow">~/.claude/projects</span> - <h1>Tus sesiones de Claude Code</h1> - <p class="lede">Cada conversación queda en un <code>.jsonl</code> local. Hacé clic en cualquier fila para leerla, o copiá el comando para retomarla — el <code>--resume</code> solo encuentra la sesión desde su directorio original, así que el botón copia el <code>cd</code> también.</p> + <h1>Your Claude Code sessions</h1> + <p class="lede">Every conversation is kept in a local <code>.jsonl</code>. Click any row to read it, or copy the command to pick it up again — <code>--resume</code> only finds the session from its original directory, so the button copies the <code>cd</code> too.</p> </header> <noscript> - <p class="noscript">Esta página arma la lista con JavaScript. Con JavaScript - desactivado no se ve nada — los datos igual están adentro del archivo, en el + <p class="noscript">This page builds the list with JavaScript. With JavaScript + disabled nothing shows up — the data is still inside the file, in the <code><script id="payload"></code>.</p> </noscript> - <div class="tabs" role="tablist" aria-label="Qué mirar"> + <div class="tabs" role="tablist" aria-label="What to browse"> <button type="button" class="tab" role="tab" data-mode="s" aria-selected="true"> - Sesiones <span class="n" id="nS"></span> + Sessions <span class="n" id="nS"></span> </button> <button type="button" class="tab" role="tab" data-mode="m" aria-selected="false"> - Memorias <span class="n" id="nM"></span> + Memories <span class="n" id="nM"></span> </button> </div> @@ -751,34 +751,34 @@ <div class="toolbar"> <div class="field"> <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5 14 14"/></svg> - <input type="search" id="q" placeholder="buscar título, ruta o uuid… (/)" autocomplete="off" spellcheck="false" aria-label="Buscar sesiones"> + <input type="search" id="q" placeholder="search title, path or uuid… (/)" autocomplete="off" spellcheck="false" aria-label="Search sessions"> </div> - <select id="proj" aria-label="Filtrar por proyecto"></select> - <label class="toggle only-s"><input type="checkbox" id="deep"> buscar dentro del chat</label> - <label class="toggle only-s"><input type="checkbox" id="hideEmpty"> ocultar vacías</label> - <select id="mtype" class="only-m" aria-label="Filtrar por tipo de memoria"></select> - <label class="toggle only-m"><input type="checkbox" id="unlisted"> solo fuera del índice</label> - <button type="button" class="tbtn" id="theme" title="Cambiar entre claro y oscuro" aria-label="Cambiar tema"> + <select id="proj" aria-label="Filter by project"></select> + <label class="toggle only-s"><input type="checkbox" id="deep"> search inside chats</label> + <label class="toggle only-s"><input type="checkbox" id="hideEmpty"> hide empty</label> + <select id="mtype" class="only-m" aria-label="Filter by memory type"></select> + <label class="toggle only-m"><input type="checkbox" id="unlisted"> only unindexed</label> + <button type="button" class="tbtn" id="theme" title="Switch between light and dark" aria-label="Toggle theme"> <svg class="moon" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4"><path d="M13.5 9.6A5.8 5.8 0 0 1 6.4 2.5a5.8 5.8 0 1 0 7.1 7.1Z"/></svg> <svg class="sun" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4"><circle cx="8" cy="8" r="3.1"/><path d="M8 1v1.6M8 13.4V15M1 8h1.6M13.4 8H15M3.1 3.1l1.1 1.1M11.8 11.8l1.1 1.1M12.9 3.1l-1.1 1.1M4.2 11.8l-1.1 1.1"/></svg> </button> </div> - <div class="grid" role="table" aria-label="Sesiones de Claude Code"> + <div class="grid" role="table" aria-label="Claude Code sessions"> <div class="row head only-s" role="row"> <span></span> - <button type="button" data-sort="t" class="pad-l">Sesión <span class="car">▾</span></button> - <button type="button" data-sort="l">Fecha <span class="car">▾</span></button> + <button type="button" data-sort="t" class="pad-l">Session <span class="car">▾</span></button> + <button type="button" data-sort="l">Date <span class="car">▾</span></button> <button type="button" data-sort="u" class="num">Msgs <span class="car">▾</span></button> <button type="button" data-sort="d" class="num">Dur. <span class="car">▾</span></button> - <span class="pad-r" style="text-align:right">Reanudar</span> + <span class="pad-r" style="text-align:right">Resume</span> </div> <div class="row head mem only-m" role="row"> <span></span> - <button type="button" data-msort="name" class="pad-l">Memoria <span class="car">▾</span></button> - <button type="button" data-msort="ty">Tipo <span class="car">▾</span></button> - <button type="button" data-msort="p">Proyecto <span class="car">▾</span></button> - <button type="button" data-msort="l">Fecha <span class="car">▾</span></button> + <button type="button" data-msort="name" class="pad-l">Memory <span class="car">▾</span></button> + <button type="button" data-msort="ty">Type <span class="car">▾</span></button> + <button type="button" data-msort="p">Project <span class="car">▾</span></button> + <button type="button" data-msort="l">Date <span class="car">▾</span></button> </div> <div id="rows"></div> </div> @@ -786,26 +786,26 @@ <p class="count" id="count"></p> <div class="legend only-s"> - <span>Franja izquierda = antigüedad:</span> - <span><i style="background:var(--amber)"></i>hoy / ayer</span> - <span><i style="background:var(--amber);opacity:.55"></i>última semana</span> - <span><i style="background:var(--amber);opacity:.26"></i>dos semanas</span> - <span><i style="background:var(--line)"></i>más viejo</span> + <span>Left stripe = age:</span> + <span><i style="background:var(--amber)"></i>today / yesterday</span> + <span><i style="background:var(--amber);opacity:.55"></i>last week</span> + <span><i style="background:var(--amber);opacity:.26"></i>two weeks</span> + <span><i style="background:var(--line)"></i>older</span> </div> <div class="legend only-m"> - <span><span class="chip chip-unlisted">fuera del índice</span> = está en disco pero no figura en MEMORY.md, así que no se carga en contexto</span> + <span><span class="chip chip-unlisted">unindexed</span> = on disk but not listed in MEMORY.md, so it is not loaded into context</span> </div> <div class="foot only-m"> - <p>Cada proyecto guarda sus recuerdos en <code><proyecto>/memory/</code>: un <code>.md</code> por memoria y un <code>MEMORY.md</code> que los indexa. El índice es lo único que se lee al arrancar una sesión.</p> - <p>Los tipos los define Claude al escribirlas: <b>project</b> es trabajo en curso, <b>user</b> quién sos y cómo trabajás, <b>feedback</b> correcciones tuyas, <b>reference</b> punteros a recursos externos.</p> + <p>Each project keeps its memories in <code><project>/memory/</code>: one <code>.md</code> per memory and a <code>MEMORY.md</code> that indexes them. The index is the only thing read when a session starts.</p> + <p>Claude picks the type when it writes them: <b>project</b> is ongoing work, <b>user</b> who you are and how you work, <b>feedback</b> your corrections, <b>reference</b> pointers to external resources.</p> </div> <div class="foot only-s"> - <p>Los títulos los genera Claude durante la sesión. Cuando falta, cae al primer mensaje tuyo — y ahí se nota, porque arranca en minúscula o suena a pregunta suelta.</p> - <p><b>Vacía</b> es una sesión que se abrió pero nunca recibió un mensaje: un <code>/resume</code> cancelado, un <code>/login</code>. <b>No interactiva</b> es un <code>claude -p</code> con algo piped por stdin — típicamente un <code>git diff</code> para redactar el mensaje de commit, no un chat.</p> - <p>La transcripción trae el texto de la conversación y una línea por herramienta usada, pero no lo que esas herramientas devolvieron: son el 95 % del volumen en disco.</p> + <p>Titles are generated by Claude during the session. When there is none, it falls back to your first message — which shows, because it starts in lowercase or reads like a stray question.</p> + <p><b>Empty</b> is a session that was opened but never got a message: a cancelled <code>/resume</code>, a <code>/login</code>. <b>Non-interactive</b> is a <code>claude -p</code> with something piped through stdin — typically a <code>git diff</code> to draft a commit message, not a chat.</p> + <p>The transcript has the conversation text and one line per tool used, but not what those tools returned: that is 95% of the size on disk.</p> <p id="snap"></p> </div> </div> @@ -819,10 +819,10 @@ <div class="meta" id="rMeta"></div> </div> <div class="rh-acts"> - <button type="button" class="xbtn" id="rCopy" title="Copiar comando para reanudar" aria-label="Copiar comando para reanudar"> + <button type="button" class="xbtn" id="rCopy" title="Copy resume command" aria-label="Copy resume command"> <svg width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="5.5" y="5.5" width="8" height="9" rx="1.5"/><path d="M10.5 3.5H3a.5.5 0 0 0-.5.5v8"/></svg> </button> - <button type="button" class="xbtn" id="rClose" title="Cerrar (Esc)" aria-label="Cerrar"> + <button type="button" class="xbtn" id="rClose" title="Close (Esc)" aria-label="Close"> <svg width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6"><path d="m4 4 8 8M12 4l-8 8"/></svg> </button> </div> @@ -837,13 +837,13 @@ const PAYLOAD = JSON.parse(document.getElementById('payload').textContent); const DATA = PAYLOAD.s || []; const MEM = PAYLOAD.m || []; -// Instantánea = la actividad más reciente de los datos, para que "hoy" siga siendo -// cierto respecto de cuándo se leyeron los logs y no del reloj de quien mira. +// Snapshot = the most recent activity in the data, so that "today" stays true +// relative to when the logs were read and not to the viewer's clock. const NOW = new Date(Math.max( ...DATA.map(d => +new Date(d.l)), ...MEM.map(m => +new Date(m.l)))); const BY_ID = new Map(DATA.map(d => [d.id, d])); const BY_NAME = new Map(MEM.map(m => [m.name, m])); -// Los enlaces [[...]] pueden apuntar al nombre declarado o al del archivo. +// [[...]] links may point to the declared name or to the file name. MEM.forEach(m => { const f = m.file.replace(/\.md$/, ''); if (!BY_NAME.has(f)) BY_NAME.set(f, m); }); const $ = s => document.querySelector(s); @@ -854,28 +854,28 @@ const rowsEl = $('#rows'), qEl = $('#q'), projEl = $('#proj'), deepEl = $('#deep let sortKey = 'l', sortDir = -1, lastFocus = null; let mSortKey = 'l', mSortDir = -1; -// Qué hay abierto en el lector: {kind: 's'|'m', key} o null. +// What is open in the reader: {kind: 's'|'m', key} or null. let open_ = null; -// Sin memorias la pestaña no aporta nada, así que arrancamos siempre en sesiones. +// Without memories the tab adds nothing, so we always start on sessions. let mode = 's'; -/* ---------- formato ---------- */ +/* ---------- formatting ---------- */ const DAY = 864e5; -const MES = ['ene','feb','mar','abr','may','jun','jul','ago','sep','oct','nov','dic']; +const MONTHS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; const pad = n => String(n).padStart(2, '0'); const daysAgo = iso => (NOW - new Date(iso)) / DAY; -const fmtDate = iso => { const d = new Date(iso); return `${pad(d.getDate())} ${MES[d.getMonth()]}`; }; +const fmtDate = iso => { const d = new Date(iso); return `${pad(d.getDate())} ${MONTHS[d.getMonth()]}`; }; const fmtTime = iso => { const d = new Date(iso); return `${pad(d.getHours())}:${pad(d.getMinutes())}`; }; function fmtRel(iso) { const n = daysAgo(iso); - if (n < 1) return 'hoy'; - if (n < 2) return 'ayer'; - if (n < 7) return `hace ${Math.floor(n)} d`; - if (n < 30) return `hace ${Math.floor(n / 7)} sem`; - return `hace ${Math.floor(n / 30)} mes`; + if (n < 1) return 'today'; + if (n < 2) return 'yesterday'; + if (n < 7) return `${Math.floor(n)} d ago`; + if (n < 30) return `${Math.floor(n / 7)} wk ago`; + return `${Math.floor(n / 30)} mo ago`; } function fmtDur(m) { if (m == null) return '—'; @@ -894,8 +894,8 @@ function stripeFor(iso) { const esc = s => String(s).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); -// Resalta la primera coincidencia. La aguja se escapa igual que el pajar: si -// no, buscar "&" o "<" nunca encontraría nada, porque en `s` ya son entidades. +// Highlights the first match. The needle is escaped like the haystack: otherwise +// searching for "&" or "<" would never find anything, because in `s` they are entities. function mark(text, q) { const s = esc(text); if (!q) return s; @@ -906,13 +906,13 @@ function mark(text, q) { + s.slice(i + needle.length); } -// Markdown mínimo: código, negritas y títulos. Los saltos los resuelve pre-wrap. -// El código se guarda aparte antes de tocar negritas, para que un ** dentro de -// un bloque de código quede tal cual. +// Minimal markdown: code, bold and headings. Line breaks are handled by pre-wrap. +// Code is set aside before touching bold, so that a ** inside a code block +// stays as is. function renderBody(text, wikilinks) { const stash = []; - // Tras esc() no queda ningún "<" crudo en el texto: todos son <. Por eso un - // marcador con "<" no puede colisionar con el contenido del mensaje. + // After esc() no raw "<" is left in the text: they are all <. So a + // placeholder with "<" cannot collide with the message content. const keep = html => `<K${stash.push(html) - 1}>`; let out = esc(text); @@ -922,20 +922,20 @@ function renderBody(text, wikilinks) { out = out.replace(/^#{1,6}\s+(.+)$/gm, '<b class="h">$1</b>'); out = out.replace(/\*\*([^*\n]+)\*\*/g, '<strong>$1</strong>'); if (wikilinks) { - // Va acá adentro, con el código ya guardado aparte: un [[...]] dentro de un - // bloque de código tiene que quedar como texto. + // This goes in here, with code already set aside: a [[...]] inside a + // code block must stay as text. out = out.replace(/\[\[([^\]\n]+)\]\]/g, (_, name) => { const hit = BY_NAME.get(name); return hit ? `<button type="button" class="wl" data-wl="${esc(hit.name)}">${esc(name)}</button>` - : `<span class="wl dead" title="todavía no existe una memoria con ese nombre">${esc(name)}</span>`; + : `<span class="wl dead" title="no memory with that name exists yet">${esc(name)}</span>`; }); } return out.replace(/<K(\d+)>/g, (_, i) => stash[i]); } -/* ---------- cabecera ---------- */ +/* ---------- header ---------- */ (function stats() { const msgs = DATA.reduce((a, d) => a + d.u, 0); @@ -943,12 +943,12 @@ function renderBody(text, wikilinks) { const ds = DATA.map(d => new Date(d.l)).sort((a, b) => a - b); const f = ds[0], l = ds[ds.length - 1]; $('#stats').innerHTML = [ - ['sesiones', DATA.length, ''], - ['proyectos', new Set(DATA.map(d => d.p)).size, ''], - ['tus mensajes', msgs, ''], - ['en disco', mb.toFixed(1), ' MB'], - ['período', `${pad(f.getDate())} ${MES[f.getMonth()]} – ${pad(l.getDate())} ${MES[l.getMonth()]}`, ''], - ['memorias', MEM.length, ''], + ['sessions', DATA.length, ''], + ['projects', new Set(DATA.map(d => d.p)).size, ''], + ['your messages', msgs, ''], + ['on disk', mb.toFixed(1), ' MB'], + ['period', `${pad(f.getDate())} ${MONTHS[f.getMonth()]} – ${pad(l.getDate())} ${MONTHS[l.getMonth()]}`, ''], + ['memories', MEM.length, ''], ].map(([k, v, s]) => `<div class="stat"><span class="stat-k">${k}</span><span class="stat-v">${v}${s ? `<small>${s}</small>` : ''}</span></div>`).join(''); })(); @@ -956,8 +956,8 @@ function fillProjects() { const src = mode === 'm' ? MEM : DATA; const counts = {}; src.forEach(d => counts[d.p] = (counts[d.p] || 0) + 1); - const label = mode === 'm' ? 'memorias' : 'sesiones'; - projEl.innerHTML = `<option value="">todos los proyectos (${src.length} ${label})</option>` + + const label = mode === 'm' ? 'memories' : 'sessions'; + projEl.innerHTML = `<option value="">all projects (${src.length} ${label})</option>` + Object.entries(counts).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])) .map(([p, n]) => `<option value="${esc(p)}">${esc(p)} · ${n}</option>`).join(''); } @@ -965,7 +965,7 @@ function fillProjects() { (function types() { const counts = {}; MEM.forEach(m => counts[m.ty] = (counts[m.ty] || 0) + 1); - typeEl.innerHTML = `<option value="">todos los tipos (${MEM.length})</option>` + + typeEl.innerHTML = `<option value="">all types (${MEM.length})</option>` + Object.entries(counts).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])) .map(([t, n]) => `<option value="${esc(t)}">${esc(t)} · ${n}</option>`).join(''); })(); @@ -973,7 +973,7 @@ function fillProjects() { $('#nS').textContent = DATA.length; $('#nM').textContent = MEM.length; -/* ---------- lista ---------- */ +/* ---------- list ---------- */ function convoText(d) { if (d._flat === undefined) d._flat = d.c.map(m => m.x).join('\n').toLowerCase(); @@ -1024,7 +1024,7 @@ function renderSessions() { const ql = q.toLowerCase(); if (!list.length) { - rowsEl.innerHTML = `<div class="none">Ninguna sesión coincide con ese filtro.</div>`; + rowsEl.innerHTML = `<div class="none">No session matches that filter.</div>`; countEl.textContent = ''; return; } @@ -1033,17 +1033,17 @@ function renderSessions() { const inMeta = q && ((d.t || '').toLowerCase().includes(ql) || d.p.toLowerCase().includes(ql)); const snip = q && deepEl.checked && !inMeta ? snippetFor(d, ql) : null; const chips = [ - d.e ? '<span class="chip chip-empty">vacía</span>' : '', - d.n ? '<span class="chip chip-auto">no interactiva</span>' : '', + d.e ? '<span class="chip chip-empty">empty</span>' : '', + d.n ? '<span class="chip chip-auto">non-interactive</span>' : '', d.b && d.b !== 'HEAD' ? `<span class="chip chip-branch">${esc(d.b)}</span>` : '', - d.i ? '<span class="chip" title="Ruta deducida de otras sesiones del mismo proyecto">ruta inferida</span>' : '', + d.i ? '<span class="chip" title="Path deduced from other sessions of the same project">inferred path</span>' : '', ].join(''); return ` <div class="row${d.e ? ' empty-row' : ' clickable'}" role="row" data-id="${d.id}"${d.e ? '' : ' tabindex="0"'}> <div class="stripe" style="--stripe:${stripeFor(d.l)}"></div> <div class="r-body"> - <p class="title">${d.t ? mark(d.t, q) : 'sesión abierta sin mensajes'}</p> + <p class="title">${d.t ? mark(d.t, q) : 'session opened with no messages'}</p> <div class="meta"><span class="path" title="${esc(d.p)}">${mark(d.p, q)}</span>${chips}</div> ${snip ? `<p class="snippet">${mark(snip, q)}</p>` : ''} </div> @@ -1060,11 +1060,11 @@ function renderSessions() { }).join(''); countEl.textContent = list.length === DATA.length - ? `${DATA.length} sesiones · clic en una fila para leerla` - : `${list.length} de ${DATA.length} sesiones`; + ? `${DATA.length} sessions · click a row to read it` + : `${list.length} of ${DATA.length} sessions`; } -/* ---------- memorias ---------- */ +/* ---------- memories ---------- */ function currentMem() { const q = qEl.value.trim().toLowerCase(); @@ -1095,7 +1095,7 @@ function renderMem() { const q = qEl.value.trim(); if (!list.length) { - rowsEl.innerHTML = `<div class="none">Ninguna memoria coincide con ese filtro.</div>`; + rowsEl.innerHTML = `<div class="none">No memory matches that filter.</div>`; countEl.textContent = ''; return; } @@ -1106,7 +1106,7 @@ function renderMem() { <div class="r-body"> <div class="mem-name"> <span class="nm">${mark(m.name, q)}</span> - ${m.ix ? '' : '<span class="chip chip-unlisted">fuera del índice</span>'} + ${m.ix ? '' : '<span class="chip chip-unlisted">unindexed</span>'} </div> ${m.desc ? `<p class="mem-desc">${mark(m.desc, q)}</p>` : ''} </div> @@ -1116,8 +1116,8 @@ function renderMem() { </div>`).join(''); countEl.textContent = list.length === MEM.length - ? `${MEM.length} memorias · clic en una para leerla` - : `${list.length} de ${MEM.length} memorias`; + ? `${MEM.length} memories · click one to read it` + : `${list.length} of ${MEM.length} memories`; } function render() { @@ -1131,17 +1131,17 @@ function setMode(next) { document.querySelectorAll('.tab').forEach(t => t.setAttribute('aria-selected', String(t.dataset.mode === mode))); qEl.placeholder = mode === 'm' - ? 'buscar nombre, descripción o contenido… (/)' - : 'buscar título, ruta o uuid… (/)'; - // Los filtros son de otro conjunto: arrastrarlos entre pestañas confunde. + ? 'search name, description or content… (/)' + : 'search title, path or uuid… (/)'; + // Filters belong to another set: carrying them across tabs is confusing. projEl.value = ''; fillProjects(); render(); } -/* ---------- lector ---------- */ +/* ---------- reader ---------- */ -const WHO = { u: 'vos', a: 'claude' }; +const WHO = { u: 'you', a: 'claude' }; function showReader() { bodyEl.scrollTop = 0; @@ -1158,11 +1158,11 @@ function openChat(id) { lastFocus = document.activeElement; $('#rCopy').hidden = false; - $('#rTitle').textContent = d.t || 'Sesión sin título'; + $('#rTitle').textContent = d.t || 'Untitled session'; $('#rMeta').innerHTML = [ `<span class="path">${esc(d.p)}</span>`, `<span>${fmtDate(d.l)} · ${fmtTime(d.l)}</span>`, - `<span>${d.u} tuyos / ${d.a} de Claude</span>`, + `<span>${d.u} yours / ${d.a} from Claude</span>`, `<span>${fmtDur(d.d)}</span>`, `<span class="chip">${d.id.slice(0, 8)}</span>`, ].join(''); @@ -1172,7 +1172,7 @@ function openChat(id) { ? `<div class="tool"><b>⚒</b><span>${esc(m.x)}</span></div>` : `<div class="turn turn-${m.r}"><span class="who">${WHO[m.r]}</span><div class="bubble">${renderBody(m.x)}</div></div>` ).join('') - : `<p class="reader-empty">Esta sesión no tiene mensajes.</p>`; + : `<p class="reader-empty">This session has no messages.</p>`; if (location.hash.slice(1) !== id) history.replaceState(null, '', '#' + id); showReader(); @@ -1183,7 +1183,7 @@ function openMemory(name) { if (!m) return; open_ = { kind: 'm', key: m.name }; lastFocus = document.activeElement; - // El botón de copiar reanuda una sesión: en una memoria no aplica. + // The copy button resumes a session: it does not apply to a memory. $('#rCopy').hidden = true; $('#rTitle').textContent = m.name; @@ -1192,26 +1192,26 @@ function openMemory(name) { `<span class="path">${esc(m.p)}</span>`, `<span>${fmtDate(m.l)} · ${fmtTime(m.l)}</span>`, `<span>${m.k} KB</span>`, - m.ix ? '' : '<span class="chip chip-unlisted">fuera del índice</span>', + m.ix ? '' : '<span class="chip chip-unlisted">unindexed</span>', ].filter(Boolean).join(''); - const origen = BY_ID.get(m.src); - const pie = []; - if (m.desc) pie.push(`<div><span class="lbl">descripción</span>${esc(m.desc)}</div>`); - pie.push(`<div><span class="lbl">archivo</span>${esc(m.file)}</div>`); + const source = BY_ID.get(m.src); + const foot = []; + if (m.desc) foot.push(`<div><span class="lbl">description</span>${esc(m.desc)}</div>`); + foot.push(`<div><span class="lbl">file</span>${esc(m.file)}</div>`); if (!m.ix) { - pie.push(`<div>${m.hix - ? 'No figura en MEMORY.md: sigue en disco, pero no se carga en contexto.' - : 'Este proyecto no tiene MEMORY.md, así que no se carga ninguna de sus memorias.'}</div>`); + foot.push(`<div>${m.hix + ? 'Not listed in MEMORY.md: still on disk, but not loaded into context.' + : 'This project has no MEMORY.md, so none of its memories are loaded.'}</div>`); } if (m.src) { - pie.push(origen - ? `<button type="button" class="jump" data-chat="${esc(m.src)}">↩ la escribió esta sesión: ${esc(origen.t || m.src.slice(0, 8))}</button>` - : `<div><span class="lbl">la escribió</span>la sesión ${esc(m.src.slice(0, 8))}, que ya no está en disco</div>`); + foot.push(source + ? `<button type="button" class="jump" data-chat="${esc(m.src)}">↩ written by this session: ${esc(source.t || m.src.slice(0, 8))}</button>` + : `<div><span class="lbl">written by</span>session ${esc(m.src.slice(0, 8))}, no longer on disk</div>`); } bodyEl.innerHTML = `<div class="mem-body">${renderBody(m.body, true)}</div>` - + `<div class="mem-foot">${pie.join('')}</div>`; + + `<div class="mem-foot">${foot.join('')}</div>`; const hash = 'm:' + m.name; if (decodeURIComponent(location.hash.slice(1)) !== hash) { @@ -1241,7 +1241,7 @@ function openFromHash() { } } -// El diálogo es aria-modal: el foco tiene que quedar adentro mientras está abierto. +// The dialog is aria-modal: focus must stay inside while it is open. readerEl.addEventListener('keydown', e => { if (e.key !== 'Tab') return; const f = [...readerEl.querySelectorAll('button, [tabindex]:not([tabindex="-1"])')] @@ -1255,7 +1255,7 @@ readerEl.addEventListener('keydown', e => { } }); -/* ---------- copiar ---------- */ +/* ---------- copy ---------- */ const cmdFor = d => `cd ${d.p} && claude --resume ${d.id}`; @@ -1285,11 +1285,11 @@ function copyFor(d, btn) { if (!d) return; copyText(cmdFor(d)).then(() => { if (btn) { btn.classList.add('done'); setTimeout(() => btn.classList.remove('done'), 1400); } - toast('Copiado: ' + cmdFor(d)); - }).catch(() => toast('No se pudo copiar — el comando está en el tooltip')); + toast('Copied: ' + cmdFor(d)); + }).catch(() => toast('Could not copy — the command is in the tooltip')); } -/* ---------- eventos ---------- */ +/* ---------- events ---------- */ rowsEl.addEventListener('click', e => { const copyBtn = e.target.closest('[data-copy]'); @@ -1313,7 +1313,7 @@ rowsEl.addEventListener('keydown', e => { else openChat(row.dataset.id); }); -// Dentro del lector: enlaces [[...]] entre memorias y salto a la sesión de origen. +// Inside the reader: [[...]] links between memories and jump to the source session. bodyEl.addEventListener('click', e => { const wl = e.target.closest('[data-wl]'); if (wl) { openMemory(wl.dataset.wl); return; } @@ -1345,7 +1345,7 @@ document.addEventListener('keydown', e => { $('#theme').addEventListener('click', () => { const next = document.documentElement.dataset.theme === 'dark' ? 'light' : 'dark'; document.documentElement.dataset.theme = next; - try { localStorage.setItem('cs-tema', next); } catch (e) {} + try { localStorage.setItem('cl-theme', next); } catch (e) {} }); document.querySelectorAll('[data-sort]').forEach(btn => { @@ -1377,10 +1377,10 @@ document.querySelector('[data-msort="l"]').setAttribute('aria-sort', 'descending document.querySelectorAll('.tab').forEach(t => t.addEventListener('click', () => setMode(t.dataset.mode))); -// Sin memorias la pestaña no tiene nada que mostrar. +// Without memories the tab has nothing to show. if (!MEM.length) document.querySelector('.tab[data-mode="m"]').hidden = true; -$('#snap').textContent = `Instantánea leída el ${pad(NOW.getDate())} ${MES[NOW.getMonth()]} ${NOW.getFullYear()} a las ${fmtTime(NOW.toISOString())}. Las fechas relativas son respecto de ese momento; volvé a correr claude-logbook --html para actualizarla.`; +$('#snap').textContent = `Snapshot read on ${pad(NOW.getDate())} ${MONTHS[NOW.getMonth()]} ${NOW.getFullYear()} at ${fmtTime(NOW.toISOString())}. Relative dates are measured from that moment; run claude-logbook --html again to refresh it.`; [qEl, projEl, deepEl, emptyEl, typeEl, unlistedEl].forEach( el => el.addEventListener(el === qEl ? 'input' : 'change', render)); |