From 3147e850be5c56d4af6468ec91e81d54a2db97ae Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 16 Jan 2026 17:52:40 +0800 Subject: [PATCH] fix: click tool not show current --- .../plugins/tool-block/component.tsx | 2 ++ .../workflow/skill/skill-doc-editor.tsx | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/component.tsx b/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/component.tsx index 08f841efeb..ad5dcc8a28 100644 --- a/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/component.tsx +++ b/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/component.tsx @@ -333,6 +333,8 @@ const ToolBlockComponent: FC = ({ onMouseDown={() => { if (!currentProvider || !currentTool) return + if (configuredToolValue) + setToolValue(configuredToolValue) setIsSettingOpen(true) }} > diff --git a/web/app/components/workflow/skill/skill-doc-editor.tsx b/web/app/components/workflow/skill/skill-doc-editor.tsx index 3e248637ff..3d8bbe0756 100644 --- a/web/app/components/workflow/skill/skill-doc-editor.tsx +++ b/web/app/components/workflow/skill/skill-doc-editor.tsx @@ -78,7 +78,21 @@ const SkillDocEditor: FC = () => { return if (dirtyMetadataIds.has(activeTabId)) return - storeApi.getState().setFileMetadata(activeTabId, fileContent.metadata ?? {}) + let nextMetadata: Record = {} + if (fileContent.metadata) { + if (typeof fileContent.metadata === 'string') { + try { + nextMetadata = JSON.parse(fileContent.metadata) + } + catch { + nextMetadata = {} + } + } + else { + nextMetadata = fileContent.metadata + } + } + storeApi.getState().setFileMetadata(activeTabId, nextMetadata) storeApi.getState().clearDraftMetadata(activeTabId) }, [activeTabId, dirtyMetadataIds, fileContent, storeApi])