feat(mobile): show last commit date in expand row on mobile

Add an expand-commit span inside the expand row that displays the last
commit date. Hidden on desktop, visible only on mobile (max-width: 960px)
via media query, mirroring the commit column that appears in the full
table. Relative time formatting is applied via JS on page load.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen 2026-03-24 12:56:04 +08:00
parent f1799c2a44
commit 7df2e36334
No known key found for this signature in database
GPG Key ID: B93DE4F003C33630
3 changed files with 15 additions and 0 deletions

View File

@ -79,6 +79,10 @@ document.querySelectorAll(".col-commit[data-commit]").forEach(function (td) {
if (time) time.textContent = relativeTime(td.dataset.commit);
});
document.querySelectorAll(".expand-commit time[datetime]").forEach(function (time) {
time.textContent = relativeTime(time.getAttribute("datetime"));
});
// Store original row order for sort reset
rows.forEach(function (row, i) {
row._origIndex = i;

View File

@ -789,6 +789,16 @@ th[data-sort].sort-asc::after {
color: var(--line-strong);
}
.expand-commit {
display: none;
}
@media (max-width: 960px) {
.expand-commit {
display: inline;
}
}
.tag {
position: relative;
border: 1px solid transparent;

View File

@ -220,6 +220,7 @@
rel="noopener"
>{{ entry.url | replace("https://", "") }}</a
>
{% if entry.last_commit_at %}<span class="expand-commit"><span class="expand-sep">/</span>Last commit <time datetime="{{ entry.last_commit_at }}">{{ entry.last_commit_at[:10] }}</time></span>{% endif %}
</div>
</div>
</td>