From 453844b9e80523614ecb68512a3a1ec6f6e3a174 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 26 Jan 2026 14:07:35 +0800 Subject: [PATCH] chore: editor config in new slide --- .../tool-block/tool-group-block-component.tsx | 57 +++++++++++++++++-- .../plugins/tool-block/tool-header.tsx | 20 ++++++- 2 files changed, 72 insertions(+), 5 deletions(-) diff --git a/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/tool-group-block-component.tsx b/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/tool-group-block-component.tsx index af2059a9fa..1e2d2d3311 100644 --- a/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/tool-group-block-component.tsx +++ b/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/tool-group-block-component.tsx @@ -38,6 +38,7 @@ import { cn } from '@/utils/classnames' import { basePath } from '@/utils/var' import { DELETE_TOOL_BLOCK_COMMAND } from './index' import { useToolBlockContext } from './tool-block-context' +import ToolHeader from './tool-header' type ToolGroupBlockComponentProps = { nodeKey: string @@ -295,6 +296,17 @@ const ToolGroupBlockComponent: FC = ({ return }, [currentProvider]) + const toolDescriptionText = useMemo(() => { + if (toolValue?.tool_description) + return toolValue.tool_description + if (currentTool?.description) { + return typeof currentTool.description === 'object' + ? (currentTool.description?.[language] || '') + : (currentTool.description || '') + } + return activeToolItem?.toolDescription || '' + }, [activeToolItem?.toolDescription, currentTool?.description, language, toolValue?.tool_description]) + useEffect(() => { if (!configuredToolValue) return @@ -552,7 +564,43 @@ const ToolGroupBlockComponent: FC = ({ ) - const groupPanelContent = ( + const toolDetailContent = currentProvider && currentTool && toolValue && ( +
+ { + setExpandedToolId(null) + }} + backLabel={t('operation.back', { ns: 'common' })} + onClose={() => { + setIsSettingOpen(false) + setExpandedToolId(null) + }} + /> + { + setToolValue(prev => (prev ? { ...prev, credential_id: id } : prev)) + }} + noDivider + /> + {needAuthorization && ( +
+
+ {t('skillEditor.authorizationRequired', { ns: 'workflow' })} +
+
+ )} + {toolSettingsContent} + {readmeEntrance} +
+ ) + + const groupListContent = (
@@ -612,7 +660,7 @@ const ToolGroupBlockComponent: FC = ({ key={item.configId} className={cn( 'rounded-xl border-[0.5px] border-components-panel-border-subtle px-3 py-2 shadow-xs', - expandedToolId === item.configId ? 'bg-components-panel-on-panel-item-bg-hover' : 'bg-components-panel-item-bg', + 'bg-components-panel-item-bg', )} >
@@ -625,7 +673,7 @@ const ToolGroupBlockComponent: FC = ({ type="button" className="flex items-center gap-1 rounded-md px-2 py-1 text-text-tertiary hover:bg-state-base-hover hover:text-text-secondary" onClick={() => { - setExpandedToolId(prev => (prev === item.configId ? null : item.configId)) + setExpandedToolId(item.configId) }} > @@ -648,7 +696,6 @@ const ToolGroupBlockComponent: FC = ({ {item.toolDescription}
)} - {expandedToolId === item.configId && toolSettingsContent}
))}
@@ -658,6 +705,8 @@ const ToolGroupBlockComponent: FC = ({
) + const groupPanelContent = expandedToolId && toolDetailContent ? toolDetailContent : groupListContent + return ( <> void + onBack?: () => void + backLabel?: string } const ToolHeader: FC = ({ @@ -19,6 +21,8 @@ const ToolHeader: FC = ({ toolLabel, description, onClose, + onBack, + backLabel, }) => { const renderHeaderIcon = () => { if (!icon) @@ -57,6 +61,20 @@ const ToolHeader: FC = ({
+ {onBack && ( + + )} {renderHeaderIcon()} {providerLabel}