Skip to content

Comments

Fix bottom border color#19266

Merged
jacob314 merged 3 commits intomainfrom
borders
Feb 18, 2026
Merged

Fix bottom border color#19266
jacob314 merged 3 commits intomainfrom
borders

Conversation

@jacob314
Copy link
Contributor

@jacob314 jacob314 commented Feb 17, 2026

Summary

Before:
image

After:
Screenshot 2026-02-17 at 11 26 55 AM

Fixes #19265

Details:
Properly testing requires pending changes to use xterm to extract terminal colors correctly.

@jacob314 jacob314 requested a review from a team as a code owner February 17, 2026 17:13
@gemini-cli
Copy link
Contributor

gemini-cli bot commented Feb 17, 2026

Hi @jacob314, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jacob314, 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 refactors the border styling mechanism for tool group messages, centralizing the logic for determining border color and dimming into a dedicated utility function. This change enhances the flexibility and consistency of UI feedback for tool execution states, particularly for shell commands, by allowing explicit border properties to be passed through the component hierarchy.

Highlights

  • Centralized Border Styling Logic: Introduced a new utility function, getToolGroupBorderAppearance, in useGeminiStream.ts to encapsulate and centralize the logic for determining the border color and dimming state of tool group messages based on their execution status and shell focus.
  • Enhanced ToolGroupMessage Props: The ToolGroupMessage component now accepts explicit borderColor and borderDimColor props, allowing its border appearance to be controlled externally rather than solely relying on internal state.
  • Integration into Stream Processing: The useGeminiStream hook has been updated to utilize the new getToolGroupBorderAppearance function, dynamically calculating and passing the appropriate border styling to tool group messages as they are rendered.
  • Comprehensive Unit Tests: Added a new test suite for getToolGroupBorderAppearance in useGeminiStream.test.tsx, covering various scenarios to ensure the border styling logic behaves as expected for different tool statuses and shell interactions.
  • Type Definition Updates: Modified the HistoryItemToolGroup type in types.ts to include the new borderColor and borderDimColor properties, ensuring type safety and consistency across the application.
Changelog
  • packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
    • Added borderColor and borderDimColor props to ToolGroupMessageProps.
    • Updated the component to consume and apply the new borderColor and borderDimColor props, overriding default calculations if provided.
  • packages/cli/src/ui/hooks/toolMapping.ts
    • Extended the options parameter of mapToDisplay to include borderColor and borderDimColor.
    • Passed the new border properties through to the returned HistoryItemToolGroup.
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
    • Imported getToolGroupBorderAppearance and theme for testing.
    • Added a new describe block with multiple it tests for getToolGroupBorderAppearance to validate its behavior under different conditions.
  • packages/cli/src/ui/hooks/useGeminiStream.ts
    • Imported theme, isShellTool, and isThisShellFocused.
    • Introduced and exported the getToolGroupBorderAppearance function to calculate border color and dimming.
    • Integrated the getToolGroupBorderAppearance function into mapTrackedToolCallsToDisplay calls within useGeminiStream.
    • Refactored the initialization of activeToolPtyId and the useShellCommandProcessor hook for better dependency management.
    • Updated dependencies for pendingToolGroupItems memoization to include activeShellPtyId and isShellFocused.
  • packages/cli/src/ui/types.ts
    • Added borderColor?: string; and borderDimColor?: boolean; to the HistoryItemToolGroup type definition.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 17, 2026

Size Change: +2.19 kB (+0.01%)

Total Size: 24.5 MB

Filename Size Change
./bundle/gemini.js 24.5 MB +2.19 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

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 logic for determining the tool group border color by extracting it into a new function getToolGroupBorderAppearance. While this is a good refactoring for centralization, it introduces a critical bug in useGeminiStream.ts. The onComplete callback for useToolScheduler now attempts to use activeShellPtyId before it is declared, which will cause a ReferenceError at runtime. My review includes a critical comment to fix this issue by providing the correct border appearance for completed tool groups, which also resolves the crash.

@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Feb 17, 2026
@jacob314 jacob314 force-pushed the borders branch 3 times, most recently from 8b2f211 to 8086afd Compare February 17, 2026 23:01
@jacob314 jacob314 requested a review from galz10 February 17, 2026 23:54
staticAreaMaxItemHeight,
availableTerminalHeight,
cleanUiDetailsVisible,
activePtyId,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The historyItems and pendingItems memoizations now depend on activePtyId, embeddedShellFocused, and backgroundShells. While necessary for the dynamic styling, activePtyId and embeddedShellFocused can change frequently during shell interactions. Re-mapping the entire uiState.history on every change to these values might be expensive if the history grows large.

Consider if the border color calculation could be scoped more tightly or if the performance impact has been measured for large sessions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fantastic suggestion. I've implemented this.

// Since there are no tools to inspect, it falls back to empty pending, but isCurrentlyInShellTurn=true
// so it counts as pending shell.
expect(result.borderColor).toEqual(theme.ui.symbol);
// It shouldn't be dim because there are no tools to say it isEmbeddedShellFocused = false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment mentions isCurrentlyInShellTurn=true but doesn't explicitly verify the borderDimColor expectation, which would be helpful for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jacob314 jacob314 enabled auto-merge February 18, 2026 02:29
@jacob314 jacob314 added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit fe65d56 Feb 18, 2026
27 checks passed
@jacob314 jacob314 deleted the borders branch February 18, 2026 02:54
@jacob314
Copy link
Contributor Author

/patch preview

@jacob314
Copy link
Contributor Author

/patch stable

@github-actions
Copy link

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: fe65d562de8264b5ae13dcb84214a801225c96d2
  • Workflows Created: 1

🔗 Track Progress:

@github-actions
Copy link

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: stable
  • Commit: fe65d562de8264b5ae13dcb84214a801225c96d2
  • Workflows Created: 1

🔗 Track Progress:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bottom borders for tool groups are inconsistent with the rest of the border

3 participants