diff --git a/web.py b/web.py index 6524d9b..aa4ae3f 100644 --- a/web.py +++ b/web.py @@ -1472,24 +1472,33 @@ async function dayHighlights(dayId, analyzableFiles) { box.appendChild(labels); if (dayActiveSections.length) { - const chips = document.createElement('div'); - chips.className = 'chips'; - chips.setAttribute('role', 'list'); - chips.setAttribute('aria-label', 'Day loud sections — click to jump, J/K to step across files'); - dayActiveSections.forEach((sec, si) => { - const c = document.createElement('button'); - c.className = 'chip'; - c.setAttribute('role', 'listitem'); - c.title = sec.filename + ' @ ' + fmtT(sec.start); - const d = new Date(sec.absStart * 1000); - const hms = d.getHours().toString().padStart(2,'0') + ':' - + d.getMinutes().toString().padStart(2,'0') + ':' - + d.getSeconds().toString().padStart(2,'0'); - c.textContent = hms; - c.addEventListener('click', () => jumpToDaySection(si)); - chips.appendChild(c); - }); - box.appendChild(chips); + const MAX_DAY_CHIPS = 50; + if (dayActiveSections.length > MAX_DAY_CHIPS) { + const note = document.createElement('p'); + note.className = 'quiet'; + note.style.marginTop = '6px'; + note.textContent = `${dayActiveSections.length} sections — use J / K to navigate`; + box.appendChild(note); + } else { + const chips = document.createElement('div'); + chips.className = 'chips'; + chips.setAttribute('role', 'list'); + chips.setAttribute('aria-label', 'Day loud sections — click to jump, J/K to step across files'); + dayActiveSections.forEach((sec, si) => { + const c = document.createElement('button'); + c.className = 'chip'; + c.setAttribute('role', 'listitem'); + c.title = sec.filename + ' @ ' + fmtT(sec.start); + const d = new Date(sec.absStart * 1000); + const hms = d.getHours().toString().padStart(2,'0') + ':' + + d.getMinutes().toString().padStart(2,'0') + ':' + + d.getSeconds().toString().padStart(2,'0'); + c.textContent = hms; + c.addEventListener('click', () => jumpToDaySection(si)); + chips.appendChild(c); + }); + box.appendChild(chips); + } } const summary = document.createElement('div');