Skip to content

Comments

fix(ui): move margin from top to bottom in ToolGroupMessage#17198

Merged
scidomino merged 1 commit intogoogle-gemini:mainfrom
imadraude:fix/tool-group-margin
Feb 18, 2026
Merged

fix(ui): move margin from top to bottom in ToolGroupMessage#17198
scidomino merged 1 commit intogoogle-gemini:mainfrom
imadraude:fix/tool-group-margin

Conversation

@imadraude
Copy link
Contributor

@imadraude imadraude commented Jan 21, 2026

Summary

Moves the spacing for the ToolGroupMessage component from marginTop on internal elements to marginBottom on the root container. This ensures better logical separation of the tool block from subsequent messages.

Details

  • Removed marginTop where it was causing layout issues.
  • Added marginBottom={1} to the root Box of ToolGroupMessage.
  • Updated snapshots to reflect the layout change.

Related Issues

Fixes #17283

How to Validate

  1. Run the CLI and trigger a tool use (e.g., list_directory).
  2. Observe the spacing around the tool block.
  3. Verify that there is a 1-line gap after the tool block, separating it from the next message.
  4. Run tests: npm test -w @google/gemini-cli -- src/ui/components/messages/ToolGroupMessage.test.tsx

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

@imadraude imadraude requested a review from a team as a code owner January 21, 2026 11:27
@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Jan 21, 2026
@imadraude
Copy link
Contributor Author

Closing as the issue is not reproducible.

@imadraude imadraude closed this Jan 21, 2026
@imadraude
Copy link
Contributor Author

Opening because of false negative. Issue persists.

@imadraude imadraude reopened this Jan 21, 2026
@imadraude imadraude force-pushed the fix/tool-group-margin branch from 8b42b7b to 4b8de10 Compare January 22, 2026 07:39
@imadraude
Copy link
Contributor Author

/gemini review

Copy link
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 aims to improve layout consistency by moving the vertical spacing for ToolGroupMessage from internal margins to a marginBottom on the root container. The change in ToolGroupMessage.tsx and the updated snapshots reflect this intent. However, I've identified a significant issue where an internal height calculation was not updated to reflect this change, which leads to incorrect rendering and content truncation. A fix is suggested in the detailed comment, aligning with the principle of maintaining consistent UI layout.

@imadraude imadraude force-pushed the fix/tool-group-margin branch from 4b8de10 to 7cc3eba Compare January 22, 2026 07:52
@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality and removed status/need-issue Pull requests that need to have an associated issue. labels Jan 22, 2026
@imadraude
Copy link
Contributor Author

/gemini review

Copy link
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 spacing for the ToolGroupMessage component by moving it from an internal height calculation to a marginBottom on the root container. This correctly adds a consistent margin after the tool group, improving layout separation. The change to staticHeight is a good bug fix, as it was previously over-reserving space for conditional UI elements, and now correctly allocates more vertical space for tool content. The snapshot updates are consistent with these intended layout improvements. Overall, this is a solid change that improves layout correctness and component encapsulation.

@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Jan 22, 2026
@scidomino
Copy link
Collaborator

I will attempted to resolve the conflicts and merge.

@scidomino scidomino force-pushed the fix/tool-group-margin branch from 7cc3eba to ea053c4 Compare February 18, 2026 21:12
@scidomino scidomino enabled auto-merge February 18, 2026 21:13
@scidomino scidomino force-pushed the fix/tool-group-margin branch from ea053c4 to c89121a Compare February 18, 2026 21:37
@scidomino scidomino added this pull request to the merge queue Feb 18, 2026
Merged via the queue into google-gemini:main with commit e7f97df Feb 18, 2026
27 checks passed
jacob314 added a commit that referenced this pull request Feb 19, 2026
The unconditionally applied `marginBottom={1}` introduced in PR #17198 caused a visual gap
when a tool group is partially rendered between the static and pending areas
(i.e. `borderBottomOverride === false`).

By conditioning `marginBottom` on `borderBottomOverride !== false`, intermediate chunks
seamlessly connect with their bottom border chunks, while completed tool groups
still get the appropriate padding margin.

Fixes regression introduced in e7f97df.
jacob314 added a commit that referenced this pull request Feb 19, 2026
The unconditionally applied `marginBottom={1}` introduced in PR #17198 caused a visual gap
when a tool group is partially rendered between the static and pending areas
(i.e. `borderBottomOverride === false`).

By conditioning `marginBottom` on `borderBottomOverride !== false`, intermediate chunks
seamlessly connect with their bottom border chunks, while completed tool groups
still get the appropriate padding margin.

Fixes regression introduced in e7f97df.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: ToolGroupMessage layout has inconsistent spacing

2 participants