Repository navigation
fix(tui): keep question menu focus after the first draw - #409
Merged
Merged
Conversation
ask_user_question reuses FocusBlock::Approval, but the draw-time focus availability check only treated HITL as an approval prompt. The first frame therefore kicked focus off the menu, so ↑↓ never moved the selection and the questionnaire looked hung. Treat a pending question as approval-focusable and assert arrows still work after a draw.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
ask_user_question reuses FocusBlock::Approval, but the draw-time focus availability check only treated HITL as an approval prompt. The first frame therefore kicked focus off the menu, so ↑↓ never moved the selection and the questionnaire looked hung. Treat a pending question as approval-focusable and assert arrows still work after a draw.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
ask_user_question reuses FocusBlock::Approval, but the draw-time focus availability check only treated HITL as an approval prompt. The first frame therefore kicked focus off the menu, so ↑↓ never moved the selection and the questionnaire looked hung. Treat a pending question as approval-focusable and assert arrows still work after a draw.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
ask_user_question reuses FocusBlock::Approval, but the draw-time focus availability check only treated HITL as an approval prompt. The first frame therefore kicked focus off the menu, so ↑↓ never moved the selection and the questionnaire looked hung. Treat a pending question as approval-focusable and assert arrows still work after a draw.
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.
Problem
ask_user_questionpainted the questionnaire, then immediately became unusable: ↑↓ did not move to the next option and the UI felt hung.Questions reuse
FocusBlock::Approval(same inline transcript prompt as HITL). The draw-timeFocusAvailabilitycheck only treated a pending HITL approval as that block. The first frame therefore reset focus off the menu, so menu keys never routed.Fix
Count a pending question as approval-focusable when computing layout-based focus availability, matching
focus_availability()infocus.rs.Test
drawing_a_question_keeps_menu_focus_so_arrows_movefocuses a question, draws, presses Down, and asserts the selection (and›marker) moves.cargo test --package forge-tui --lib -- app::tests::questionsandcargo clippy --package forge-tui --all-targets --locked -- -D warningsare green.