fix(ui): avoid triggering autocomplete when navigating history - #15948
fix(ui): avoid triggering autocomplete when navigating history#15948jacob314 wants to merge 2 commits into
Conversation
Summary of ChangesHello @jacob314, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the user interface experience by addressing an interaction conflict between input history navigation and command completion. The changes ensure that when users browse their command history, the autocomplete feature is temporarily disabled, preventing disruptive suggestions. Upon resuming active input, completion is seamlessly re-enabled, leading to a more intuitive and less cluttered command-line interface. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: +519 B (0%) Total Size: 22.3 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request effectively fixes an issue where autocomplete would trigger during history navigation. It achieves this by introducing a state to track history navigation and temporarily disable completions. The implementation is solid, with good test coverage for the new behavior. The refactoring of useCommandCompletion to accept an options object is also a great improvement for code clarity and maintainability. I have one suggestion to further improve maintainability by removing some duplicated logic.
2c065d1 to
93d81e6
Compare
93d81e6 to
bbd60b9
Compare
|
Automatically closing PR as it is older than 7 days and authored by a team member. |
Summary
Fix issue where autocomplete would trigger while navigating up and down breaking navigation.
Also reduce friction navigating through large prompts in the history by defaulting to the first line in the prompt when navigating up and last line when navigating down so that a single up or down keystroke will get to the next prompt.
Details
setTextfunctionality in the text buffer to allow specifying the cursor's position ('start' or 'end') when setting new text. This ensures that when navigating history, the cursor is appropriately placed at the beginning or end of the retrieved command.Related Issues
Addresses the first part of #15951
How to Validate
Navigate up and down in the history. Verify that you no longer get stuck in the autocompletion UI
Verify you are still able to get autocompletions if you type additional text or move the cursor.