From 66ac33b1853eb952606d2dc96c239ec46b902afe Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Sun, 5 Apr 2026 18:09:41 +0000 Subject: [PATCH] fix(tui): synchronize HelpPanelOverlay keybinding display with actual app BINDINGS - Replace ctrl+tab with ctrl+t for preset cycling in _CONTEXT_ITEMS Main Screen context, matching the actual BINDINGS registered in app.py - Remove the tab/Cycle to next persona entry from Main Screen context since no such binding exists in app.BINDINGS (tracked separately in #3338) - Add Behave BDD scenarios asserting that help panel keybindings match the actual registered BINDINGS: ctrl+t present, ctrl+tab absent, no stale tab entry for persona cycling - Add step definition for 'should not contain' assertion to support the new negative-assertion scenarios Resolves the double-inconsistency where users following the help panel instructions (ctrl+tab) would press the wrong key and get no response. ISSUES CLOSED: #3444 --- .../steps/tui_help_panel_overlay_coverage_steps.py | 11 ++++++++++- features/tui_help_panel_overlay_coverage.feature | 13 +++++++++++++ src/cleveragents/tui/widgets/help_panel_overlay.py | 3 +-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/features/steps/tui_help_panel_overlay_coverage_steps.py b/features/steps/tui_help_panel_overlay_coverage_steps.py index 850e852f8..b3190d1be 100644 --- a/features/steps/tui_help_panel_overlay_coverage_steps.py +++ b/features/steps/tui_help_panel_overlay_coverage_steps.py @@ -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}" + ) + + +@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") diff --git a/features/tui_help_panel_overlay_coverage.feature b/features/tui_help_panel_overlay_coverage.feature index 11e45a09f..b7b2a23c4 100644 --- a/features/tui_help_panel_overlay_coverage.feature +++ b/features/tui_help_panel_overlay_coverage.feature @@ -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 + + 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" diff --git a/src/cleveragents/tui/widgets/help_panel_overlay.py b/src/cleveragents/tui/widgets/help_panel_overlay.py index 41b511e2e..a0351580b 100644 --- a/src/cleveragents/tui/widgets/help_panel_overlay.py +++ b/src/cleveragents/tui/widgets/help_panel_overlay.py @@ -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"), -- 2.52.0