feat: enhance compatibility table with file name handling and UI updates

This commit is contained in:
Patryk Gensch
2026-06-19 00:07:18 +02:00
parent 2c785dc87c
commit 429aafb6ce
4 changed files with 39 additions and 5 deletions

View File

@@ -77,6 +77,23 @@ def test_divergent_surface_raises_asterisk():
assert lib["cells"]["Game C"]["diverges"] is True
def test_hash_prefix_is_stripped_for_grouping():
# stored names carry a per-file <sha8>_ prefix; copies must still group under one library row
t = compatibility_table([
Entry("Game A", _snap("333ab0c4_PIKLIB8.dll", ["SHOW", "HIDE"])),
Entry("Game B", _snap("8dc0165d_PIKLIB8.dll", ["SHOW", "HIDE"])),
Entry("Game C", _snap("bba62d83_PIKLIB8.dll", ["SHOW", "HIDE", "PAUSE"])),
])
assert len(t["libraries"]) == 1
lib = t["libraries"][0]
assert lib["name"] == "PIKLIB8.dll" # prefix gone from the display name
assert lib["variant_count"] == 2 # A,B identical → reference; C diverges → asterisk
assert lib["cells"]["Game C"]["diverges"] is True
# the original stored filename is preserved per member for correlation
files = {m["file"] for v in lib["variants"] for m in v["members"]}
assert "333ab0c4_PIKLIB8.dll" in files
def test_grouping_is_case_insensitive_keeps_common_spelling():
t = compatibility_table([
Entry("Game A", _snap("Piklib8.dll", ["SHOW"])),