fix(canvas): use icon compare toggle and move it away from prompt overlay
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-01 01:41:32 +08:00
parent d11fd0825d
commit 0933ec4ce9

View File

@ -1660,13 +1660,30 @@ export function ImageNode({ node, isSelected }: ImageNodeProps) {
{isSelected && !isMultiSelected && hasCompareSource && !isThisNodePicking && (
<button
type="button"
className="absolute bottom-2 right-2 rounded-md bg-black/70 px-2 py-1 text-[11px] font-medium text-white transition-colors hover:bg-black/80"
className="absolute top-2 right-2 z-40 inline-flex h-8 w-8 items-center justify-center rounded-full border border-white/70 bg-black/70 text-white transition-colors hover:bg-black/80"
onClick={(event) => {
event.stopPropagation();
setIsCompareMode((prev) => !prev);
}}
title={isCompareMode ? "退出对比" : "开启对比"}
aria-label={isCompareMode ? "退出对比" : "开启对比"}
>
{isCompareMode ? "退出对比" : "对比显示"}
{isCompareMode ? (
<X className="h-4 w-4" />
) : (
<svg
viewBox="0 0 24 24"
className="h-4 w-4"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect x="3" y="5" width="18" height="14" rx="2" />
<path d="M12 5v14" />
</svg>
)}
</button>
)}
</div>