fix(ui): resolve unwanted vertical spacing around various tool output treatments#24449
fix(ui): resolve unwanted vertical spacing around various tool output treatments#24449jwhelangoog merged 3 commits intomainfrom
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 addresses an issue where double vertical spacing appeared around 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 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. Footnotes
|
f887804 to
543c25a
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the layout and spacing logic for tool groups in the terminal UI, introducing a isToolGroupBoundary property to manage margins during transitions between message types. The ToolGroupMessage component was updated to improve height calculation accuracy and margin consistency for various tool types. Feedback was provided regarding an inaccuracy in the staticHeight calculation for standard tools and agent groups, noting that the header area's height should be accounted for unconditionally to ensure precise terminal scroll-tracking.
|
Size Change: +1.01 kB (0%) Total Size: 34.6 MB
ℹ️ View Unchanged
|
543c25a to
524e111
Compare
|
screencast showing changes: http://screencast/cast/NTM5NzQxMzc1MjczMzY5NnxiYzdkODQxYy1mYg (noticeable changes begin about 20s in) |
524e111 to
b949b18
Compare
8055a64 to
ca69776
Compare
Refactor ToolGroupMessage to handle vertical spacing more precisely when mixed with compact tool output and topic updates. - Introduce 'isToolGroupBoundary' to track transitions between history item types. - Update ToolGroupMessage to suppress marginTop for TopicMessage if it is the first item in a group following a boundary, preventing double-spacing. - Synchronize staticHeight calculation to perfectly match the rendering logic, accounting for topic padding and boundary-aware margins.
Update UI and SVG snapshots to align with recent layout adjustments that prevent double-spacing around TopicMessage components and correct the tool group boundaries. - Re-generated snapshots in `packages/cli/src/ui` to capture the corrected margin and border alignment logic.
ca69776 to
797ecec
Compare
…rendering (address review feedback) - Updates staticHeight to account for all rendered lines and boundaries. - Use layout constants TOOL_RESULT_STATIC_HEIGHT and TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT for height logic. - Update comments to exhaustively explain the line count breakdown for all message types.
797ecec to
a9ce92c
Compare

Summary
Fixes the double vertical spacing issue for
TopicMessagecomponents in the history view when compact tool output is enabled. This refactorsToolGroupMessageandHistoryItemDisplayto handle boundaries and margins correctly, ensuring the UI remains compact without unexpected gaps.Details
isToolGroupBoundaryinMainContentandHistoryItemDisplayto track when the UI transitions between different types of history items (e.g., from user prompt to tool group).TopicMessagewrapper inToolGroupMessageto suppressmarginTopif it is the first item following a boundary (isFirst && isToolGroupBoundary). This prevents double-spacing.staticHeightcalculation loop to match rendering changes, accounting for topic padding and boundary-aware margins to maintain precise terminal scroll-tracking.Related Issues
Fixes #24434
How to Validate
npm testpasses without layout regressions.Pre-Merge Checklist