ux(polish) autocomplete in the input prompt#18181
Conversation
|
Hi @jacob314, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
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 focuses on refining the user experience of the input prompt by addressing key areas related to command history and autocomplete. The changes aim to provide a more fluid and less distracting interaction, particularly by eliminating suggestion flickering and ensuring consistent, intuitive cursor behavior during history recall and text manipulation. The underlying completion logic has been made more robust and controllable. Highlights
Changelog
Activity
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
|
There was a problem hiding this comment.
Code Review
This pull request introduces significant user experience improvements to the input prompt, focusing on history navigation and autocomplete behavior. The refactoring of the useInputHistory hook to use a caching mechanism is a major enhancement, providing robust handling of edits and intelligent cursor position restoration during history navigation. Additionally, the changes to useCommandCompletion to eliminate suggestion flickering and to conditionally suppress autocomplete during navigation or cursor movement are well-implemented. The new logic is clear, the state management is simplified, and the added tests are comprehensive. Overall, this is an excellent polish that greatly improves the interactivity and feel of the input prompt.
|
Size Change: +3.14 kB (+0.01%) Total Size: 23.7 MB
ℹ️ View Unchanged
|
Reduce duplicate code. Checkpoint Checkpoint not fully working.
…g to the next/prev line.
b33224c to
f148f5d
Compare
Summary
Autocomplete in the input prompt popped up too aggressively. This change makes it only pop up as you type or delete characters. This allows you to navigate the input prompt in peace without getting nagged by autocompletes you don't care about.
Navigating back in the history was also annoying as we didn't pick the correct line causing you to frequently need to go through multiple lines of a prompt when you were just trying to navigate to a previous prompt.
Also fixed navigation so we only navigate up out of the current prompt after first navigating to the very first character of the prompt and only navigate down out of the current prompt after first navigating to the very last character of the prompt. This simplifies navigation within the prompt as well as making navigation to the next prompt less surprising.
Details
useCommandCompletion,useCompletion,useReverseSearchCompletion) have been refactored. TheshowSuggestionsstate is now derived rather than explicitly managed, and anactiveflag has been introduced to conditionally enable or disable completion logic, providing more granular control.TextBuffercomponent now supports an optionalcursorPositionparameter when setting text. This allows for precise control over where the cursor is placed after programmatically updating the input field, which is crucial for the enhanced history navigation.Related Issues
Fixes: #16796