Skip to content

Fix up/down arrow regression and add test.#18108

Merged
jacob314 merged 2 commits into
mainfrom
up_arrow_fix
Feb 2, 2026
Merged

Fix up/down arrow regression and add test.#18108
jacob314 merged 2 commits into
mainfrom
up_arrow_fix

Conversation

@jacob314

@jacob314 jacob314 commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #17997

Details

Up arrow navigation was broken when there were line wraps.

@jacob314 jacob314 requested a review from a team as a code owner February 2, 2026 17:45
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 resolves a critical user experience regression in text input components where up and down arrow key navigation failed to work correctly on lines that wrapped. The core change involves adjusting the cursor movement logic to consider the visual layout of text, rather than just its logical structure, thereby enabling seamless navigation across wrapped lines. A dedicated regression test has also been added to validate this fix and safeguard against similar issues in the future.

Highlights

  • Regression Fix: Addresses and fixes a regression where up/down arrow navigation was broken when text content wrapped onto multiple visual lines.
  • Cursor Movement Logic: Modified the handleInput function to correctly use visualCursor and visualLines for boundary checks when moving the cursor up or down, ensuring navigation respects visual line breaks rather than logical ones.
  • New Regression Test: Added a new test case ('move: up/down should work on wrapped lines (regression test)') to prevent future regressions related to up/down arrow navigation on wrapped lines.
  • Dependency Update: Updated the dependency array for a useCallback hook to include visualCursor and visualLines, ensuring proper reactivity for cursor movement logic.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a regression where up and down arrow navigation failed on wrapped lines. The change to base the movement logic on visual lines instead of logical lines is appropriate. The addition of a regression test is also a great improvement. I've found one minor issue where a test description was updated incorrectly, which could cause confusion.

Comment thread packages/cli/src/ui/components/shared/text-buffer.test.ts Outdated
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown

Size Change: +55 B (0%)

Total Size: 23.6 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 23.6 MB +55 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@gemini-cli gemini-cli Bot added priority/p1 Important and should be addressed in the near term. area/core Issues related to User Interface, OS Support, Core Functionality labels Feb 2, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

@jackwotherspoon jackwotherspoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@jacob314 jacob314 added this pull request to the merge queue Feb 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Feb 2, 2026
@jacob314 jacob314 added this pull request to the merge queue Feb 2, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Feb 2, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@jacob314 jacob314 removed this pull request from the merge queue due to a manual request Feb 2, 2026
@jacob314 jacob314 merged commit 8cae90f into main Feb 2, 2026
26 checks passed
@jacob314 jacob314 deleted the up_arrow_fix branch February 2, 2026 21:55
@jacob314

jacob314 commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

/patch preview

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: 8cae90f404f999a50c7c653ce334cbf034bf95e7
  • Workflows Created: 1

🔗 Track Progress:

Adib234 pushed a commit that referenced this pull request Feb 3, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@skeshive

skeshive commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

/patch preview

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: 8cae90f404f999a50c7c653ce334cbf034bf95e7
  • Workflows Created: 1

🔗 Track Progress:

github-actions Bot pushed a commit that referenced this pull request Feb 3, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
# Conflicts:
#	packages/cli/src/ui/components/shared/text-buffer.ts
@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. ⚠️ Resolve conflicts in the hotfix PR first: #18224
  2. Test your changes after resolving conflicts
  3. Once merged, the patch release will automatically trigger
  4. You'll receive updates here when the release completes

🔗 Track Progress:

@skeshive

skeshive commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

/patch preview

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: 8cae90f404f999a50c7c653ce334cbf034bf95e7
  • Workflows Created: 1

🔗 Track Progress:

github-actions Bot pushed a commit that referenced this pull request Feb 3, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
# Conflicts:
#	packages/cli/src/ui/components/shared/text-buffer.ts
@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. ⚠️ Resolve conflicts in the hotfix PR first: #18230
  2. Test your changes after resolving conflicts
  3. Once merged, the patch release will automatically trigger
  4. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.27.0-preview.7
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.27.0-preview.7-pr-18108

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

yuvrajangadsingh pushed a commit to yuvrajangadsingh/gemini-cli that referenced this pull request Feb 4, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
sidwan02 pushed a commit to sidwan02/gemini-cli-gemma that referenced this pull request Feb 6, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
kuishou68 pushed a commit to iOfficeAI/gemini-cli-pro that referenced this pull request Feb 27, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
cocosheng-g pushed a commit that referenced this pull request May 6, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@sripasg sripasg added the size/m A medium sized PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality priority/p1 Important and should be addressed in the near term. size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Up and Down Arrows Do not work for lines that are word wrapped

4 participants