-
Notifications
You must be signed in to change notification settings - Fork 10.2k
feat: use [Image #X] placeholder for clipboard paste and drag and drop #15432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.5 kB (+0.06%) Total Size: 22 MB
ℹ️ View Unchanged
|
There was a problem hiding this 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 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.
|
Hey Jack! I think that #4924 means that this UX is implemented to an extent -- but it does so through the same More broadly, those transformations could easily be generalized to handle additional cases of "we want to abbreviate this type of input" although I'm not sure if that makes it a clever abstraction or a premature one. (As an aside, #15527 would have these directories exist in Notably, that current implementation does not extend that transformation beyond the I just thought it could be helpful for me to articulate these observations on account of the overlapped concerns, I could be mistaken in which case feel free to ignore. Please accept my apologies if I was mistaken. |
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