Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions site/src/scripts/techapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,9 @@ function countUp(node, target, opts = {}) {
</a>`;
}).join("");

// The chart already shows every sync; the list is the recent detail — cap it
// so the section stays compact, with a link to the full commit history.
const LIST_MAX = 8;
const recent = points.slice().reverse();
const shown = recent.slice(0, LIST_MAX);
const rows = shown.map((point) => {
// Show every sync (newest first), growth-first. The list scrolls (CSS
// max-height) so the full history stays reachable without a giant section.
listEl.innerHTML = points.slice().reverse().map((point) => {
const changes = point.changes.length
? point.changes.map((row) => `${shortLabel[row.key]} ${formatDelta(row.delta)}`).join(", ")
: (point.baseline ? "baseline snapshot" : `total ${formatDelta(point.delta)}`);
Expand All @@ -312,14 +309,7 @@ function countUp(node, target, opts = {}) {
</a>
<small>${esc(changes)}${tag ? ` · ${esc(tag)}` : ""}</small>
</span></li>`;
});
const hidden = recent.length - shown.length;
if (hidden > 0) {
rows.push(`<li class="history-more"><span class="history-dot is-faint"></span><span>
<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>
</span></li>`);
}
listEl.innerHTML = rows.join("");
}).join("");
}

const fmtWhen = (date) => date
Expand Down
14 changes: 10 additions & 4 deletions site/src/styles/techapi.css
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,16 @@ code, .mono { font-family: var(--mono); }
padding: 0;
display: grid;
gap: 14px;
}
/* full history stays reachable, but the panel never balloons */
max-height: 340px;
overflow-y: auto;
padding-right: 8px;
scrollbar-width: thin;
scrollbar-color: var(--border-strong) transparent;
}
.history-list::-webkit-scrollbar { width: 8px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-chart {
min-height: 210px;
margin-top: 18px;
Expand Down Expand Up @@ -404,9 +413,6 @@ code, .mono { font-family: var(--mono); }
font-size: 11.5px;
color: var(--muted);
}
.history-more a { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 500; }
.history-more a:hover { color: var(--accent-text); }
.history-dot.is-faint { background: var(--faint); box-shadow: none; }
@media (max-width: 760px) {
.history { grid-template-columns: 1fr; }
.history-grid { grid-template-columns: 1fr; }
Expand Down
Loading