From 79e5a870e16e5ad308233ba0923b29b241d2b08a Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 24 Jan 2026 21:27:36 +0800 Subject: [PATCH] feat: comprehensive UI redesign for infinite canvas (LOVART style) --- app/canvas/[id]/page.tsx | 426 ++++++++++++-------------- components/canvas/CanvasWorkspace.tsx | 2 +- 2 files changed, 205 insertions(+), 223 deletions(-) diff --git a/app/canvas/[id]/page.tsx b/app/canvas/[id]/page.tsx index d94521fac..4837d7540 100644 --- a/app/canvas/[id]/page.tsx +++ b/app/canvas/[id]/page.tsx @@ -3,6 +3,7 @@ import { useEffect, useState, useCallback, use } from "react"; import { useRouter } from "next/navigation"; import { + ArrowLeft, Save, Undo2, Redo2, @@ -360,12 +361,27 @@ export default function CanvasEditorPage({ params }: PageProps) { return ( -
- {/* 顶部工具栏 */} -
- {/* 左侧:标题编辑 */} -
- {isEditingTitle ? ( +
+ + {/* 1. Canvas Layer (Full Screen) */} +
+ +
+ + {/* 2. Floating Header (Top Left) */} +
+ + + + + 返回首页 + + + + + {isEditingTitle ? ( setEditTitle(e.target.value)} @@ -374,12 +390,12 @@ export default function CanvasEditorPage({ params }: PageProps) { if (e.key === 'Enter') handleUpdateTitle(); if (e.key === 'Escape') setIsEditingTitle(false); }} - className="h-7 w-48 text-sm" + className="h-8 w-48 text-sm bg-transparent border-none focus-visible:ring-0 px-2" autoFocus /> ) : ( )} -
- - {/* 中间:工具栏 */} -
- {/* 选择/平移工具 */} -
- - - - - 选择工具 (V) - - - - - - 平移工具 (H) - -
- - - - {/* 撤销/重做 */} - - - - - 撤销 (Ctrl+Z) - - - - - - 重做 (Ctrl+Shift+Z) - - - - - {/* 缩放 */} - - - - - 缩小 - - - {Math.round(viewport.zoom * 100)}% - - - - - - 放大 - - - - - {/* 添加节点 */} - - - - - - - - 文本节点 - - - - 图片节点 - - - - - -
- - {/* 右侧:面板切换 + 保存 */} -
- {isGenerating && ( -
- - 生成中... -
- )} - - - - - {isPanelOpen ? "隐藏面板" : "显示面板"} - - - - - - 保存 (Ctrl+S) - -
- {/* 主体区域 */} -
- {/* 左侧面板 - 标签页切换 AI对话/快捷工具 */} -
- {isPanelOpen && ( + {/* 3. Floating Actions (Top Right) */} +
+
+ {isGenerating && ( +
+ + 生成中... +
+ )} + + {/* Save Button */} + + + + + 保存 (Ctrl+S) + + + + + {/* Panel Toggle */} + + + + + {isPanelOpen ? "隐藏面板" : "显示面板"} + +
+
+ + {/* 4. Floating Sidebar (Left) */} +
+
- - - - AI 对话 - - - - 快捷工具 - - +
+ + + + AI 对话 + + + + 快捷工具 + + +
{/* AI 对话标签页 */} - + {/* 快捷工具标签页 */} - +
{/* AI 图片生成 */} @@ -606,7 +495,7 @@ export default function CanvasEditorPage({ params }: PageProps) { placeholder="描述你想要生成的图片..." value={prompt} onChange={(e) => setPrompt(e.target.value)} - className="min-h-[100px] text-sm resize-none" + className="min-h-[100px] text-sm resize-none bg-muted/30" />
@@ -616,14 +505,14 @@ export default function CanvasEditorPage({ params }: PageProps) { placeholder="描述你不想出现的内容..." value={negativePrompt} onChange={(e) => setNegativePrompt(e.target.value)} - className="min-h-[60px] text-sm resize-none" + className="min-h-[60px] text-sm resize-none bg-muted/30" />