From e5524fbaf51154b4ecb137de3daf2919205e55ed Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Feb 2026 17:21:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=BE=E7=89=87=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=92=8C=E6=96=87=E6=9C=AC=E8=BE=93=E5=85=A5=E5=9C=A8=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- components/canvas/CanvasChatPanel.tsx | 97 ++++++++++++++------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index 81f67e8..5b6ded8 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -880,53 +880,60 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF {/* 底部输入区域 - Redesigned */}
- {/* 附件标签 - 显示在输入框内部顶部 */} - {attachments.length > 0 && ( -
- {attachments.map((att, index) => ( -
textareaRef.current?.focus()} + > + {/* 附件标签 */} + {attachments.map((att, index) => ( +
+ {/* 小缩略图 */} + + {/* 图片名称 */} + + {att.name || 'Image'} + + {/* 删除按钮 */} + -
- ))} -
- )} + + +
+ ))} + + {/* 文本输入 - 自适应宽度 */} + setInput(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + handleSend(); + } + }} + placeholder={attachments.length > 0 ? "添加描述..." : "请输入你的设计需求"} + className="flex-1 min-w-[120px] text-sm bg-transparent border-none outline-none placeholder:text-muted-foreground/50" + disabled={isLoading} + /> +
-