From f546a8a1578bef9fbc144580b84f51e3e90480b1 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sat, 3 Oct 2026 22:45:27 -0300 Subject: Show branches with their inherited history and mark directory changes --- claude_logbook/template.html | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) (limited to 'claude_logbook/template.html') diff --git a/claude_logbook/template.html b/claude_logbook/template.html index cd3d8b5..39740ac 100644 --- a/claude_logbook/template.html +++ b/claude_logbook/template.html @@ -547,6 +547,28 @@ .compact[open] summary::before { content: '▾ '; } .compact .bubble { margin-top: 8px; font-size: 13.5px; } + .inherited { margin: 0 0 6px; } + .inherited summary { border-top: 0; } + .inherited-body { padding: 14px 0 4px; opacity: .78; } + .inherited-body > :first-child { margin-top: 0; } + .inherited-end { + font-family: var(--mono); + font-size: 11.5px; + color: var(--muted); + text-align: center; + padding: 6px 0; + margin-top: 14px; + border-bottom: 1px dashed var(--line); + } + + .cwd { + font-family: var(--mono); + font-size: 11.5px; + color: var(--muted); + padding: 3px 0 3px 12px; + overflow-wrap: anywhere; + } + .reader-empty { color: var(--muted); font-family: var(--mono); font-size: 13px; text-align: center; padding: 60px 20px; } /* ---------- toast ---------- */ @@ -1079,6 +1101,7 @@ function renderSessions() { d.n ? 'non-interactive' : '', d.b && d.b !== 'HEAD' ? `${esc(d.b)}` : '', d.i ? 'inferred path' : '', + d.o ? `branch` : '', ].join(''); return ` @@ -1193,6 +1216,16 @@ function showReader() { if (!SINGLE) readerEl.focus(); } +function blockHtml(m) { + return m.r === 't' + ? `
⚒${esc(m.x)}
` + : m.r === 'd' + ? `
→ ${esc(m.x)}
` + : m.r === 'c' + ? `
Context compacted here · the summary Claude kept
${renderBody(m.x)}
` + : `
${WHO[m.r]}
${renderBody(m.x)}
`; +} + function openChat(id) { const d = BY_ID.get(id); if (!d || (d.e && !SINGLE)) return; @@ -1210,13 +1243,12 @@ function openChat(id) { `${d.id.slice(0, 8)}`, ].filter(Boolean).join(''); + const h = d.h || 0, old = d.c.slice(0, h), own = d.c.slice(h); + const inherited = h + ? `
Inherited history · ${old.filter(m => m.r === 'u' || m.r === 'a').length} messages from “${esc(d.ot || d.o.slice(0, 8))}”
${old.map(blockHtml).join('')}
the branch starts here
` + : ''; bodyEl.innerHTML = d.c.length - ? d.c.map(m => m.r === 't' - ? `
⚒${esc(m.x)}
` - : m.r === 'c' - ? `
Context compacted here · the summary Claude kept
${renderBody(m.x)}
` - : `
${WHO[m.r]}
${renderBody(m.x)}
` - ).join('') + ? inherited + own.map(blockHtml).join('') : `

This session has no messages.

`; if (!SINGLE && location.hash.slice(1) !== id) history.replaceState(null, '', '#' + id); -- cgit v1.2.3