aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_project_ui.py
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-25 15:06:19 +0200
committerblasty <blasty@local>2026-07-25 15:06:19 +0200
commit9c99e5db7a3c6a1d294f8f3e56fe5de654110699 (patch)
treec2950e45c75b35111c1d70ad11df982208e02b27 /tests/test_project_ui.py
parentpalette: cap project-scope results at 60 (mitigation for sluggish arrowing) (diff)
downloadida-tui-9c99e5db7a3c6a1d294f8f3e56fe5de654110699.tar.gz
ida-tui-9c99e5db7a3c6a1d294f8f3e56fe5de654110699.tar.xz
ida-tui-9c99e5db7a3c6a1d294f8f3e56fe5de654110699.zip
projects: open the Ctrl+O switcher on the binary you're already in
It always highlighted row 0, so switching away and back meant hunting for your current position in the list. Preselect the entry marked active instead; if a filter excludes it, fall back to the first row as before. Locked in test_project_ui.py (21 checks).
Diffstat (limited to 'tests/test_project_ui.py')
-rw-r--r--tests/test_project_ui.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_project_ui.py b/tests/test_project_ui.py
index 8a0fd2b..e3bfb62 100644
--- a/tests/test_project_ui.py
+++ b/tests/test_project_ui.py
@@ -18,7 +18,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from idatui._sync import wait_for # noqa: E402
from idatui.app import IdaTui, ProjectPalette # noqa: E402
from idatui.project import Project # noqa: E402
-from textual.widgets import Input, Static # noqa: E402
+from textual.widgets import Input, OptionList, Static # noqa: E402
PASS = FAIL = 0
@@ -82,6 +82,13 @@ async def run(bins):
check("it marks the other as not yet opened",
any(not e["resident"] and e["label"] == second
for e in pal._results))
+ ol = pal.query_one(OptionList)
+ check("the switcher opens on the binary you're already in",
+ ol.highlighted is not None
+ and pal._results[ol.highlighted]["label"] == first,
+ f"highlighted={ol.highlighted} "
+ f"={pal._results[ol.highlighted]['label'] if ol.highlighted is not None else None} "
+ f"want={first}")
# -- switch to the second binary -------------------------------- #
pal.query_one(Input).value = second