From 80ea7b675e918b930af01b82b60583d474bc0105 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sat, 3 Oct 2026 23:29:44 -0300 Subject: Share and export a session's images with --images --- claude_logbook/template.html | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'claude_logbook/template.html') diff --git a/claude_logbook/template.html b/claude_logbook/template.html index 39740ac..85edcb4 100644 --- a/claude_logbook/template.html +++ b/claude_logbook/template.html @@ -561,6 +561,25 @@ border-bottom: 1px dashed var(--line); } + .shot { margin: 8px 0 8px 12px; } + .shot.mine { margin-left: 0; } + .shot.mine img { border-color: var(--amber-lo); } + .shot img { + display: block; + max-width: min(100%, 360px); + max-height: 260px; + border: 1px solid var(--line); + border-radius: 8px; + cursor: zoom-in; + } + .shot.zoom img { max-width: 100%; max-height: none; cursor: zoom-out; } + .shot-missing { + font-family: var(--mono); + font-size: 11.5px; + color: var(--muted); + padding: 3px 0 3px 12px; + } + .cwd { font-family: var(--mono); font-size: 11.5px; @@ -1216,11 +1235,24 @@ function showReader() { if (!SINGLE) readerEl.focus(); } +// Only a data: URL of a raster image ever reaches an : the server checks +// it, and this checks it again for pages written by hand. +const IMG_RE = /^data:image\/(png|jpeg|gif|webp);base64,[A-Za-z0-9+/=\s]+$/; + +function imageHtml(m) { + const what = m.r === 'i' ? 'image attached' : 'image from the tool'; + if (!m.src || !IMG_RE.test(m.src)) + return `
▣ ${what}${m.src ? '' : ' (not included)'}
`; + return `
${what}
`; +} + function blockHtml(m) { return m.r === 't' ? `
⚒${esc(m.x)}
` : m.r === 'd' ? `
→ ${esc(m.x)}
` + : m.r === 'i' || m.r === 'v' + ? imageHtml(m) : m.r === 'c' ? `
Context compacted here · the summary Claude kept
${renderBody(m.x)}
` : `
${WHO[m.r]}
${renderBody(m.x)}
`; @@ -1392,6 +1424,8 @@ rowsEl.addEventListener('keydown', e => { // Inside the reader: [[...]] links between memories and jump to the source session. bodyEl.addEventListener('click', e => { + const shot = e.target.closest('.shot'); + if (shot) { shot.classList.toggle('zoom'); return; } const wl = e.target.closest('[data-wl]'); if (wl) { openMemory(wl.dataset.wl); return; } const jump = e.target.closest('[data-chat]'); -- cgit v1.2.3