From 19e152fd0cf1bb4c329e231e6f38127c2ae6a5dd Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 28 Aug 2025 16:57:12 +0800 Subject: [PATCH] chore: prompt editor ui --- .../nodes/human-input/components/form-content.tsx | 13 ++++++++++++- .../components/workflow/nodes/human-input/panel.tsx | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) 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 120f980f36..335fe17b3c 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 @@ -10,6 +10,9 @@ 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' import type { LexicalCommand } from 'lexical' +import { isMac } from '../../../utils' +import { useBoolean } from 'ahooks' +import cn from '@/utils/classnames' type Props = { nodeId: string @@ -73,13 +76,20 @@ const FormContent: FC = ({ } }, [value]) + const [isFocus, { + setTrue: setFocus, + setFalse: setBlur, + }] = useBoolean(false) + return ( -
+
= ({ ), }]} /> +
Press / to insert variable, {isMac() ? '⌘' : 'Ctrl'} / to insert input field
) } diff --git a/web/app/components/workflow/nodes/human-input/panel.tsx b/web/app/components/workflow/nodes/human-input/panel.tsx index d901cad57f..0dd5f1cb4a 100644 --- a/web/app/components/workflow/nodes/human-input/panel.tsx +++ b/web/app/components/workflow/nodes/human-input/panel.tsx @@ -63,7 +63,7 @@ const Panel: FC> = ({ {/* form content */}
-
+
{t(`${i18nPrefix}.formContent.title`)}