From 76b19a158f6c69962605173359754286a2c28381 Mon Sep 17 00:00:00 2001 From: hayaksi1 <193020925+hayaksi1@users.noreply.github.com> Date: Tue, 25 Aug 2026 15:56:16 +0300 Subject: [PATCH] Show the build date in the screenshot gallery footer The gallery gave no indication of how old the screenshots on the page were, which is one of the remaining items on the GitHub Pages improvement list. The generator now writes the time it ran alongside the screenshot data, and the page renders it in the footer next to the existing links. --- screenshots/html/data.js | 1 + screenshots/html/screenshots.css | 5 +++++ screenshots/html/script.js | 10 +++++++++- tools/test/generateAllScreenshots.py | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/screenshots/html/data.js b/screenshots/html/data.js index 62cea77dcf..8cf60a31ef 100644 --- a/screenshots/html/data.js +++ b/screenshots/html/data.js @@ -1,4 +1,5 @@ // Generated file, do not edit +export const buildDate = 1787667600; export const screenshots = [ ["en","en-dark","de",], ["features.messages.impl.timeline.components.event_ATimelineItemEventRow_Day_0_en","features.messages.impl.timeline.components.event_ATimelineItemEventRow_Night_0_en",20675,], diff --git a/screenshots/html/screenshots.css b/screenshots/html/screenshots.css index f946c82e81..90842b7ac9 100644 --- a/screenshots/html/screenshots.css +++ b/screenshots/html/screenshots.css @@ -150,6 +150,11 @@ input { height: 40px; } +.build-date { + margin-right: 20px; + font-size: 13px; +} + a:link { color: white; font-size: 14px; diff --git a/screenshots/html/script.js b/screenshots/html/script.js index 4a9586d591..44b2522a5d 100644 --- a/screenshots/html/script.js +++ b/screenshots/html/script.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial. * Please see LICENSE files in the repository root for full details. */ -import { screenshots } from './data.js'; +import { buildDate, screenshots } from './data.js'; const URL_PARAM_LANGUAGES = "l"; const URL_PARAM_IMAGE_WIDTH = "w"; @@ -360,5 +360,13 @@ function addTable() { document.getElementById('lines').textContent = `${linesCounter} lines`; } +function addBuildDate() { + const element = document.createElement('div'); + element.className = 'build-date'; + element.textContent = `Built on ${new Date(buildDate * 1000).toLocaleDateString()}`; + document.getElementById('footer').appendChild(element); +} + addForm(); +addBuildDate(); addTable(); diff --git a/tools/test/generateAllScreenshots.py b/tools/test/generateAllScreenshots.py index e10a7abb74..a4e3468d80 100755 --- a/tools/test/generateAllScreenshots.py +++ b/tools/test/generateAllScreenshots.py @@ -167,6 +167,7 @@ def generateJavascriptFile(): with open("screenshots/html/data.js", "w") as f: f.write("// Generated file, do not edit\n") + f.write("export const buildDate = %d;\n" % int(time.time())) f.write("export const screenshots = [\n") for line in data: f.write("[")