Fix for focus grabbing when follow-up returns + Unit Test #2263
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.
Context
See issue 1 in this discussion: #1358
When "ask followup question" tool is invoked, Roo grabs focus away from whateever the user is doing which is annoying.
Implementation
A localized fix for the "ask followup question" tool, for reasons explained here: #1358 (comment)
Product code change was simple. Getting a Unit Test that reproduced the failure with the old code change proved rather tricky, but I got there in the end.
Screenshots
N/A
How to Test
Ask Roo to ask you a follow-up question (doesn't matter what).
Move your focus aay from the text area - e.g. start typing into another file.
Observe that when the follow up question is ready, focus does not get grabbed.
A couple of other focus-grabs that remain (I took care not to break these).
-->
Get in Touch
diarmid/diarmidm on Discord.
Important
Fixes focus grabbing issue in
ChatView.tsxfor follow-up questions and adds a unit test to verify the behavior.ChatView.tsxwhen a follow-up question is presented by settingsetEnableButtons(true)to prevent focus change.ChatView.test.tsxto verify that focus is not grabbed when a follow-up question is presented.mockFocusto track focus calls and ensures it remains unchanged after follow-up questions.This description was created by
for cf6bb38. It will automatically update as commits are pushed.