Skip to content

Update persistence state to track counts of messages instead of times banner has been displayed#13428

Merged
Adib234 merged 9 commits intomainfrom
adibakm/update-persistence-state
Nov 20, 2025
Merged

Update persistence state to track counts of messages instead of times banner has been displayed#13428
Adib234 merged 9 commits intomainfrom
adibakm/update-persistence-state

Conversation

@Adib234
Copy link
Copy Markdown
Contributor

@Adib234 Adib234 commented Nov 19, 2025

Summary

We would like to keep track of counts by the number of times a message has shown and not just how many times the banner has been shown.

Details

Related Issues

How to Validate

Manually validated by changing default text on debug settings.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@Adib234 Adib234 requested a review from sehoon38 November 19, 2025 18:26
@Adib234 Adib234 self-assigned this Nov 19, 2025
@Adib234 Adib234 requested a review from a team as a code owner November 19, 2025 18:26
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Adib234, 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 refactors the banner display logic to enable more precise tracking of how often specific messages are shown to users. Instead of a single counter for a default banner, the system now maintains a map of banner messages to their individual display counts, allowing for better control and analytics over banner visibility.

Highlights

  • Refactored Banner Count Persistence: The system now tracks the display count for individual banner messages using a map (bannerCounts) instead of a single counter (defaultBannerShownCount).
  • Granular Message Tracking: This change allows for tracking how many times each specific banner message has been shown, rather than just a generic default banner.
  • Updated UI Logic: The AppHeader component has been updated to read and update these new message-specific counts, ensuring banners are displayed correctly based on their individual history.
  • Test Suite Alignment: Corresponding test cases in AppHeader.test.tsx have been adjusted to reflect the new persistence mechanism.
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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a 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 refactors the banner display logic to track view counts for each unique banner message, instead of a single global count. This is a great improvement for more granular control over banner visibility.

However, I've identified a critical issue in the implementation within AppHeader.tsx. The component's state for bannerCounts is not updated after being incremented, causing the banner to be displayed indefinitely regardless of the view count. I've provided a detailed comment and a code suggestion to fix this.

Additionally, a test case in packages/cli/src/ui/components/AppHeader.test.tsx seems to have been missed during the refactoring. The test 'should not render the default banner if shown count is 5 or more' (line 129) still uses the old data structure for mocking persistentState.get(), which will cause the test to fail. This should be updated to align with the new bannerCounts object structure.

Comment thread packages/cli/src/ui/components/AppHeader.tsx Outdated
@llu77
Copy link
Copy Markdown

llu77 commented Nov 19, 2025

Ok

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 19, 2025

Size Change: +956 B (0%)

Total Size: 21.1 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 21.1 MB +956 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

Comment thread packages/cli/src/ui/hooks/useBanner.ts Outdated
Comment thread packages/cli/src/ui/hooks/useBanner.ts Outdated
@Adib234 Adib234 force-pushed the adibakm/update-persistence-state branch from b11bda3 to 1785bd4 Compare November 20, 2025 20:57
@Adib234 Adib234 added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit 3e50be1 Nov 20, 2025
22 checks passed
@Adib234 Adib234 deleted the adibakm/update-persistence-state branch November 20, 2025 22:15
thacio added a commit to thacio/auditaria that referenced this pull request Nov 23, 2025
werdnum pushed a commit to werdnum/gemini-cli that referenced this pull request Nov 24, 2025
@Adib234
Copy link
Copy Markdown
Contributor Author

Adib234 commented Nov 24, 2025

/patch stable

@github-actions
Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: stable
  • Commit: 3e50be1658a8f2be9c913211cb945aeb38a112d5
  • Workflows Created: 1

🔗 Track Progress:

github-actions Bot pushed a commit that referenced this pull request Nov 24, 2025
… banner has been displayed (#13428)

# Conflicts:
#	packages/cli/src/ui/components/AppHeader.tsx
@github-actions
Copy link
Copy Markdown

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. ⚠️ Resolve conflicts in the hotfix PR first: #13760
  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:

mboshernitsan pushed a commit that referenced this pull request Nov 25, 2025
@Adib234
Copy link
Copy Markdown
Contributor Author

Adib234 commented Nov 25, 2025

/patch preview

@github-actions
Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: 3e50be1658a8f2be9c913211cb945aeb38a112d5
  • Workflows Created: 1

🔗 Track Progress:

github-actions Bot pushed a commit that referenced this pull request Nov 25, 2025
@github-actions
Copy link
Copy Markdown

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. Review and approve the hotfix PR: #13821
  2. Once merged, the patch release will automatically trigger
  3. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions
Copy link
Copy Markdown

🚀 Patch Release Started!

📋 Release Details:

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

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

🔗 Track Progress:

@github-actions
Copy link
Copy Markdown

Patch Release Complete!

📦 Release Details:

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

📝 What's Available:

🔗 Links:

danpalmer pushed a commit to danpalmer/gemini-cli that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants