upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/progress_dashboard.py
diff options
context:
space:
mode:
authorLeonardo Guimaraes <leozinhoszg@gmail.com>2026-11-22 14:48:31 -0300
committerLeonardo Guimaraes <leozinhoszg@gmail.com>2026-11-22 14:48:31 -0300
commit56c0bc848e75fa64628a7b006f33c7f0d3e02129 (patch)
treeb4100a78dceb162fa19b7ebab629c1c4379a65e5 /tools/progress_dashboard.py
parent4958cb1e7230787b669bd65289fcb2d59061ea59 (diff)
progress_dashboard: project logo in the header, sticky filters, theme switch
The page embeds assets/logo.png as a data: URI, so it stays one file that opens from disk; without the asset it shows no image. The filters, search and section links stay at the top while scrolling, each status filter shows its count, and a button clears the filters. Panel metrics are bars with their ratio, panels without evidence move after the ones with it, and the latest merges are a table with item tags and authors. A theme button overrides the system theme (kept in localStorage when it is available); the treemaps and the trend chart redraw on a theme change. Neutrals carry a faint tint from the logo; status colours are unchanged.
Diffstat (limited to 'tools/progress_dashboard.py')
-rw-r--r--tools/progress_dashboard.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/progress_dashboard.py b/tools/progress_dashboard.py
index a4a137e31..bbb338853 100644
--- a/tools/progress_dashboard.py
+++ b/tools/progress_dashboard.py
@@ -25,6 +25,7 @@ No game data leaves the inputs: the page and the JSON carry counts, pass/fail, e
25own document text; never a shader name, a carved file name or a path into the game copy. 25own document text; never a shader name, a carved file name or a path into the game copy.
26""" 26"""
27import argparse 27import argparse
28import base64
28import datetime as dt 29import datetime as dt
29import hashlib 30import hashlib
30import json 31import json
@@ -39,6 +40,7 @@ from concurrent.futures import ThreadPoolExecutor
39 40
40ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 41ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
41TEMPLATE = os.path.join(ROOT, "tools", "progress_dashboard.html") 42TEMPLATE = os.path.join(ROOT, "tools", "progress_dashboard.html")
43LOGO = os.path.join(ROOT, "assets", "logo.png")
42SCHEMA = "leonida.progress/1" 44SCHEMA = "leonida.progress/1"
43STATUSES = ("verified", "implemented", "partial", "failed", "missing", "blocked", "unknown") 45STATUSES = ("verified", "implemented", "partial", "failed", "missing", "blocked", "unknown")
44PYTEST_MARKERS = re.compile(r"^import pytest|^ *HAVE_NUMPY =", re.M) # the CI selection rule (ci.yml) 46PYTEST_MARKERS = re.compile(r"^import pytest|^ *HAVE_NUMPY =", re.M) # the CI selection rule (ci.yml)
@@ -865,11 +867,22 @@ def summary_line(snap):
865 "metrics": {m["id"]: {"v": m["value"], "n": m["numerator"], "d": m["denominator"], "f": m["definition"]} for m in snap["metrics"]}} 867 "metrics": {m["id"]: {"v": m["value"], "n": m["numerator"], "d": m["denominator"], "f": m["definition"]} for m in snap["metrics"]}}
866 868
867 869
870def logo_src():
871 """The project logo (assets/logo.png) as a data: URI, so the page stays one file that opens from disk; empty when
872 the asset is absent, and the page then shows no image."""
873 try:
874 with open(LOGO, "rb") as f:
875 data = f.read()
876 except OSError:
877 return ""
878 return "data:image/png;base64," + base64.b64encode(data).decode("ascii") if data[:8] == b"\x89PNG\r\n\x1a\n" else ""
879
880
868def render_page(snap, history): 881def render_page(snap, history):
869 template = read_text(TEMPLATE) 882 template = read_text(TEMPLATE)
870 payload = json.dumps({"snapshot": snap, "history": history}, ensure_ascii=False, sort_keys=True) 883 payload = json.dumps({"snapshot": snap, "history": history}, ensure_ascii=False, sort_keys=True)
871 payload = payload.replace("</", "<\\/") # a document string can never close the script element 884 payload = payload.replace("</", "<\\/") # a document string can never close the script element
872 return template.replace("/*__PROGRESS_DATA__*/null", payload) 885 return template.replace("/*__PROGRESS_LOGO__*/", logo_src()).replace("/*__PROGRESS_DATA__*/null", payload)
873 886
874 887
875def write_outputs(snap, out_dir): 888def write_outputs(snap, out_dir):