fix(ui): prevent empty tool-group border stubs after filtering#21852
fix(ui): prevent empty tool-group border stubs after filtering#21852jacob314 merged 1 commit intogoogle-gemini:mainfrom
Conversation
|
/gemini review Edit: Was expecting Gemini bot feedback, but it looks like the bot isn’t attached on this PR from my side. |
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 addresses a visual glitch in the UI where tool-related blocks would sometimes display an unwanted bottom border after their content was filtered or hidden. The changes ensure that these empty border fragments are correctly suppressed, improving the cleanliness and consistency of the user interface during dynamic state changes, while preserving necessary visual cues for specific tool group transitions. Highlights
Changelog
Activity
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.
Code Review
This pull request effectively addresses the UI rendering bug where empty tool-group border stubs could appear after filtering. The updated logic in ToolGroupMessage.tsx correctly distinguishes between genuinely empty tool groups and explicit closing slices, ensuring that standalone bottom borders are only rendered when intended for static/pending continuity. The addition of comprehensive test cases in ToolGroupMessage.test.tsx provides excellent coverage for various filtering scenarios, including low verbosity errors, plan-mode tools, confirming tools, and transition states, which significantly hardens the validation of this fix. The changes are well-implemented and directly resolve the reported issue.
There was a problem hiding this comment.
Code Review
This pull request effectively resolves a UI rendering bug that caused orphan borders to appear when tool groups became empty after filtering. The proposed change correctly adjusts the rendering logic to prevent this, while carefully preserving the intended behavior for explicit closing borders. The fix is well-supported by a comprehensive suite of new unit tests that cover various edge cases and state transitions, confirming the robustness of the solution. The changes are well-contained and I have not identified any issues.
18f596c to
a6277ab
Compare
|
/patch preview |
|
/patch stable |
|
🚀 [Step 1/4] Patch workflow(s) waiting for approval! 📋 Details:
⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs. 🔗 Track Progress: |
|
🚀 [Step 1/4] Patch workflow(s) waiting for approval! 📋 Details:
⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs. 🔗 Track Progress: |
…e-gemini#21852) Co-authored-by: jacob314 <jacob314@gmail.com>
…e-gemini#21852) Co-authored-by: jacob314 <jacob314@gmail.com>
…e-gemini#21852) Co-authored-by: jacob314 <jacob314@gmail.com>
…e-gemini#21852) Co-authored-by: jacob314 <jacob314@gmail.com>

Summary
Fixes a UI rendering bug where tool-related blocks could collapse into an orphan bottom border line after state transitions (notably plan approval and hidden tool-error flows).
The change ensures
ToolGroupMessageonly renders a standalone closing border when the item is an explicit empty closing slice (tools: []) used for static/pending border continuity.Details
Root cause:
ToolGroupMessagecould end up withvisibleToolCalls.length === 0after filtering (low error verbosity, plan-mode filtering, confirming/in-progress hidden paths).borderBottom=true, producing the “empty border stub”.Fix:
ToolGroupMessage:null.allToolCalls.length === 0) withborderBottom=true.Validation hardening (new tests):
borderBottom=truerenders no fragment.borderBottom=truerenders no fragment.borderBottom=truerenders no fragment.Related Issues
Fixes #21685
How to Validate
Run targeted tests:
npm run test --workspace @google/gemini-cli -- src/ui/components/messages/ToolGroupMessage.test.tsxRun nearby integration surface:
npm run test --workspace @google/gemini-cli -- src/ui/components/MainContent.test.tsxRun typecheck:
npm run typecheck --workspace @google/gemini-cliManual interactive verification:
ui.errorVerbositytolow.Ask User/Exit Plan Modepath).ui.errorVerbositytofull.Pre-Merge Checklist