From 7df2e3633409d53d174d46eedb371635165f8746 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Tue, 24 Mar 2026 12:56:04 +0800 Subject: [PATCH] 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 --- website/static/main.js | 4 ++++ website/static/style.css | 10 ++++++++++ website/templates/index.html | 1 + 3 files changed, 15 insertions(+) diff --git a/website/static/main.js b/website/static/main.js index 535e916..f3e29f6 100644 --- a/website/static/main.js +++ b/website/static/main.js @@ -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; diff --git a/website/static/style.css b/website/static/style.css index 0396488..955071e 100644 --- a/website/static/style.css +++ b/website/static/style.css @@ -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; diff --git a/website/templates/index.html b/website/templates/index.html index 77a3c1a..8ba140e 100644 --- a/website/templates/index.html +++ b/website/templates/index.html @@ -220,6 +220,7 @@ rel="noopener" >{{ entry.url | replace("https://", "") }} + {% if entry.last_commit_at %}/Last commit {% endif %}