-
Notifications
You must be signed in to change notification settings - Fork 10.9k
fix(cli): restore 'Modify with editor' option in external terminals #17621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The 'Modify with external editor' option was incorrectly hidden when IDE mode was enabled in settings, even if the CLI was running in a separate terminal not connected to the IDE. This change: 1. Updates ToolActionsContext to track real-time IDE connection status. 2. Restores logic to only hide the modification option if the IDE is actually connected and capable of handling diffs. 3. Adds unit tests to verify status reactivity and UI visibility logic.
Summary of ChangesHello @abhipatel12, 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 regression where the 'Modify with external editor' option was unintentionally suppressed in the CLI when operating in external terminals, despite IDE mode being active. The previous logic incorrectly assumed that an enabled IDE mode always implied an active IDE connection capable of providing a native diff view. The updated implementation introduces a dynamic check for the IDE's actual diffing capability, ensuring that the external editor option is only hidden when a functional IDE diff view is available. This restores the expected user experience for those using the CLI outside of an integrated IDE terminal, while maintaining the streamlined workflow within the IDE. 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request effectively addresses the regression by correctly implementing the logic to show or hide the 'Modify with external editor' option based on both IDE mode and the IDE's diffing capability. The introduction of isDiffingEnabled in ToolActionsContext and its reactive updates ensure that the UI accurately reflects the IDE's connection status. The new unit tests thoroughly cover the intended behavior, providing good confidence in the fix. Overall, the changes are well-implemented and maintain code quality.
|
Size Change: +575 B (0%) Total Size: 23.4 MB ℹ️ View Unchanged
|
jacob314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Summary
This PR fixes a regression where the "Modify with external editor" option was incorrectly hidden in external terminals when IDE mode was enabled in settings.
Details
A previous refactor (
c266b529ae) simplified the logic inToolConfirmationMessage.tsxto hide the manual modification option based solely on theconfig.getIdeMode()setting. However, this setting is persistent once the companion extension is installed. This caused the option to be missing even when running the CLI in a separate terminal (e.g., iTerm, Terminal.app) where the IDE cannot provide a native diff view.The fix involves:
ToolActionsContext.tsxto subscribe to real-timeIdeClientstatus changes and expose a reactiveisDiffingEnabledboolean.ToolConfirmationMessage.tsxto only hide the "Modify" button if both IDE mode is enabled and the IDE is currently connected and capable of handling diffs.Related Issues
Closes #17576
How to Validate
edita file).npm test -w @google/gemini-cli -- src/ui/contexts/ToolActionsContext.test.tsx src/ui/components/messages/ToolConfirmationMessage.test.tsxPre-Merge Checklist