From a17a035689dba0426dabd7e5d10dddf0b85be8ae Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 6 Apr 2026 23:01:05 +0800 Subject: [PATCH] refactor: beautify realtime enhance workspace ui --- components/canvas/EnhanceProWorkspace.tsx | 102 +++++++++++++-------- components/canvas/RealtimeCanvasDialog.tsx | 12 +-- 2 files changed, 71 insertions(+), 43 deletions(-) diff --git a/components/canvas/EnhanceProWorkspace.tsx b/components/canvas/EnhanceProWorkspace.tsx index 1591338da..72c9d5d65 100644 --- a/components/canvas/EnhanceProWorkspace.tsx +++ b/components/canvas/EnhanceProWorkspace.tsx @@ -101,27 +101,34 @@ const FALLBACK_CONFIG: EnhanceProClientConfig = { }; const PANEL_SHELL_CLASS = - "pointer-events-auto rounded-[28px] border border-[#e7e1d4] bg-white/88 shadow-[0_20px_50px_rgba(15,23,42,0.08)] backdrop-blur-xl"; + "pointer-events-auto rounded-[24px] border border-[#e0e2e8] bg-white shadow-[0_0_0_1px_rgb(224,226,232),0_16px_36px_rgba(28,28,30,0.04)]"; const SOLID_PANEL_FIELD_CLASS = - "border-[#e7e1d4] bg-[#fffdfa] text-foreground shadow-[0_8px_20px_rgba(15,23,42,0.05)]"; + "border-[#e9eaef] bg-white text-[#1c1c1e] shadow-[0_1px_2px_rgba(28,28,30,0.04)]"; const SOLID_PANEL_CARD_CLASS = - "rounded-[22px] border border-[#e7e1d4] bg-[#fffdfa] shadow-[0_8px_20px_rgba(15,23,42,0.05)]"; -const PANEL_SECTION_TITLE_CLASS = "font-semibold text-[12px] text-slate-700"; -const PANEL_SECTION_NOTE_CLASS = "text-[10.5px] leading-4 text-slate-500"; + "rounded-[20px] border border-[#e0e2e8] bg-white shadow-[0_0_0_1px_rgb(224,226,232),0_8px_18px_rgba(28,28,30,0.03)]"; +const PANEL_SECTION_TITLE_CLASS = + "font-semibold text-[12px] tracking-[-0.02em] text-[#1c1c1e]"; +const PANEL_SECTION_NOTE_CLASS = + "text-[11px] leading-4 text-[#555a6a]"; const SOLID_PANEL_SELECT_CONTENT_CLASS = - "border-[#e7e1d4] bg-[#fffdfa] shadow-[0_16px_34px_rgba(15,23,42,0.08)]"; + "border-[#e0e2e8] bg-white shadow-[0_0_0_1px_rgb(224,226,232),0_16px_34px_rgba(28,28,30,0.08)]"; const PRIMARY_ACTION_BUTTON_CLASS = - "border border-[#2563eb] bg-[#2563eb] text-white shadow-[0_10px_22px_rgba(37,99,235,0.18)] transition hover:border-[#1d4ed8] hover:bg-[#1d4ed8] disabled:border-[#e7e1d4] disabled:bg-slate-200 disabled:text-slate-500 disabled:shadow-none"; + "border border-[#5b76fe] bg-[#5b76fe] text-white shadow-[0_14px_28px_rgba(91,118,254,0.24)] transition hover:border-[#2a41b6] hover:bg-[#2a41b6] disabled:border-[#e0e2e8] disabled:bg-[#eef1f6] disabled:text-[#a5a8b5] disabled:shadow-none"; const SECONDARY_ACTION_BUTTON_CLASS = - "border border-[#d8e4ff] bg-[#eef4ff] text-[#1d4ed8] shadow-[0_8px_20px_rgba(59,130,246,0.10)] transition hover:bg-[#e4eeff] hover:text-[#1e40af] disabled:border-[#e7e1d4] disabled:bg-slate-100 disabled:text-slate-400 disabled:shadow-none"; -const COMPACT_FIELD_CLASS = `${SOLID_PANEL_FIELD_CLASS} h-10 rounded-[16px] text-sm`; -const COMPACT_LABEL_CLASS = "text-slate-600 text-[11px] leading-4"; + "border border-[#c7cad5] bg-white text-[#1c1c1e] shadow-[0_0_0_1px_rgb(224,226,232),0_8px_18px_rgba(28,28,30,0.03)] transition hover:border-[#5b76fe] hover:bg-[#f6f8ff] hover:text-[#2a41b6] disabled:border-[#e0e2e8] disabled:bg-[#f7f8fb] disabled:text-[#a5a8b5] disabled:shadow-none"; +const COMPACT_FIELD_CLASS = `${SOLID_PANEL_FIELD_CLASS} h-11 rounded-[16px] text-sm`; +const COMPACT_LABEL_CLASS = + "font-medium text-[#555a6a] text-[11px] leading-4"; const COMPACT_TOGGLE_CARD_CLASS = "flex items-center justify-between gap-2.5 px-3 py-2.5"; -const SLIDER_TRACK_CLASS = "h-2 bg-[#ece7da] shadow-inner"; -const SLIDER_RANGE_CLASS = "bg-[#3b82f6]"; +const SLIDER_TRACK_CLASS = "h-2 bg-[#edf0f5] shadow-inner"; +const SLIDER_RANGE_CLASS = "bg-[#5b76fe]"; const SLIDER_THUMB_CLASS = - "h-4 w-4 border border-[#d8e4ff] bg-white shadow-[0_0_0_4px_rgba(59,130,246,0.16)]"; + "h-4 w-4 border border-[#c7cad5] bg-white shadow-[0_0_0_4px_rgba(91,118,254,0.16)]"; +const SIDEBAR_SCROLL_CLASS = + "pr-1.5 [scrollbar-width:thin] [scrollbar-color:#d7cfbf_transparent] [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[#d7cfbf] hover:[&::-webkit-scrollbar-thumb]:bg-[#c8bda9]"; +const SIDEBAR_SECTION_CARD_CLASS = + "rounded-[22px] border border-[#ece3d4] bg-[#fffdf8] p-3.5 shadow-[0_10px_24px_rgba(15,23,42,0.05)]"; function clampNumber(value: number, min: number, max: number) { return Math.min(max, Math.max(min, value)); @@ -636,8 +643,8 @@ export function EnhanceProWorkspace({ }; return ( -
-
+
+
{activePreviewUrl ? (
-
+
{activePreviewLabel}
) : ( -
- -
+
+
+ +
+
还没有可增强的图片
-
+
请先在主画布中选中一张图片,再从底部工具栏进入“图像增强 Pro”, 或者先在实时画布模式里生成一张结果后再切回来。
@@ -678,7 +687,7 @@ export function EnhanceProWorkspace({ {generatedImages.length > 0 && sidePreviewItems.length > 0 ? (
-
+
{sidePreviewItems.map((item, index) => { const isActive = item.isSource ? selectedResultIndex < 0 @@ -688,8 +697,8 @@ export function EnhanceProWorkspace({ className={cn( "group flex h-16 w-16 shrink-0 overflow-hidden rounded-2xl border transition", isActive - ? "border-sky-500 shadow-[0_0_0_1px_rgba(14,165,233,0.18)]" - : "border-[#e7e1d4] hover:shadow-sm" + ? "border-[#5b76fe] shadow-[0_0_0_1px_rgba(91,118,254,0.18),0_10px_20px_rgba(91,118,254,0.12)]" + : "border-[#e0e2e8] hover:shadow-sm" )} key={item.key} onClick={() => @@ -711,7 +720,7 @@ export function EnhanceProWorkspace({ ) : null}
-
+
{selectedGeneratedImage ? ( @@ -719,7 +728,7 @@ export function EnhanceProWorkspace({ {actionHint}
-
+
-
-
+
+
{isLoading ? (