feat: use [Image #X] placeholder for clipboard paste and drag and drop#15432
feat: use [Image #X] placeholder for clipboard paste and drag and drop#15432jackwotherspoon wants to merge 14 commits intomainfrom
Conversation
Summary of ChangesHello @jackwotherspoon, 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 significantly overhauls how images are handled within the CLI, moving from simple file path references to a more robust and user-friendly system. The core change introduces Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
|
Size Change: +12.6 kB (+0.06%) Total Size: 22.1 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a user-friendly way to handle image attachments from clipboard paste and drag-and-drop, using [Image #X] placeholders. The implementation includes a new useClipboardImages hook for managing images, validation for size and format, and updates to the input prompt for handling and highlighting. The code is well-structured and includes comprehensive tests for the new hook. I have a couple of suggestions to improve performance by parallelizing asynchronous operations in loops, which will improve UI responsiveness when handling multiple images.
|
Closing as a community PR for this landed. |
Summary
@path/to/image.pngsyntax with user-friendly[Image #1]placeholders for pasted/dropped images[Image #N]placeholders from their message to exclude images before sendingdrag.and.drop.images.mp4
Details
The previous
@pathapproach for clipboard images had limitations:The new
[Image #N]placeholder system provides immediate visual feedback, cleaner input, and upfront validation.useClipboardImageshook: Manages image registry with sequential IDs, handles validation, and converts images to base64 parts for the API[Image #N]placeholders are highlighted in accent color alongside commands and file referencesRelated Issues
Newer version of #14706
Related to #5316
How to Validate
[Image #1]placeholder[Image #1],[Image #2], etc.@pathuseClipboardImages,clipboardUtils, andhighlightPre-Merge Checklist