Listen and Read: sub-tabs share the Back row, duplicate headings hidden on phones, page tab rows scroll on one line

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-29 10:46:48 -04:00
1 parent 3fb336b3c7
commit d9d3743816
2 files changed
+8 -2

No files matched your search

+3
View File
@@ -256,9 +256,11 @@ const lastSub = g => { let l = null; try { l = JSON.parse(localStorage.getItem(n
/** The row of buttons under the top bar that switches between the parts of Listen and Read. */
function drawSubnav(name) {
const el = $('#subnav'); if (!el) return; const g = leafOf(name), items = g ? MERGED[g][1].filter(allowed) : [];
document.body.classList.remove('subtabs');
if (!g || items.length < 2) { el.hidden = true; el.innerHTML = ''; return; }
try { localStorage.setItem(nk('nav_last_' + g), JSON.stringify(name)); } catch {}
el.innerHTML = items.map(id => `<a href="#/${id}" class="${id === name ? 'on' : ''}" ${id === name ? 'aria-current="page"' : ''}>${esc(tabLabel(id))}</a>`).join(''); el.hidden = false;
document.body.classList.add('subtabs'); const on = el.querySelector('a.on'); if (on) on.scrollIntoView({ inline: 'center', block: 'nearest' });
}
const navIdOf = name => name === 'signal' && sgInChat() ? 'chat' : name === 'edit' ? 'files' : (name === 'tasks' || name === 'calendar') ? 'planner' : leafOf(name) || name;
let curRoute = '';
@@ -290,6 +292,7 @@ function drawNav() {
$('#nvb').onclick = () => { if (navIdx > 0) history.back(); else if (parentHash()) location.hash = parentHash(); };
$('#nvf').onclick = () => history.forward();
}
const sn = $('#subnav'); if (sn && sn.parentNode !== el) el.insertBefore(sn, $('#nvt')); // Listen/Read buttons share the Back/Forward row
$('#nvb').disabled = !canBack; $('#nvf').disabled = !canFwd;
const t = TABS.find(x => x[0] === (curRoute || activeTab)); $('#nvt').textContent = t ? t[1] : '';
el.hidden = false;