mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-13 12:57:12 -07:00
update the max amount of times the Antigravity transition banner can be displayed. (#27676)
This commit is contained in:
@@ -77,10 +77,24 @@ describe('useBanner', () => {
|
||||
.update(defaultBannerData.defaultText)
|
||||
.digest('hex')]: 5,
|
||||
});
|
||||
});
|
||||
|
||||
const { result } = await renderHook(() => useBanner(defaultBannerData));
|
||||
it('should not hide banner if show count exceeds max limit (Legacy format) if it contains an Antigravity announcement', async () => {
|
||||
const antigravityBannerData = {
|
||||
defaultText: 'Antigravity is coming to town!',
|
||||
warningText: '',
|
||||
};
|
||||
|
||||
expect(result.current.bannerText).toBe('');
|
||||
mockedPersistentStateGet.mockReturnValue({
|
||||
[crypto
|
||||
.createHash('sha256')
|
||||
.update(antigravityBannerData.defaultText)
|
||||
.digest('hex')]: 5,
|
||||
});
|
||||
|
||||
const { result } = await renderHook(() => useBanner(antigravityBannerData));
|
||||
|
||||
expect(result.current.bannerText).toBe('Antigravity is coming to town!');
|
||||
});
|
||||
|
||||
it('should increment the persistent count when banner is shown', async () => {
|
||||
|
||||
@@ -41,7 +41,9 @@ export function useBanner(bannerData: BannerData) {
|
||||
const currentBannerCount = bannerCounts[hashedText] || 0;
|
||||
|
||||
const showBanner =
|
||||
activeText !== '' && currentBannerCount < DEFAULT_MAX_BANNER_SHOWN_COUNT;
|
||||
activeText !== '' &&
|
||||
(currentBannerCount < DEFAULT_MAX_BANNER_SHOWN_COUNT ||
|
||||
activeText.includes('Antigravity'));
|
||||
|
||||
const rawBannerText = showBanner ? activeText : '';
|
||||
const bannerText = rawBannerText.replace(/\\n/g, '\n');
|
||||
|
||||
Reference in New Issue
Block a user