feat(cli): enable mouse clicking for cursor positioning in AskUser multi-line answers#24630
feat(cli): enable mouse clicking for cursor positioning in AskUser multi-line answers#24630
Conversation
|
Size Change: +214 B (0%) Total Size: 34 MB
ℹ️ View Unchanged
|
Summary of ChangesHello, 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 introduces mouse interaction capabilities to the multi-line TextInput component. By enabling users to click within the terminal interface to position the cursor, it significantly improves the usability of the AskUser tool when operating in alternate buffer mode. The changes include necessary hook integrations and comprehensive updates to the existing test suite to ensure stability and correct behavior. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements mouse click functionality for the TextInput component, allowing users to position the cursor by clicking within the input field when it is focused and the terminal is in alternate buffer mode. The implementation involves adding a container reference to the TextInput's layout and utilizing the useMouseClick hook to trigger buffer cursor movement. Corresponding unit tests were updated to include a ConfigWrapper for context and a new test case verifying the registration of the mouse click handler, alongside necessary snapshot updates. I have no feedback to provide.
Summary
Enables users to position the cursor using mouse clicks within the multi-line
TextInputcomponent, specifically addressing the issue where clicking doesn't work in theAskUsertool when in alternate buffer mode.Details
packages/cli/src/ui/components/shared/TextInput.tsxto include a container ref and theuseMouseClickhook.buffer.moveToVisualPosition.TextInput.test.tsxto supportConfigContextand mock mouse events.AskUserDialog.test.tsxto reflect visual layout changes.Related Issues
Fixes #18910
How to Validate
npm run start -- --alternate-bufferask_usertool with atexttype question (e.g., "Ask me for a multi-line project description").Pre-Merge Checklist