-
Notifications
You must be signed in to change notification settings - Fork 10.4k
feat: Implement desktop notifications for user permission prompts #14927
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
base: main
Are you sure you want to change the base?
Conversation
…ompts This commit introduces desktop notifications to alert users when the Gemini CLI requires their permission to execute a command, especially when the CLI application is not in focus. Key changes include: - Added setting to control notification behavior. - Integrated for cross-platform desktop notifications. - Implemented React hook to manage notification logic, considering application focus, operating system, and terminal program for proper activation on macOS. - Included an icon asset for notifications.
Ensures that the desktop notification for user permission prompts is displayed only once per confirmation event. Toggling application focus while waiting for confirmation will no longer trigger repeated notifications. - Added `useRef` to track notification state. - Updated `useNotification` hook to reset state only when confirmation is no longer pending. - Added regression tests for duplicate notification scenarios.
Summary of ChangesHello @StoyanD, 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 enhances the user experience of the Gemini CLI by integrating desktop notifications. When the CLI requires user confirmation or input, and the application is not in focus, a system-level notification will now be triggered. This feature aims to improve multitasking efficiency by providing immediate alerts, with the added benefit on macOS of bringing the terminal back into focus upon clicking the notification. The functionality is controlled by a new "ui.enableNotifications" setting, allowing users to opt-in. 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
This pull request introduces desktop notifications for user permission prompts, which is a great enhancement for user experience, especially when multitasking. The implementation is solid, leveraging node-notifier and a new React hook useNotification. The logic correctly handles different states, platform specifics for macOS, and terminals with poor focus detection support. The addition of comprehensive unit tests for the new hook is commendable and ensures the feature is robust. The configuration options are well-documented and integrated into the settings schema. Overall, this is a high-quality contribution, and I have no high or critical concerns.
|
@Alexmarco-gif can i get a review? |
|
why anyone not reviewing i would love to havethis feature in windows |
|
@nahid6970 do u have a windows machine? if so can you test this branch out to see if it works( im pretty sure it should) |
|
@StoyanD how to test it in windows? i dont see anything related to notification in windows latest version of gemini |
|
@nahid6970 you'd have to install this branch locally on a windows machine and test. The notification library I'm using is cross platform, so it should work. The way I've tested is using a command to create a file, then opening another app before the cli asks for permission. When the cli app asks for permission it's already backgrounded so it shows a notification |
|
This will be a big improvement to the user experience. I'm waiting for this. |
|
Thanks |
Summary
Implements desktop notifications for permissions, should ease multitasking when
using gemini-cli
Details
Fixes #14696
This PR implements OS-level desktop notifications when the Gemini CLI pauses and
requires user confirmation or input. This significantly improves the user
experience by alerting users immediately when their input is needed, even if
they are focused on another application. Clicking the notification will bring
the terminal into focus, allowing for quick interaction.
Notification demo video:
policy-notification-promt.mp4
Settings toggle:

Related Issues
Related to #14696
How to Validate
Request a policy ask required permission in Xterm/VScode terminal, and move to
another screen causing focus to switch. Should see a notification that when
clicked takes you back to the terminal
Pre-Merge Checklist