Skip to content

Commit 72283ac

Browse files
committed
fix(site): show the full dump history again, scrollable instead of capped
Capping the timeline list to the recent 8 reintroduced the original problem — older syncs were hidden. Show every sync again (now that rows are clean, growth-first lines rather than a wall of repeated commit names) and cap the list height with a scroll instead, so the whole history stays reachable without making the section huge. Refs #1
1 parent e4a0cdf commit 72283ac

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

site/src/scripts/techapi.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,9 @@ function countUp(node, target, opts = {}) {
293293
</a>`;
294294
}).join("");
295295

296-
// The chart already shows every sync; the list is the recent detail — cap it
297-
// so the section stays compact, with a link to the full commit history.
298-
const LIST_MAX = 8;
299-
const recent = points.slice().reverse();
300-
const shown = recent.slice(0, LIST_MAX);
301-
const rows = shown.map((point) => {
296+
// Show every sync (newest first), growth-first. The list scrolls (CSS
297+
// max-height) so the full history stays reachable without a giant section.
298+
listEl.innerHTML = points.slice().reverse().map((point) => {
302299
const changes = point.changes.length
303300
? point.changes.map((row) => `${shortLabel[row.key]} ${formatDelta(row.delta)}`).join(", ")
304301
: (point.baseline ? "baseline snapshot" : `total ${formatDelta(point.delta)}`);
@@ -312,14 +309,7 @@ function countUp(node, target, opts = {}) {
312309
</a>
313310
<small>${esc(changes)}${tag ? ` · ${esc(tag)}` : ""}</small>
314311
</span></li>`;
315-
});
316-
const hidden = recent.length - shown.length;
317-
if (hidden > 0) {
318-
rows.push(`<li class="history-more"><span class="history-dot is-faint"></span><span>
319-
<a href="https://github.com/GetTechAPI/TechAPI/commits/main/site/public/v1/index.json" target="_blank" rel="noopener">${hidden} earlier ${hidden === 1 ? "sync" : "syncs"} →</a>
320-
</span></li>`);
321-
}
322-
listEl.innerHTML = rows.join("");
312+
}).join("");
323313
}
324314

325315
const fmtWhen = (date) => date

site/src/styles/techapi.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,16 @@ code, .mono { font-family: var(--mono); }
301301
padding: 0;
302302
display: grid;
303303
gap: 14px;
304-
}
304+
/* full history stays reachable, but the panel never balloons */
305+
max-height: 340px;
306+
overflow-y: auto;
307+
padding-right: 8px;
308+
scrollbar-width: thin;
309+
scrollbar-color: var(--border-strong) transparent;
310+
}
311+
.history-list::-webkit-scrollbar { width: 8px; }
312+
.history-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
313+
.history-list::-webkit-scrollbar-track { background: transparent; }
305314
.history-chart {
306315
min-height: 210px;
307316
margin-top: 18px;
@@ -404,9 +413,6 @@ code, .mono { font-family: var(--mono); }
404413
font-size: 11.5px;
405414
color: var(--muted);
406415
}
407-
.history-more a { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 500; }
408-
.history-more a:hover { color: var(--accent-text); }
409-
.history-dot.is-faint { background: var(--faint); box-shadow: none; }
410416
@media (max-width: 760px) {
411417
.history { grid-template-columns: 1fr; }
412418
.history-grid { grid-template-columns: 1fr; }

0 commit comments

Comments
 (0)