Don't toggle the help panel on '?' while editing a queued prompt#13685
Draft
warp-dev-github-integration[bot] wants to merge 1 commit into
Draft
Don't toggle the help panel on '?' while editing a queued prompt#13685warp-dev-github-integration[bot] wants to merge 1 commit into
warp-dev-github-integration[bot] wants to merge 1 commit into
Conversation
The shift-? FixedBinding for InputAction::ToggleAgentViewShortcuts was guarded only by EMPTY_INPUT_BUFFER (the main input editor's buffer), which stays true while a queued prompt is being edited inline (the queued-prompt editor is a separate text buffer). As a result, typing '?' into an in-progress queued-prompt edit incorrectly toggled the help/shortcuts panel instead of inserting the character. Exclude the existing QueuedPromptInlineEditorOpen keymap context flag from the binding's predicate, mirroring the same exclusion already used by the Show History custom binding. Add a regression test that exercises the shift-? keystroke both with and without an active queued-prompt inline edit, verifying the shortcuts panel only toggles in the former case. Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When editing a queued prompt inline in the queued prompts panel (with the regular input buffer empty), typing
?incorrectly toggled the help/shortcuts panel above the input instead of inserting the character into the queued prompt being edited.Root cause: the fixed
shift-?binding forInputAction::ToggleAgentViewShortcutsis guarded byEMPTY_INPUT_BUFFER, which reflects only the main input editor's buffer. The queued-prompt inline editor is a separateEditorView, so the predicate stayed true mid-edit and the binding consumed the keystroke.Fix: exclude the existing
QueuedPromptInlineEditorOpenkeymap context flag (already set byInput::keymap_context()whenever a queued row is being edited) from the binding's predicate — mirroring the exclusion already used by the Show History binding. With the binding no longer matching,?falls through to normal character insertion in the queued-prompt editor.Linked Issue
ready-to-specorready-to-implement.Testing
Added a regression test
shift_question_mark_does_not_toggle_agent_view_shortcuts_while_editing_queued_promptinapp/src/terminal/input_tests.rs:shift-?is handled and toggles the shortcuts view open/closed (proves the binding is reachable in the harness).shift-?is not handled and the shortcuts view stays closed.Validation run locally (headless Linux sandbox, so no manual GUI run):
cargo nextest run -p warp shift_question_mark_does_not_toggle_agent_view_shortcuts_while_editing_queued_prompt— passescargo nextest run -p warp -E 'test(queued) + test(shortcut)'— 105/105 passcargo fmt -p warp -- --check— cleancargo clippy -p warp --tests -- -D warnings— cleanI have manually tested my changes locally with
./script/runAgent Mode
CHANGELOG-BUG-FIX: Fixed typing
?while editing a queued prompt opening the help panel instead of inserting the character.Conversation: https://staging.warp.dev/conversation/ee89cb70-804c-4215-a43e-2f161ec86f79
Run: https://oz.staging.warp.dev/runs/019f5d5a-7964-74f3-ba8f-396bbd132ed0
This PR was generated with Oz.