From 10af16f55df3be6190b404f50b478527ac42da44 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 28 Oct 2026 06:13:40 +0100 Subject: [PATCH] fix: definitions whole in a 40x12 help The data files definition was cut in its second sentence at 40x12: the help gives both kinds in a few words when the sentences do not fit. --- install.ps1 | 2 +- install.py | 16 +++++++++++++++- install.sh | 2 +- install/launchers/index.json | 16 ++++++++-------- tests/test_install_tui.py | 7 +++++++ 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/install.ps1 b/install.ps1 index 62a0450c8..f03e3245d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -11,7 +11,7 @@ $ErrorActionPreference = "Stop" $defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py" - $defaultInstallSha256 = "0165a8f39265725aa70cd19a7966c1e228fd9df480fb05d7338ca24530c26762" + $defaultInstallSha256 = "d3900f45996c1df29734403c5d15767c5fc3badcb070c93bbaf5a4f16f65140b" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index 3014221d0..c65d8addd 100644 --- a/install.py +++ b/install.py @@ -6166,6 +6166,13 @@ DATA_FILES_WORDS = ("data files: the files an emulator reads from a data folder "such as Dolphin's Sys and PPSSPP's assets") +# The definitions in a few words, for a help with no room for the sentences. +_SHORT_DEFINITIONS = ( + ("Game data:", "Game data: what a game reads, of no use to other cores."), + ("Data files:", "Data files: what an emulator reads from its own data folder."), +) + + def game_data_missing(names: str, count: int, folders: list[Path]) -> str: """The game data a run could not supply, and the folder each goes in: "Copy it from your own copy of the game" named no folder.""" @@ -18615,12 +18622,19 @@ def _view_help(state: TuiState, width: int, height: int) -> tuple: # Cut from its end at 40x12, the help lost Quit and This help with no # sign: what a list's keys also say elsewhere goes first. for spare in ("First, last", "All, none", "extra", "Filter by setup or device name", - "Filter", "Options", "Choose a row, tap it again to open it", "This help"): + "Filter", "Options", "Choose a row, tap it again to open it", "This help", + "definitions"): if (len(drawn(keys)) + len(extra) + len(defined) + len(_text_lines(more, width)) <= height): break if spare == "extra": extra = [] + elif spare == "definitions": + # The short form at 40x12, whole: the long one was cut in the + # middle of its second sentence. + short = " ".join(brief for long_form, brief in _SHORT_DEFINITIONS + if long_form in words) + defined = ["", *textwrap.wrap(short, width)] if short else [] else: keys = [entry for entry in keys if entry[1] != spare] return ("Keys", _compose(state, width, height, drawn(keys) + defined + extra + more, []), diff --git a/install.sh b/install.sh index 11620c1bc..aee7254dd 100755 --- a/install.sh +++ b/install.sh @@ -18,7 +18,7 @@ esac TEMP_INSTALLER="" TEMP_DIRECTORY="" DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/install.py" -DEFAULT_INSTALL_SHA256="0165a8f39265725aa70cd19a7966c1e228fd9df480fb05d7338ca24530c26762" +DEFAULT_INSTALL_SHA256="d3900f45996c1df29734403c5d15767c5fc3badcb070c93bbaf5a4f16f65140b" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/launchers/index.json b/install/launchers/index.json index 39578db5d..6ffb5f4d3 100644 --- a/install/launchers/index.json +++ b/install/launchers/index.json @@ -27,8 +27,8 @@ { "dest": "roms/ports/retrobios/install.py", "repo_path": "install.py", - "size": 909943, - "sha256": "0165a8f39265725aa70cd19a7966c1e228fd9df480fb05d7338ca24530c26762", + "size": 910604, + "sha256": "d3900f45996c1df29734403c5d15767c5fc3badcb070c93bbaf5a4f16f65140b", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 962735, - "sha256": "26c35ae513bf9ae770f9e0316a9f0000b57bcc24c054691143361c7f77e1f252" + "size": 963396, + "sha256": "adb57fcae73e5138cc204f38065557677fe32cd11888e336cd1363eb53d72b20" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 909943, - "sha256": "0165a8f39265725aa70cd19a7966c1e228fd9df480fb05d7338ca24530c26762", + "size": 910604, + "sha256": "d3900f45996c1df29734403c5d15767c5fc3badcb070c93bbaf5a4f16f65140b", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 909943, - "sha256": "0165a8f39265725aa70cd19a7966c1e228fd9df480fb05d7338ca24530c26762", + "size": 910604, + "sha256": "d3900f45996c1df29734403c5d15767c5fc3badcb070c93bbaf5a4f16f65140b", "executable": false }, { diff --git a/tests/test_install_tui.py b/tests/test_install_tui.py index baef612df..24df2e54d 100644 --- a/tests/test_install_tui.py +++ b/tests/test_install_tui.py @@ -11449,6 +11449,13 @@ class AuditTwentyAndThirteen(unittest.TestCase): with self.subTest(rows=rows): text = " ".join(" ".join(install.tui_view(state, 40, rows)).split()) self.assertIn("Game data: files a game or a game engine reads", text) + # Data files too, each said whole: in a few words at 40x12. + state.check = {**state.check, "data_missing": 7, "data_bytes": 2048} + text = " ".join(" ".join(install.tui_view(state, 40, 12)).split()) + self.assertIn("Game data: what a game reads, of no use to other cores. Data files: " + "what an emulator reads from its own data folder.", text) + text = " ".join(" ".join(install.tui_view(state, 40, 15)).split()) + self.assertIn("such as Dolphin's Sys and PPSSPP's assets.", text) def test_the_40_column_bar_keeps_help_and_the_help_its_tap_line(self): """code_audit_20 P3-1."""