Repository navigation
Conversation
Summary of ChangesHello @imadraude, 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 significantly improves the user experience for the CLI on Android/Termux by resolving critical UI instability issues. It tackles problems like unwanted component remounts during keyboard interactions and backgrounding, as well as preventing an infinite relaunch loop that led to duplicate UI. The changes are platform-specific, ensuring that the core functionality remains unaffected on other operating systems while providing a much more robust experience for Android users. Highlights
Changelog
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 targeted fixes for UI stability issues on Android/Termux. The changes to provide a stable React key and skip forced re-renders are well-implemented and directly address the UI remounting problem. Disabling the relauncher for Android is also a good approach to prevent restart loops. However, I've identified a high-severity issue where disabling the relauncher also removes crucial error handling. My review includes a suggestion to restore this error handling to ensure process failures are caught and reported correctly on Android.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces several fixes to improve the user experience on Android/Termux by preventing UI resets and relaunch loops. The changes involve adding a stable React key, skipping forced re-renders on resume, and disabling the process relauncher specifically for the Android platform. The approach is sound. My feedback focuses on improving maintainability by removing code duplication and centralizing platform detection logic, including a suggestion to use the node: prefix for built-in modules for consistency.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request provides targeted fixes for issues encountered on Android/Termux. It addresses an infinite relaunch loop by conditionally disabling the relauncher on the Android platform. It also resolves UI instability and remounting issues by introducing a stable React key for the root application component and preventing a forced re-render upon resuming the application. The platform detection logic is cleanly abstracted into a new utility. The changes are logical, well-implemented, and effectively resolve the reported bugs.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces several fixes to improve UI stability, especially on terminal resize and for Android/Termux environments. The changes to prevent destructive screen clearing and disable the relauncher on Android are well-implemented. I have one point of feedback regarding the implementation of a stable key which is described as a global fix but appears to be conditional for Android. This could mean the UI instability on resize persists for other platforms, which goes against maintaining consistent UI behavior across components.
| <AppWrapper key={isAndroid ? 'android-root' : undefined} /> | ||
| </React.StrictMode> | ||
| ) : ( | ||
| <AppWrapper /> | ||
| <AppWrapper key={isAndroid ? 'android-root' : undefined} /> |
There was a problem hiding this comment.
The pull request description mentions adding a stable key to AppWrapper globally to prevent remounting on resize, which is listed under "General UI Stability". However, the key is only applied conditionally for Android. If the goal is to ensure UI stability on resize for all platforms, this key should be applied unconditionally. If this is intended to be an Android-only fix, the description should be updated to avoid confusion.
| <AppWrapper key={isAndroid ? 'android-root' : undefined} /> | |
| </React.StrictMode> | |
| ) : ( | |
| <AppWrapper /> | |
| <AppWrapper key={isAndroid ? 'android-root' : undefined} /> | |
| <AppWrapper key="app-root" /> | |
| </React.StrictMode> | |
| ) : ( | |
| <AppWrapper key="app-root" /> |
References
- Maintain consistency with existing UI behavior across components. Defer non-standard UX pattern improvements to be addressed holistically rather than in a single component.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces several valuable improvements to the CLI's UI stability, particularly concerning terminal resizing and process suspension. The changes to prevent destructive screen clearing when resizing outside of alternate buffer mode and the stabilization of the React component tree using a static key are excellent. The platform-specific fix to disable the relauncher on Android to prevent process loops is also a crucial addition.
I've found one potential issue related to resuming from a suspended state that could lead to unintended screen clearing, and I've left a specific comment with a suggestion. Otherwise, the changes are well-implemented and address the core issues described.
| setImmediate(() => { | ||
| refreshStatic(); | ||
| setForceRerenderKey((prev) => prev + 1); | ||
| }); |
There was a problem hiding this comment.
This unconditional call to refreshStatic() on resume from suspend can be destructive. When not in alternate buffer mode, refreshStatic() clears the entire terminal screen, which is likely not the intended behavior when resuming. The process.stdout.emit('resize') on line 109 should be sufficient to trigger a repaint of the UI via Ink's internal handling and the useEffect hook in AppContainer that listens for terminal size changes. That hook already correctly guards the call to refreshStatic to only run in alternate buffer mode. This explicit call is either redundant (in alternate buffer mode) or destructive (when not in alternate buffer mode) and should be removed.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces several fixes to improve UI stability, particularly when the terminal is resized or when running on Android. The changes prevent destructive screen clearing and component remounts by using a stable key for the root component and conditionally refreshing the UI. It also disables the app relauncher on Android to prevent problematic loops. While the approach is sound, a critical issue has been introduced in useSuspend.ts where removed props are still referenced in a useEffect dependency array, which will cause a runtime error. This needs to be addressed.
I am having trouble creating individual review comments. Click here to see my feedback.
packages/cli/src/ui/hooks/useSuspend.ts (35-36)
These props have been removed from the function signature, but they are still referenced in the useEffect dependency array on lines 135-136. This will cause a ReferenceError at runtime because the variables are no longer in scope. Please remove them from the dependency array to resolve this critical bug.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request effectively addresses UI instability issues during terminal resizing and application suspension, particularly on Android/Termux. The changes are well-structured and follow best practices. Using a stable React key for AppWrapper correctly prevents unnecessary component remounts. The logic to conditionally refresh the UI on resize only when in alternate buffer mode is a solid improvement that preserves scrollback history. Furthermore, disabling the auto-relauncher on Android is a direct and appropriate fix for the described relaunch loop. The overall implementation is clean and significantly improves the user experience under the specified conditions. I have no major concerns with this patch.
|
Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request. To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues. If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding! |
|
@imadraude, apologies for the bot closing this PR! We have reopened it. Please sync your branch to the latest |
|
closing due to lack of response |
Summary
Fixes UI reset issues when resizing the terminal or moving the application to the background. This addresses both Android/Termux specific issues and a general bug where terminal width changes caused destructive screen clearing.
Details
General UI Stability:
refreshStatic()call which cleared the terminal screen and remounted the history. This behavior is now disabled when not in alternate buffer mode, as clearing the terminal is undesirable and breaks scrollback.keytoAppWrapperglobally to prevent React component remounting during terminal resize events.terminalHeightin the redraw trigger for alternate buffer mode to ensure the UI responds to vertical resizes.Android/Termux Specifics:
Related Issues
Fixes #18914
How to Validate
Pre-Merge Checklist