From ec23516d63061c066556d22f922b3c61e5837595 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sat, 3 Oct 2026 19:57:41 -0300 Subject: Hide the memories tab and stat on pages without memories A shared session never carries memories, so its page showed an empty Memories tab and a 0 in the stats. --- claude_logbook/template.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'claude_logbook') diff --git a/claude_logbook/template.html b/claude_logbook/template.html index 20dfbee..9fa37f6 100644 --- a/claude_logbook/template.html +++ b/claude_logbook/template.html @@ -965,7 +965,7 @@ function renderBody(text, wikilinks) { ['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, ''], + ...(MEM.length ? [['memories', MEM.length, '']] : []), ].map(([k, v, s]) => `
${k}${v}${s ? `${s}` : ''}
`).join(''); })(); @@ -989,6 +989,9 @@ function fillProjects() { $('#nS').textContent = DATA.length; $('#nM').textContent = MEM.length; +// A page without memories (a shared session, or none written yet) has +// nothing to switch to: no tabs at all. +if (!MEM.length) document.querySelector('.tabs').style.display = 'none'; // .tabs is flex: [hidden] would lose /* ---------- list ---------- */ -- cgit v1.2.3