fix(cli): dismiss update banner when /clear runs#25981
Open
Anjaligarhwal wants to merge 2 commits intogoogle-gemini:mainfrom
Open
fix(cli): dismiss update banner when /clear runs#25981Anjaligarhwal wants to merge 2 commits intogoogle-gemini:mainfrom
Anjaligarhwal wants to merge 2 commits intogoogle-gemini:mainfrom
Conversation
Contributor
|
Warning Gemini encountered an error creating the summary. You can try again by commenting |
Contributor
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements the dismissal of the update banner when the UI is cleared. It modifies the useSlashCommandProcessor hook to include a setUpdateInfo parameter, which is now called with null during the clear action. Additionally, the changes include updated test coverage to ensure the update information is correctly reset. I have no feedback to provide.
This was referenced Apr 26, 2026
|
Hi, I would like to work on this issue. I have been contributing to Gemini CLI and would like to take this up. Can I proceed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The "Gemini CLI update available!" banner could not be dismissed with
/clear. This PR restores the dismissal:ui.clear()now resets theupdateInfostate in addition to clearing history and the startup banner.Details
Notifications.tsxrenders the banner from theupdateInfostate owned byAppContainer:updateInfois set inAppContainerviasetUpdateHandler(handleAutoUpdate.ts:170) when an update check fires. Until now it was only ever cleared by the 60-second timer in that handler or by theupdate-success/update-failedevents. Theui.clear()callback inuseSlashCommandProcessordid not touch it, so/clear(and/new) had no effect on the banner.The banner used to render as a history item, so
clearItems()cleared it implicitly. PR #5488 (885af07d) moved it into the live-area<Notifications>component, where it is now driven byupdateInfostate inAppContainer. This PR adds the corresponding reset on the/clearpath so the dismissal matches the new state ownership.The fix threads
setUpdateInfothroughuseSlashCommandProcessorthe same waysetBannerVisibleis already threaded, and invokes it fromui.clear():This restores the behavior referenced in the issue without altering the rest of the update-notification lifecycle (auto-update events still set/clear
updateInfoexactly as before; the next update check on the following session will re-show the banner).Why not use the
updateEventEmitter?setBannerVisibleand the rest of theui.clear()plumbing already use direct prop passing rather than events. Adding a new event for a single in-process consumer would be more indirect than threading the existing setter, and would not match the surrounding code style.Related Issues
Fixes #25628
How to Validate
npm installnpm run buildlatestso the update banner appears (or stub the response fromlatest-versionto force one).Gemini CLI update available! ...banner above the prompt./clear(or/new).npx vitest run packages/cli/src/ui/hooks/slashCommandProcessor.test.tsx→ 36/36 pass (includes newUpdate banner dismissalcase).npx vitest run packages/cli/src/ui/commands/clearCommand.test.ts packages/cli/src/ui/components/Notifications.test.tsx packages/cli/src/ui/components/UpdateNotification.test.tsx packages/cli/src/utils/handleAutoUpdate.test.ts→ 41/41 pass.npx vitest run packages/cli/src/ui/AppContainer.test.tsx→ 107/107 pass.Pre-Merge Checklist
Update banner dismissaltest inslashCommandProcessor.test.tsx.useSlashCommandProcessorgains one positional parameter; onlyAppContainercalls it in production code, and the test setup is updated in lockstep.npm run start(Windows 11, Node 20)The change is platform-independent (pure React state). Targeted unit suites pass under Vitest.