diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index 81f67e8dc..5b6ded818 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} + /> +
-