-
Notifications
You must be signed in to change notification settings - Fork 53
feat: add filename and dimensions to image paste placeholders #296
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: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR enhances image paste placeholders from the simple [Image #1]
format to a more informative [Image 100X100 filename#1]
format that includes dimensions and filename information. The change improves user experience by providing more context about pasted images.
- Added image dimension extraction from binary headers for PNG, JPEG, GIF, and WebP formats
- Implemented filename truncation with middle ellipsis for long filenames
- Updated placeholder format to include dimensions and filename across all relevant components
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/ui/useImagePasteManager.ts | Core implementation of dimension extraction, filename truncation, and new placeholder format |
src/ui/useInputHandlers.ts | Updated to pass filename parameter to image paste handler |
src/ui/store.ts | Modified regex pattern to match new placeholder format and extract image IDs |
src/ui/TextInput/utils/imagePaste.ts | Enhanced to return filename along with image data |
src/ui/TextInput/index.tsx | Updated to pass filename to onImagePaste callback |
src/ui/TextInput/hooks/useTextInput.ts | Added filename parameter to onImagePaste type signature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
图片占位符从
[Image #1]
改为[Image 100X100 filename#1]
格式,综合参考了 codex 和 gemini。对于长文件名作了中间的省略处理。