From 0ef2859291886450dba15844e21f482e6346f6a8 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Tue, 23 Sep 2025 00:27:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(wip):=20=E4=B8=8A=E5=82=B3=E5=9C=96?= =?UTF-8?q?=E7=89=87=E7=AD=89=E5=A4=9A=E5=AA=92=E9=AB=94=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/chat/ChatFragment.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index 61a8b49..fb8d6e7 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -180,14 +180,24 @@ export default function ChatFragment({ target, ...props }: Args) { alignItems: 'center', paddingBottom: '2px', paddingTop: '0.1rem', - height: '4rem', position: 'sticky', bottom: '0', marginLeft: '5px', marginRight: '4px', backgroundColor: 'rgb(var(--mdui-color-background))', + }} onDrop={(e) => { + if (e.dataTransfer.files) { + const files = e.dataTransfer.files + // 基于当前的实现, 浏览器不会读取文件的字节流来确定其媒体类型, 其根据文件扩展名进行假设 + // https://developer.mozilla.org/zh-CN/docs/Web/API/Blob/type + for (const file of files) { + if (file.type.startsWith("image/")) { + + } + } + } }}> - { + { if (event.ctrlKey && event.key == 'Enter') sendMessage() }} style={{