diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2026-10-03 19:57:41 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2026-10-03 19:57:41 -0300 |
| commit | ec23516d63061c066556d22f922b3c61e5837595 (patch) | |
| tree | aefa64efd2556482d7b6752e8bc0a23ff581f51a | |
| parent | a5896fe2e28eb1e9ff9affe5d47ccd443bee5fc2 (diff) | |
| download | claude-logbook-ec23516d63061c066556d22f922b3c61e5837595.tar.gz claude-logbook-ec23516d63061c066556d22f922b3c61e5837595.zip | |
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.
| -rw-r--r-- | claude_logbook/template.html | 5 |
1 files changed, 4 insertions, 1 deletions
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]) => `<div class="stat"><span class="stat-k">${k}</span><span class="stat-v">${v}${s ? `<small>${s}</small>` : ''}</span></div>`).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 ---------- */ |