From 8f1f9244210db9b7669750166d7401f6109967a3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Feb 2026 15:21:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=80=89=E4=B8=AD=E5=B7=A5=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 选中图片时在顶部显示工具栏(放大、移除背景、场景、角度、扩展、调整) 2. 工具栏使用圆角胶囊样式,类似竞品设计 3. 显示图片标题和尺寸信息 4. 添加更多操作下拉菜单(下载、删除) Co-authored-by: Cursor --- components/canvas/CanvasWorkspace.tsx | 4 +- components/canvas/nodes/ImageNode.tsx | 147 ++++++++++++++++---------- 2 files changed, 93 insertions(+), 58 deletions(-) diff --git a/components/canvas/CanvasWorkspace.tsx b/components/canvas/CanvasWorkspace.tsx index 3a2ff49..b97ea0e 100644 --- a/components/canvas/CanvasWorkspace.tsx +++ b/components/canvas/CanvasWorkspace.tsx @@ -247,8 +247,8 @@ export function CanvasWorkspace() { }} /> - {/* 节点层 - 使用虚拟化渲染 */} -
+ {/* 节点层 - 使用虚拟化渲染,允许工具栏溢出 */} +
{visibleNodes.map(renderNode)}
diff --git a/components/canvas/nodes/ImageNode.tsx b/components/canvas/nodes/ImageNode.tsx index 085bb9a..9265fcc 100644 --- a/components/canvas/nodes/ImageNode.tsx +++ b/components/canvas/nodes/ImageNode.tsx @@ -322,10 +322,21 @@ export function ImageNode({ node, isSelected }: ImageNodeProps) { return ( <> + {/* 选中时在图片上方显示标题和尺寸 */} + {isSelected && data.src && ( +
+
+ + {data.prompt || '图片'} +
+ {node.size.width} × {node.size.height} +
+ )} +
setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} @@ -381,91 +392,115 @@ export function ImageNode({ node, isSelected }: ImageNodeProps) {
)} - {/* 选中时显示的顶部工具栏 - 和聊天窗口中的功能一致 */} + {/* 选中时显示的顶部工具栏 - 放在图片内部顶部,避免被裁剪 */} {isSelected && data.src && !isProcessing && (
e.stopPropagation()} > + {/* 放大/高清 */} - + + {/* 移除背景/抠图 */} + + {/* 场景融合 */} - - -
+ + {/* 角度编辑 */} + + {/* 扩展 */} + + {/* 尺寸调整 */} + + + {/* 更多操作 */} + + + + + + + + 下载图片 + + + deleteNode(node.id)} + className="text-destructive focus:text-destructive" + > + + 删除 + + +
)}