diff --git a/web/app/components/workflow/nodes/human-input/components/form-content.tsx b/web/app/components/workflow/nodes/human-input/components/form-content.tsx index 335fe17b3c..203e8693a7 100644 --- a/web/app/components/workflow/nodes/human-input/components/form-content.tsx +++ b/web/app/components/workflow/nodes/human-input/components/form-content.tsx @@ -5,7 +5,7 @@ import React, { useEffect, useState } from 'react' import useAvailableVarList from '../../_base/hooks/use-available-var-list' import { BlockEnum } from '../../../types' import { useWorkflowVariableType } from '../../../hooks' -import { useTranslation } from 'react-i18next' +import { Trans, useTranslation } from 'react-i18next' import type { FormInputItem } from '../types' import AddInputField from './add-input-field' import { INSERT_HITL_INPUT_BLOCK_COMMAND } from '@/app/components/base/prompt-editor/plugins/hitl-input-block' @@ -26,6 +26,14 @@ type Props = { editorKey: number } +const Key: FC<{ children: React.ReactNode, className?: string }> = ({ children, className }) => { + return {children} +} + +const CtrlKey: FC = () => { + return {isMac() ? '⌘' : 'Ctrl'} +} + const FormContent: FC = ({ nodeId, nodeTitle, @@ -132,7 +140,19 @@ const FormContent: FC = ({ ), }]} /> -
Press / to insert variable, {isMac() ? '⌘' : 'Ctrl'} / to insert input field
+ {isFocus && ( +
+ /, + CtrlKey: , + } + } + /> +
+ )} ) } diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index 5f190b7e26..eb03ba3dbb 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -964,6 +964,7 @@ const translation = { formContent: { title: 'Form Content', tooltip: 'What users will see after opening the form. Supports Markdown formatting.', + hotkeyTip: 'Press to insert variable, to insert input field', }, userActions: { title: 'User Actions', diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index b69f5f755f..c5e697febb 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -964,6 +964,7 @@ const translation = { formContent: { title: '表单内容', tooltip: '用户打开表单后看到的内容。支持 Markdown 格式。', + hotkeyTip: '按 插入变量,按 插入输入字段', }, userActions: { title: '用户操作',