feat: 聊天输入框支持粘贴图片 (Add image paste support to chat textarea) #77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
此拉取请求为聊天输入框添加了直接粘贴图片的功能。粘贴的图片通过新的工具函数
readImageFile
读取为数据 URL,并随后使用appendImages
存储在聊天上下文中。此增强功能通过简化在聊天中分享图片的过程来改善用户体验。更改内容:
handlePaste
函数来处理粘贴图像。TextareaForm
以支持粘贴事件。readImageFile
工具函数来处理文件读取。This pull request adds functionality to the chat textarea that allows users to paste images directly. The pasted images are read as data URLs using a new utility function
readImageFile
, and are then stored in the chat context withappendImages
. This enhancement improves the user experience by simplifying the process of sharing images in chats.Changes:
handlePaste
function to process image pasting.TextareaForm
to support paste events.readImageFile
utility function to handle file reading.