Skip to content
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

feat: 聊天输入框支持粘贴图片 (Add image paste support to chat textarea) #77

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

xgbstar1
Copy link
Contributor

@xgbstar1 xgbstar1 commented Nov 22, 2023

此拉取请求为聊天输入框添加了直接粘贴图片的功能。粘贴的图片通过新的工具函数 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 with appendImages. This enhancement improves the user experience by simplifying the process of sharing images in chats.

Changes:

  • Implement handlePaste function to process image pasting.
  • Modify TextareaForm to support paste events.
  • Add readImageFile utility function to handle file reading.

Copy link

vercel bot commented Nov 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
chatgpt-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2023 0:34am

Copy link

netlify bot commented Nov 22, 2023

Deploy Preview for chatgpt-next-xcatliu ready!

Name Link
🔨 Latest commit 72c340f
🔍 Latest deploy log https://app.netlify.com/sites/chatgpt-next-xcatliu/deploys/655df542f97ec5000793eef6
😎 Deploy Preview https://deploy-preview-77--chatgpt-next-xcatliu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@xgbstar1 xgbstar1 changed the title allow pasting into textarea form allow pasting images into textarea form Nov 22, 2023
@xgbstar1 xgbstar1 changed the title allow pasting images into textarea form feat: Add image paste support to chat textarea Nov 22, 2023
@xgbstar1 xgbstar1 changed the title feat: Add image paste support to chat textarea feat: 功能新增:聊天输入框支持粘贴图片 (Add image paste support to chat textarea) Nov 22, 2023
@xgbstar1 xgbstar1 changed the title feat: 功能新增:聊天输入框支持粘贴图片 (Add image paste support to chat textarea) feat: 聊天输入框支持粘贴图片 (Add image paste support to chat textarea) Nov 22, 2023
@xcatliu
Copy link
Owner

xcatliu commented Nov 22, 2023

LGTM

@xcatliu xcatliu merged commit f64b77a into xcatliu:main Nov 22, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants