From da560e595033fe7ca410400e94a14bce3c1c9391 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 16 Jul 2025 16:16:30 +0800 Subject: [PATCH] chore: current ui fix --- web/app/components/base/prompt-editor/index.tsx | 2 +- .../_base/components/variable/var-reference-vars.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/web/app/components/base/prompt-editor/index.tsx b/web/app/components/base/prompt-editor/index.tsx index 4288ad1e26..7d70f2b10e 100644 --- a/web/app/components/base/prompt-editor/index.tsx +++ b/web/app/components/base/prompt-editor/index.tsx @@ -112,7 +112,7 @@ const PromptEditor: FC = ({ workflowVariableBlock, currentBlock = { show: true, - generatorType: GeneratorType.prompt, + generatorType: GeneratorType.code, }, isSupportFileVar, }) => { diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx index 3414903318..8575aca247 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx @@ -86,6 +86,14 @@ const Item: FC = ({ } }, [isFlat, isInCodeGeneratorInstructionEditor, itemData.variable]) + const varName = useMemo(() => { + if(!isFlat) + return itemData.variable + if (itemData.variable === 'current') + return isInCodeGeneratorInstructionEditor ? 'current_code' : 'current_prompt' + return itemData.variable + }, [isFlat, isInCodeGeneratorInstructionEditor, itemData.variable]) + const objStructuredOutput: StructuredOutput | null = useMemo(() => { if (!isObj) return null const properties: Record = {}; @@ -175,7 +183,7 @@ const Item: FC = ({ {isLoopVar && } {isFlat && flatVarIcon} {!isEnv && !isChatVar && ( -
{itemData.variable}
+
{varName}
)} {isEnv && (
{itemData.variable.replace('env.', '')}