Skip to content

feat(cli): enhance tool confirmation UI and selection layout#24376

Merged
galz10 merged 11 commits intomainfrom
galzahavi/improve/tool-confirmation
Apr 4, 2026
Merged

feat(cli): enhance tool confirmation UI and selection layout#24376
galz10 merged 11 commits intomainfrom
galzahavi/improve/tool-confirmation

Conversation

@galz10
Copy link
Copy Markdown
Collaborator

@galz10 galz10 commented Mar 31, 2026

Summary

This PR enhances the tool confirmation UI and selection layout within the CLI, providing clear visual boundaries around tool confirmation content (commands and diffs) to improve terminal readability.

Details

  • Updates ShellToolInvocation to display the provided description parameter rather than the raw command.
  • Fixes BaseSelectionList items to expand to full width, ensuring focus backgrounds span the entire container.
  • Updates related UI component snapshots to reflect the new layout and truncation formats.

Related Issues

N/A

How to Validate

Run the CLI and observe tool confirmations (especially with replace or run_shell_command). Verify the styling improvements and list focus states. Tests are already updated.

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

- Adds clear visual boundaries around tool confirmation content (commands and diffs) to improve terminal readability.
- Updates `ShellToolInvocation` to display the provided `description` parameter rather than the raw command.
- Fixes `BaseSelectionList` items to expand to full width, ensuring focus backgrounds span the entire container.
- Updates related UI component snapshots to reflect the new layout and truncation formats.
@galz10 galz10 requested review from a team as code owners March 31, 2026 20:56
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 improves the visual consistency and readability of the CLI tool confirmation interface. By introducing structured borders and ensuring full-width selection highlights, the UI provides a more polished and intuitive experience for users when confirming tool actions. Additionally, the tool invocation logic was updated to prioritize descriptive text over raw commands, further enhancing clarity.

Highlights

  • CLI UI Enhancement: Enhanced the tool confirmation UI by adding clear visual boundaries around commands and diffs to improve terminal readability.
  • Layout Improvements: Updated BaseSelectionList items to expand to full width, ensuring focus backgrounds span the entire container.
  • Tool Invocation Updates: Modified ShellToolInvocation to display the provided description parameter instead of the raw command string.
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.

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
Copy Markdown

github-actions Bot commented Mar 31, 2026

🧠 Model Steering Guidance

