From 6159042d0cb3870e6a7c6f8d9a97e175d59e6f80 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Wed, 23 Sep 2026 09:24:40 +0200 Subject: tui: 'g' + a letter searches list rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The goto prompt decides on its first key: digits jump to a row number as before, any other printable key searches the row texts of the list or menu (case-insensitive, also åäö), with up/down stepping through the matches. Keys typed into the prompt no longer reach the screen's key hook, and Enter in the action menu closes an open prompt. Co-Authored-By: Claude Opus 5.5 --- scripts/tui-golden.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'scripts/tui-golden.py') diff --git a/scripts/tui-golden.py b/scripts/tui-golden.py index 864210c..71e1273 100755 --- a/scripts/tui-golden.py +++ b/scripts/tui-golden.py @@ -588,6 +588,35 @@ SCENARIOS = [ }, ], }, + { + # 'g' + a letter searches the list rows; the screen's own keys + # ('s' = sortera) are text while the prompt is open. + "name": "voucher-goto-search", + "screen": "vouchers", + "expect": ["sorterade på nummer, stigande", "F1"], + "steps": [ + { + "keys": ["g"], + "expect": ["Gå till rad eller sök (bokstav):"], + }, + { + "keys": ["s"], + "expect": ["Sök: s", "sorterade på nummer, stigande"], + }, + { + "keys": ["backspace", "zzz"], + "expect": ["Sök: zzz", "(ingen träff)"], + }, + { + "keys": ["esc", "g", "GOLDEN VER"], + "expect": ["Sök: GOLDEN VER", "upp/ned = fler träffar"], + }, + { + "keys": ["enter", "enter"], + "expect": ["Verifikat A1", "Golden verifikat"], + }, + ], + }, { # Backspace in a freshly opened field edits the value; the next # key must not replace everything. -- cgit v1.3