fix: open the gap page on what is missing

The page opened on a slogan and four tiles that read Verified (100%)
for 5,437 of 5,438 files and Missing 0, above a table of red cells. It
now opens on what it covers and one sentence that says every count of
the platforms' own lists and points to the emulator files below.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 10:16:14 +02:00
1 parent 69965ebb25
commit b89383ba68
2 files changed
+46 -30

No files matched your search

+29 -30
View File
@@ -4138,6 +4138,30 @@ def _render_problem_files(
return lines
def _platform_lists_sentence(total: int, verified: int, untested: int, missing: int) -> str:
"""The platforms' own lists in one sentence, every count said.
Four tiles opened the page: "Verified (100%)" for 5,437 of 5,438 and
"Missing 0", above a table of red cells, on the page about what is
missing. The gaps are in the files the emulators load, and the sentence
says so.
"""
def _is(count: int) -> str:
return "is" if count == 1 else "are"
parts = [f"{verified:,} {_is(verified)} held and pass the platform's own check"]
if untested:
parts.append(f"{untested:,} {_is(untested)} held but not verified "
"(listed under Untested below)")
parts.append(f"{missing:,} {_is(missing)} missing")
listed = ", ".join(parts[:-1]) + f" and {parts[-1]}"
return (
f"Of the {total:,} files on the platforms' own BIOS lists, {listed}. "
"The files the emulators load beyond those lists are counted per "
"platform in the table below."
)
def generate_gap_analysis(
profiles: dict,
coverages: dict,
@@ -4198,44 +4222,19 @@ def generate_gap_analysis(
"path": d.get("path") or "",
})
pct_verified = (
f"{total_verified / total_files_verify * 100:.0f}%"
if total_files_verify
else "0%"
)
lines = [
"# Gap analysis",
"",
"Unified view of BIOS verification, file provenance, and coverage gaps.",
"What each platform and its emulators still lack, and where the "
"collection's copies come from.",
"",
"[Download gaps CSV](downloads/gaps.csv){ .md-button } "
"[Open gaps API](api/v1/gaps.json){ .md-button } "
"[All data exports](data.md){ .md-button }",
"",
'<div class="rb-stats" markdown>',
"",
'<div class="rb-stat" markdown>',
f'<span class="rb-stat-value">{total_files_verify:,}</span>',
'<span class="rb-stat-label">Total files (all platforms)</span>',
"</div>",
"",
'<div class="rb-stat" markdown>',
f'<span class="rb-stat-value">{total_verified:,}</span>',
f'<span class="rb-stat-label">Verified ({pct_verified})</span>',
"</div>",
"",
'<div class="rb-stat" markdown>',
f'<span class="rb-stat-value">{total_untested:,}</span>',
'<span class="rb-stat-label">Untested</span>',
"</div>",
"",
'<div class="rb-stat" markdown>',
f'<span class="rb-stat-value">{total_missing_verify:,}</span>',
'<span class="rb-stat-label">Missing</span>',
"</div>",
"",
"</div>",
_platform_lists_sentence(
total_files_verify, total_verified, total_untested, total_missing_verify
),
"",
]
+17
View File
@@ -882,6 +882,23 @@ class NestedProfileBlocksRenderAsLists(unittest.TestCase):
self.assertIn("name: a.bin, size: 2", html)
class TheGapPageOpensOnCounts(unittest.TestCase):
"""The page opened on a slogan and on tiles reading "Verified (100%)"
for 5,437 of 5,438 files and "Missing 0", above a table of red cells."""
def test_every_count_is_said(self):
import generate_site # noqa: PLC0415
text = generate_site._platform_lists_sentence(5438, 5437, 1, 0)
self.assertIn("Of the 5,438 files", text)
self.assertIn("5,437 are held", text)
self.assertIn("1 is held but not verified", text)
self.assertIn("0 are missing", text)
self.assertNotIn("%", text)
source = (Path(__file__).resolve().parents[1] / "scripts" / "generate_site.py").read_text()
self.assertNotIn("Unified view of BIOS verification", source)
class EveryPageLinksItsOwnData(unittest.TestCase):
"""An emulator page linked its YAML and JSON. A platform page linked
nothing, and a tool had to download platforms.json (2.8 MB) and filter