From 7e96e12a4fb18c405901bfcd124e55dac17e70cc Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Mon, 26 Oct 2026 21:08:55 +0100 Subject: [PATCH] fix: say nothing was found on the first screen --- install.py | 9 ++++++++- tests/test_install_tui.py | 19 +++++++++++++++++++ wiki/first-install.md | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/install.py b/install.py index f6b5a5419..268b691a0 100644 --- a/install.py +++ b/install.py @@ -12137,10 +12137,17 @@ def _view_platforms(state: TuiState, width: int, height: int) -> tuple: else: title = "Which setup?" before = ["Choose the setup that will use the BIOS files."] + pinned = list(state.refused) + if state.dest_given is None and not state.setups and len(state.stack) == 1: + # The first screen when nothing was found: at 40x15 its 18 rows + # left no line to say so, or what to do. + pinned.append("Nothing was found here: choose the setup that will use the " + "BIOS files.") + before = [] needle = state.filters.get("platforms", "") after = [f"No setup matches '{needle}'."] if len(rows) == 1 and needle else [] after += [state.status] if state.status else [] - return (title, _compose(state, width, height, before, rows, after, pinned=state.refused), + return (title, _compose(state, width, height, before, rows, after, pinned=pinned), ("A/Enter Choose", "B/Esc Back", "/ Filter", "? Help")) diff --git a/tests/test_install_tui.py b/tests/test_install_tui.py index 99e125baf..b3c586710 100644 --- a/tests/test_install_tui.py +++ b/tests/test_install_tui.py @@ -3908,6 +3908,25 @@ class TheFolderScreenSaysWhatItOffers(unittest.TestCase): self.assertEqual(rows[state.focus["folder"]].action, "browse") +class NothingFoundIsSaid(unittest.TestCase): + """With nothing detected the first screen was the list of 18 setups, + with no line at 40x15 saying nothing was found, which the beginner's + page names.""" + + def test_at_every_size(self): + with mock.patch.object(install, "detect_platforms", return_value=[]), \ + mock.patch.object(install, "detect_frontends", return_value=[]), \ + mock.patch.object(install, "_mounted_cards", return_value=[]): + state, _effects = install.tui_start(_args(), "linux") + self.assertEqual(state.screen, "platforms") + for cols, rows in ((40, 12), (40, 15), (80, 24)): + with self.subTest(size=f"{cols}x{rows}"): + screen = " ".join(" ".join(install.tui_view(state, cols, rows)).split()) + self.assertIn("Nothing was found here", screen) + page = (REPO_ROOT / "wiki" / "first-install.md").read_text(encoding="utf-8") + self.assertIn("Nothing was found here", page) + + class AFocusesNoSystemFolder(unittest.TestCase): """At / A went into bin/, and at a drive root holding $RECYCLE.BIN into the recycle bin, which Use this folder then took as the BIOS folder.""" diff --git a/wiki/first-install.md b/wiki/first-install.md index ef62456af..1a8b2cf53 100644 --- a/wiki/first-install.md +++ b/wiki/first-install.md @@ -134,7 +134,7 @@ The result says how to restore them. ### Nothing was found here. -Choose **Another setup or folder**, then your setup and its folder. +The screen lists every setup: choose yours, then its folder. ### Error: Python 3.8 or newer is required.