fix(tui): synchronize HelpPanelOverlay keybinding display with actual app BINDINGS #3471

Merged
freemo merged 1 commits from fix/tui-help-panel-keybinding-accuracy into master 2026-04-05 21:06:54 +00:00
3 changed files with 24 additions and 3 deletions
@@ -42,7 +42,16 @@ def step_toggle_help_for_context(context, context_name):
@then('the standalone help panel text should contain "{text}"')
def step_standalone_help_panel_text_contains(context, text):
assert text in context.help_panel._text
assert text in context.help_panel._text, (
f"Expected {text!r} in help panel text, got:\n{context.help_panel._text}"
)
Review

Nice addition of the should not contain step with a clear failure message. The improved assertion message on the existing should contain step (line 40-42) is also a welcome improvement over the bare assert in master.

Nice addition of the `should not contain` step with a clear failure message. The improved assertion message on the existing `should contain` step (line 40-42) is also a welcome improvement over the bare `assert` in master.
@then('the standalone help panel text should not contain "{text}"')
def step_standalone_help_panel_text_not_contains(context, text):
assert text not in context.help_panel._text, (
f"Expected {text!r} NOT in help panel text, but found it in:\n{context.help_panel._text}"
)
@then("the help panel should be visible")
@@ -25,3 +25,16 @@ Feature: TUI Help Panel Overlay Coverage
And the standalone help panel text should contain "Help: Slash Commands"
When I toggle help for context "Slash Commands"
Then the help panel should be hidden
Review

Good regression guard. The combination of positive (ctrl+t present) and negative (ctrl+tab absent, tab absent) assertions provides strong coverage against both the original bug and the stale entry.

Good regression guard. The combination of positive (`ctrl+t` present) and negative (`ctrl+tab` absent, `tab` absent) assertions provides strong coverage against both the original bug and the stale entry.
Scenario: help panel Main Screen keybindings match actual app BINDINGS
Given a fresh help panel overlay
When I show help for context "Main Screen"
Then the standalone help panel text should contain "ctrl+t"
And the standalone help panel text should not contain "ctrl+tab"
And the standalone help panel text should not contain "tab"
Scenario: help panel global keybindings match actual app BINDINGS
Given a fresh help panel overlay
When I show help for context "Main Screen"
Then the standalone help panel text should contain "ctrl+q"
And the standalone help panel text should contain "F1"
@@ -32,8 +32,7 @@ _GLOBAL_ITEMS = (
_CONTEXT_ITEMS: dict[str, tuple[tuple[str, str], ...]] = {
"Main Screen": (
("enter", "Submit prompt"),
("tab", "Cycle to next persona"),
("ctrl+tab", "Cycle to next argument preset"),
("ctrl+t", "Cycle to next argument preset"),
("@", "Open Reference Picker overlay"),
("/", "Open Slash Command overlay"),
("! / $", "Activate shell mode"),
Review

Correctly updated from ctrl+tabctrl+t to match app.py BINDINGS. Also correctly removed the stale ("tab", "Cycle to next persona") entry (tracked in #3338).

✅ Correctly updated from `ctrl+tab` → `ctrl+t` to match `app.py` `BINDINGS`. Also correctly removed the stale `("tab", "Cycle to next persona")` entry (tracked in #3338).