From c5510e49369d33aba6f4a7f56e58a5f2e5c725cf Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 May 2026 13:35:33 +0800 Subject: [PATCH] fix: always show canvas local edit entry --- components/canvas/CanvasWorkspace.tsx | 7 ++----- components/canvas/nodes/ImageNode.tsx | 7 +++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/components/canvas/CanvasWorkspace.tsx b/components/canvas/CanvasWorkspace.tsx index 6b707d03e..87be14137 100644 --- a/components/canvas/CanvasWorkspace.tsx +++ b/components/canvas/CanvasWorkspace.tsx @@ -46,7 +46,6 @@ import { } from "@/lib/canvas/video-canvas-markers"; import { getCanvasToolbarItem, - isCanvasToolbarItemEnabled, normalizeCanvasToolbarConfig, type CanvasToolbarConfig, } from "@/lib/canvas-toolbar-config"; @@ -379,10 +378,8 @@ export function CanvasWorkspace({ canvasToolbarConfig, "imageLocalEdit" ); - const selectedImageLocalEditEnabled = isCanvasToolbarItemEnabled( - canvasToolbarConfig, - "imageLocalEdit" - ); + // 局部编辑属于主无限画布图片的固定能力,旧配置缺少该 key 时也保持可见。 + const selectedImageLocalEditEnabled = true; // Store actions const setViewport = useCanvasStore((state) => state.setViewport); diff --git a/components/canvas/nodes/ImageNode.tsx b/components/canvas/nodes/ImageNode.tsx index 22cb0a638..2bccd7091 100644 --- a/components/canvas/nodes/ImageNode.tsx +++ b/components/canvas/nodes/ImageNode.tsx @@ -1566,10 +1566,9 @@ export function ImageNode({ canvasToolbarConfig, "imageBoxCutout" ); - const imageLocalEditEnabled = isCanvasToolbarItemEnabled( - canvasToolbarConfig, - "imageLocalEdit" - ); + // 局部编辑是无限画布图片的核心入口:即使旧后台工具栏配置里还没有该 key, + // 也必须默认展示,避免历史配置把新功能吞掉。 + const imageLocalEditEnabled = true; const imageLayerSplitEnabledByToolbar = isCanvasToolbarItemEnabled( canvasToolbarConfig, "imageLayerSplit"