Skip to content

Commit 749860a

Browse files
TMHSDigitalclaude
andcommitted
site: fixes from the licence freshness review
- The homepage cards age by the build time, as the prerender and the freshness line do, instead of the visitor's clock; the page never disagrees with itself. - The recent-checks wording counts the build day: 'Checked on <date> or in the 30 days before it'. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wc67NX9MM964uaVGn4bpZJ
1 parent f00ce5d commit 749860a

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎site/lib/freshness.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function freshnessLineHtml(stats, stamp, href) {
5050
const BUCKET_WORDS = { fresh: "fresh", aging: "aging", stale: "stale", unknown: "no check date" };
5151

5252
function recentHtml(recent, stamp) {
53-
if (!recent.length) return `<p>None in the ${RECENT_DAYS} days before ${esc(stamp)}.</p>`;
53+
if (!recent.length) return `<p>None checked on ${esc(stamp)} or in the ${RECENT_DAYS} days before it.</p>`;
5454
const items = recent
5555
.map(
5656
(r) =>
@@ -128,7 +128,7 @@ export function freshnessPageHtml({ stats, site, stamp, total, hasCard }) {
128128
<div class="entry-lead"><p>An entry's verified date is when someone last read its licence at the source. Each entry's page quotes that licence with dates. Deprecated entries are not counted.</p></div>
129129
<section aria-labelledby="recent">
130130
<h2 id="recent">Most recently checked</h2>
131-
<p>Checked in the ${RECENT_DAYS} days before ${esc(stamp)}, newest first. The catalog keeps only the latest check date, so a first check and a recheck look the same.</p>
131+
<p>Checked on ${esc(stamp)} or in the ${RECENT_DAYS} days before it, newest first. The catalog keeps only the latest check date, so a first check and a recheck look the same.</p>
132132
${recentHtml(stats.recent, stamp)}
133133
</section>
134134
<section aria-labelledby="every-check">

‎site/lib/lib.test.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ has("entry page footer links freshness", p, '<a href="../../freshness/">Licence
421421
has("stack page footer links freshness", spage, '<a href="../../freshness/">Licence freshness</a>');
422422
has("llms points at freshness", lt, "Licence freshness, every entry by check date: https://x.test/s/freshness/");
423423

424+
/* freshness: review fixes -------------------------------------------------- */
425+
has("recent window wording counts the build day", fp, "Checked on 2026-09-25 or in the 30 days before it, newest first.");
426+
has("empty recent window wording counts the build day", freshnessPageHtml({ stats: freshnessStats([fe("a", "Alpha", 90)], fNow), site, stamp: "2026-09-25", total: 1, hasCard: false }), "None checked on 2026-09-25 or in the 30 days before it.");
427+
424428
/* report (keep last) ------------------------------------------------------ */
425429
if (failures.length) {
426430
console.error(`lib.test failed (${failures.length}):`);

‎site/public/app.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@
5757
side_scroller: "side-scroller",
5858
"2d_flat": "flat ui",
5959
};
60-
const NOW = Date.now();
60+
// Ages are measured at build time, like the prerendered cards and the
61+
// freshness line, so the page never disagrees with itself. A weekly
62+
// scheduled build keeps the build time recent.
63+
const built = Date.parse(data.generatedAt);
64+
const NOW = Number.isNaN(built) ? Date.now() : built;
6165
const FRESH_DAYS = 180;
6266
const AGING_DAYS = 365;
6367

0 commit comments

Comments
 (0)