fix(patch): cherry-pick f40498d to release/v0.46.0-preview.1-pr-27676 to patch version v0.46.0-preview.1 and create version 0.46.0-preview.2#27699
Conversation
Summary of ChangesHello, 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 cherry-picks a specific fix into the preview release branch to ensure important 'Antigravity' announcements are not suppressed by existing banner frequency capping logic. This change ensures critical messaging reaches users consistently. 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 the 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 counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request modifies the banner display logic in useBanner.ts to bypass the maximum display limit if the banner text contains "Antigravity", and adds a corresponding test. However, the reviewer pointed out that the patch accidentally truncated an existing test assertion in useBanner.test.ts. Furthermore, the reviewer noted that according to the project guidelines, all banners—including special announcements like Antigravity—must be hidden after reaching the maximum display count, meaning the proposed bypass logic is incorrect and should be reverted.
| }); | ||
|
|
||
| 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: '', | ||
| }; | ||
|
|
||
| mockedPersistentStateGet.mockReturnValue({ | ||
| [crypto | ||
| .createHash('sha256') | ||
| .update(antigravityBannerData.defaultText) | ||
| .digest('hex')]: 5, | ||
| }); | ||
|
|
||
| const { result } = await renderHook(() => useBanner(defaultBannerData)); | ||
| const { result } = await renderHook(() => useBanner(antigravityBannerData)); | ||
|
|
||
| expect(result.current.bannerText).toBe(''); | ||
| expect(result.current.bannerText).toBe('Antigravity is coming to town!'); | ||
| }); |
There was a problem hiding this comment.
The cherry-pick or patch modification accidentally truncated the existing test 'should hide banner if show count exceeds max limit (Legacy format)'. This restores the original test's assertion. Additionally, ensure that all banners, including those with warnings or special announcements like Antigravity, are hidden after reaching the maximum display count.
const { result } = await renderHook(() => useBanner(defaultBannerData));
expect(result.current.bannerText).toBe('');
});
it('should hide banner if show count exceeds max limit (Legacy format) even if it contains an Antigravity announcement', async () => {
const antigravityBannerData = {
defaultText: 'Antigravity is coming to town!',
warningText: '',
};
mockedPersistentStateGet.mockReturnValue({
[crypto
.createHash('sha256')
.update(antigravityBannerData.defaultText)
.digest('hex')]: 5,
});
const { result } = await renderHook(() => useBanner(antigravityBannerData));
expect(result.current.bannerText).toBe('');
});References
- Banners, including those with warnings, should be hidden after reaching a maximum display count.
|
📊 PR Size: size/S
|
|
Size Change: +36 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
This PR automatically cherry-picks commit f40498d to patch version v0.46.0-preview.1 in the preview release to create version 0.46.0-preview.2.