This PR modifies files that affect the model's behavior (prompts, tools, or instructions).

  • ⚠️ Consider adding Evals: No behavioral evaluations (evals/*.eval.ts) were added or updated in this PR. Consider adding a test case to verify the new behavior and prevent regressions.
  • 🚀 Maintainer Reminder: Please ensure that these changes do not regress results on benchmark evals before merging.

This is an automated guidance message triggered by steering logic signatures.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 31, 2026

Size Change: +5.81 kB (+0.02%)

Total Size: 34 MB

Filename Size Change
./bundle/chunk-QMS7CRDI.js 0 B -14.8 MB (removed) 🏆
./bundle/chunk-Z7X5RJJX.js 0 B -3.15 MB (removed) 🏆
./bundle/core-MBM3YOIV.js 0 B -45.2 kB (removed) 🏆
./bundle/devtoolsService-PEM7YE57.js 0 B -28.4 kB (removed) 🏆
./bundle/interactiveCli-4QO5MNDI.js 0 B -1.63 MB (removed) 🏆
./bundle/oauth2-provider-M26AWZRQ.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-7DMFNCC6.js 14.8 MB +14.8 MB (new file) 🆕
./bundle/chunk-F4B3HBEN.js 3.15 MB +3.15 MB (new file) 🆕
./bundle/core-KLGEJELL.js 45.2 kB +45.2 kB (new file) 🆕
./bundle/devtoolsService-ZY5SHKJD.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/interactiveCli-OLBWNEHM.js 1.64 MB +1.64 MB (new file) 🆕
./bundle/oauth2-provider-ONN77M7W.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
./bundle/bundled/third_party/index.js 8 MB
./bundle/chunk-34MYV7JD.js 2.45 kB
./bundle/chunk-5AUYMPVF.js 858 B
./bundle/chunk-5PS3AYFU.js 1.18 kB
./bundle/chunk-664ZODQF.js 124 kB
./bundle/chunk-DAHVX5MI.js 206 kB
./bundle/chunk-GFUOVHXW.js 1.96 MB
./bundle/chunk-IUUIT4SU.js 56.5 kB
./bundle/chunk-RJTRUG2J.js 39.8 kB
./bundle/devtools-36NN55EP.js 696 kB
./bundle/dist-T73EYRDX.js 356 B
./bundle/events-XB7DADIJ.js 418 B
./bundle/gemini.js 550 kB
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB
./bundle/memoryDiscovery-ACCRGPX3.js 980 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./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
./bundle/src-QVCVGIUX.js 47 kB
./bundle/tree-sitter-7U6MW5PS.js 274 kB
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB

compressed-size-action

Copy link
Copy Markdown
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 updates the UI layout for tool confirmations, specifically introducing a simplified, scrollable layout for shell and edit tools to prevent UI overflow. It also includes minor refactorings to improve code organization and consistency in confirmation labels. I have kept the review comment regarding the sandbox_expansion layout as it correctly identifies a potential UI usability issue where a long permission list could push confirmation options off-screen.

Note: Security Review did not run due to the size of the PR.

Comment thread packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
Comment thread packages/cli/src/ui/components/__snapshots__/ToolConfirmationQueue.test.tsx.snap Outdated
Comment thread packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
Comment thread packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
Comment thread packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
Comment thread packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
Comment thread packages/cli/src/ui/components/shared/BaseSelectionList.tsx Outdated
@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 31, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

57 tests passed successfully on gemini-3-flash-preview.

🧠 Model Steering Guidance

This PR modifies files that affect the model's behavior (prompts, tools, or instructions).

  • ⚠️ Consider adding Evals: No behavioral evaluations (evals/*.eval.ts) were added or updated in this PR. Consider adding a test case to verify the new behavior and prevent regressions.
  • 🚀 Maintainer Reminder: Please ensure that these changes do not regress results on benchmark evals before merging.

This is an automated guidance message triggered by steering logic signatures.

Copy link
Copy Markdown
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

- Group sandbox permissions by category with comma-separated paths.
- Reorder layout to Code Block -> Question -> Permissions for better flow.
- Fix vertical spacing issues above and below the body content.
- Ensure truncation labels remain correctly aligned without double-padding content.
- Update snapshots to reflect compact and corrected layout.
@galz10 galz10 force-pushed the galzahavi/improve/tool-confirmation branch from b36abb1 to 811a7b9 Compare April 3, 2026 21:15
@galz10 galz10 force-pushed the galzahavi/improve/tool-confirmation branch from 811a7b9 to 09ee79c Compare April 3, 2026 21:17
@galz10 galz10 force-pushed the galzahavi/improve/tool-confirmation branch from 09ee79c to 6415074 Compare April 3, 2026 21:20
@galz10 galz10 enabled auto-merge April 4, 2026 00:09
@galz10 galz10 added this pull request to the merge queue Apr 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 4, 2026
@galz10 galz10 added this pull request to the merge queue Apr 4, 2026
Merged via the queue into main with commit 7311e24 Apr 4, 2026
28 checks passed
@galz10 galz10 deleted the galzahavi/improve/tool-confirmation branch April 4, 2026 02:02
afanty2021 pushed a commit to afanty2021/gemini-cli that referenced this pull request Apr 4, 2026
jwhelangoog added a commit that referenced this pull request Apr 8, 2026
This commit addresses a regression introduced in PR #24376 where the
target file path was no longer displayed during the confirmation prompt
for `Edit` and `WriteFile` tools.

The previous PR suppressed the tool description for tools using the
`edit` confirmation layout. Since both `Edit` and `WriteFile` pass
their contextual target information (e.g., "✓ Edit src/main.ts") via
the tool description property, this suppression caused the UI to only
show the generic tool name and the diff.

This change removes the `!isEdit` restriction in the
`ToolConfirmationQueue` to restore the description visibility.

Fixes #24936
jwhelangoog added a commit that referenced this pull request Apr 8, 2026
This commit addresses a regression introduced in PR #24376 where the
target file path was no longer displayed during the confirmation prompt
for `Edit` and `WriteFile` tools.

The previous PR suppressed the tool description for tools using the
`edit` confirmation layout. Since both `Edit` and `WriteFile` pass
their contextual target information (e.g., "✓ Edit src/main.ts") via
the tool description property, this suppression caused the UI to only
show the generic tool name and the diff.

This change removes the `!isEdit` restriction in the
`ToolConfirmationQueue` to restore the description visibility.

Fixes #24936
jwhelangoog added a commit that referenced this pull request Apr 8, 2026
This commit addresses a regression introduced in PR #24376 where the
target file path was no longer displayed during the confirmation prompt
for `Edit` and `WriteFile` tools.

The previous PR suppressed the tool description for tools using the
`edit` confirmation layout. Since both `Edit` and `WriteFile` pass
their contextual target information (e.g., "✓ Edit src/main.ts") via
the tool description property, this suppression caused the UI to only
show the generic tool name and the diff.

This change removes the `!isEdit` restriction in the
`ToolConfirmationQueue` to restore the description visibility.

Fixes #24936
jwhelangoog added a commit that referenced this pull request Apr 8, 2026
This commit addresses a regression introduced in PR #24376 where the
target file path was no longer displayed during the confirmation prompt
for `Edit` and `WriteFile` tools.

The previous PR suppressed the tool description for tools using the
`edit` confirmation layout. Since both `Edit` and `WriteFile` pass
their contextual target information (e.g., "✓ Edit src/main.ts") via
the tool description property, this suppression caused the UI to only
show the generic tool name and the diff.

This change removes the `!isEdit` restriction in the
`ToolConfirmationQueue` to restore the description visibility.

Fixes #24936
warrenzhu25 pushed a commit to warrenzhu25/gemini-cli that referenced this pull request Apr 9, 2026
HaleTom pushed a commit to HaleTom/gemini-cli that referenced this pull request Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants