fix: cap day-highlights chips at 50; show J/K hint when over limit
Rendering 793 individual buttons is both visually overwhelming and slow.
When a day has more than 50 loud sections, replace the chip list with a
single note ("N sections — use J / K to navigate"). J/K navigation and
the SVG timeline still cover all sections.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1472,6 +1472,14 @@ async function dayHighlights(dayId, analyzableFiles) {
|
|||||||
box.appendChild(labels);
|
box.appendChild(labels);
|
||||||
|
|
||||||
if (dayActiveSections.length) {
|
if (dayActiveSections.length) {
|
||||||
|
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');
|
const chips = document.createElement('div');
|
||||||
chips.className = 'chips';
|
chips.className = 'chips';
|
||||||
chips.setAttribute('role', 'list');
|
chips.setAttribute('role', 'list');
|
||||||
@@ -1491,6 +1499,7 @@ async function dayHighlights(dayId, analyzableFiles) {
|
|||||||
});
|
});
|
||||||
box.appendChild(chips);
|
box.appendChild(chips);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const summary = document.createElement('div');
|
const summary = document.createElement('div');
|
||||||
summary.className = 'quiet';
|
summary.className = 'quiet';
|
||||||
|
|||||||
Reference in New Issue
Block a user