fix(tui): prevent accidental hover selection in autocomplete menus #8797
+129
−88
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 🔽
Autocomplete menus (
@and/in TUI) and dialog select components currently auto-select items when UI elements move under a stationary cursor. This creates two problematic scenarios:Users expect hover selection to activate only on intentional mouse movement, not when UI elements move under a stationary cursor.
mouse-highlight-bug.mp4
Solution 🔽
WindowsTerminal_zlB4E0m0KW.mp4
Just checked, and it's fixed in the menu aswell:
WindowsTerminal_TTu0nLAE43.mp4
The fix tracks actual mouse movement to distinguish between:
This is implemented by:
hasMouseMovedflag tofalsewhen menus open or filter text changesmousemoveevents to set the flag totruehasMouseMoved === trueComponents updated:
Select.tsx: Dialog select menusChatInput.tsx: Autocomplete menus (@and/)This ensures hover selection only activates on deliberate user action, making keyboard navigation reliable and preventing surprising auto-selections.
Closes #8799