From 598ecc02c66222cc497de56fcbfc84d07d0eac0b Mon Sep 17 00:00:00 2001 From: Jingyi Date: Mon, 15 Jun 2026 22:33:34 -0700 Subject: [PATCH] fix(workflow): refine tool picker copy (#37477) --- .../__tests__/all-tools.spec.tsx | 46 +++++++++++++++++++ .../workflow/block-selector/all-tools.tsx | 13 +++++- web/i18n/ar-TN/tools.json | 4 ++ web/i18n/ar-TN/workflow.json | 4 +- web/i18n/de-DE/tools.json | 4 ++ web/i18n/de-DE/workflow.json | 6 +-- web/i18n/en-US/tools.json | 4 ++ web/i18n/en-US/workflow.json | 4 +- web/i18n/es-ES/tools.json | 4 ++ web/i18n/es-ES/workflow.json | 4 +- web/i18n/fa-IR/tools.json | 4 ++ web/i18n/fa-IR/workflow.json | 4 +- web/i18n/fr-FR/tools.json | 4 ++ web/i18n/fr-FR/workflow.json | 6 +-- web/i18n/hi-IN/tools.json | 4 ++ web/i18n/hi-IN/workflow.json | 6 +-- web/i18n/id-ID/tools.json | 4 ++ web/i18n/id-ID/workflow.json | 6 +-- web/i18n/it-IT/tools.json | 4 ++ web/i18n/it-IT/workflow.json | 6 +-- web/i18n/ja-JP/tools.json | 4 ++ web/i18n/ja-JP/workflow.json | 4 +- web/i18n/ko-KR/tools.json | 4 ++ web/i18n/ko-KR/workflow.json | 6 +-- web/i18n/nl-NL/tools.json | 4 ++ web/i18n/nl-NL/workflow.json | 4 +- web/i18n/pl-PL/tools.json | 4 ++ web/i18n/pl-PL/workflow.json | 4 +- web/i18n/pt-BR/tools.json | 4 ++ web/i18n/pt-BR/workflow.json | 4 +- web/i18n/ro-RO/tools.json | 4 ++ web/i18n/ro-RO/workflow.json | 4 +- web/i18n/ru-RU/tools.json | 4 ++ web/i18n/ru-RU/workflow.json | 4 +- web/i18n/sl-SI/tools.json | 4 ++ web/i18n/sl-SI/workflow.json | 6 +-- web/i18n/th-TH/tools.json | 4 ++ web/i18n/th-TH/workflow.json | 4 +- web/i18n/tr-TR/tools.json | 4 ++ web/i18n/tr-TR/workflow.json | 6 +-- web/i18n/uk-UA/tools.json | 4 ++ web/i18n/uk-UA/workflow.json | 6 +-- web/i18n/vi-VN/tools.json | 4 ++ web/i18n/vi-VN/workflow.json | 4 +- web/i18n/zh-Hans/tools.json | 4 ++ web/i18n/zh-Hans/workflow.json | 4 +- web/i18n/zh-Hant/tools.json | 4 ++ web/i18n/zh-Hant/workflow.json | 4 +- 48 files changed, 205 insertions(+), 56 deletions(-) diff --git a/web/app/components/workflow/block-selector/__tests__/all-tools.spec.tsx b/web/app/components/workflow/block-selector/__tests__/all-tools.spec.tsx index 1a489d3ccc..5bb062f726 100644 --- a/web/app/components/workflow/block-selector/__tests__/all-tools.spec.tsx +++ b/web/app/components/workflow/block-selector/__tests__/all-tools.spec.tsx @@ -3,6 +3,7 @@ import { screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { renderWithSystemFeatures } from '@/__tests__/utils/mock-system-features' import { useMarketplacePlugins } from '@/app/components/plugins/marketplace/hooks' +import { CollectionType } from '@/app/components/tools/types' import { useGetLanguage } from '@/context/i18n' import useTheme from '@/hooks/use-theme' import { Theme } from '@/types/app' @@ -92,6 +93,51 @@ describe('AllTools', () => { expect(screen.queryByText('Built In Provider')).not.toBeInTheDocument() }) + it('updates the tools list title by the active tab', async () => { + const user = userEvent.setup() + + render( + , + ) + + expect(screen.getByText('tools.allTools')).toBeInTheDocument() + + await user.click(screen.getByText('workflow.tabs.plugin')) + expect(screen.getByText('tools.allToolPlugins')).toBeInTheDocument() + + await user.click(screen.getByText('workflow.tabs.customTool')) + expect(screen.getByText('tools.allSwaggerAPIAsTool')).toBeInTheDocument() + + await user.click(screen.getByText('workflow.tabs.workflowTool')) + expect(screen.getByText('tools.allWorkflowAsTool')).toBeInTheDocument() + + await user.click(screen.getByText('MCP')) + expect(screen.getByText('tools.allMCP')).toBeInTheDocument() + }) + it('filters the rendered tools by the search text', () => { render( { + if (activeTab === ToolTypeEnum.BuiltIn) + return t('allToolPlugins', { ns: 'tools' }) + if (activeTab === ToolTypeEnum.Custom) + return t('allSwaggerAPIAsTool', { ns: 'tools' }) + if (activeTab === ToolTypeEnum.Workflow) + return t('allWorkflowAsTool', { ns: 'tools' }) + if (activeTab === ToolTypeEnum.MCP) + return t('allMCP', { ns: 'tools' }) + return t('allTools', { ns: 'tools' }) + }, [activeTab, t]) return (
@@ -264,7 +275,7 @@ const AllTools = ({ {hasToolsListContent && ( <>
- {t('allTools', { ns: 'tools' })} + {toolsListTitle}