From 71d08d0580016eb23ddd673147c783b9a95ea3e5 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 21 Jul 2025 18:30:47 +0800 Subject: [PATCH] feat: handle is show current prompt --- .../app/configuration/config/automatic/get-automatic-res.tsx | 2 ++ .../config/automatic/instruction-editor-in-workflow.tsx | 3 +++ .../app/configuration/config/automatic/instruction-editor.tsx | 4 +++- .../config/code-generator/get-code-generator-res.tsx | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index 8f3ff83eca..62ea35d305 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -336,6 +336,7 @@ const GetAutomaticRes: FC = ({ onChange={setInstruction} availableVars={[]} availableNodes={[]} + isShowCurrentBlock={!!currentPrompt} /> ) : ( = ({ value={instruction} onChange={setInstruction} nodeId={nodeId || ''} + isShowCurrentBlock={!!currentPrompt} /> )} diff --git a/web/app/components/app/configuration/config/automatic/instruction-editor-in-workflow.tsx b/web/app/components/app/configuration/config/automatic/instruction-editor-in-workflow.tsx index 4927af3673..b452519d0f 100644 --- a/web/app/components/app/configuration/config/automatic/instruction-editor-in-workflow.tsx +++ b/web/app/components/app/configuration/config/automatic/instruction-editor-in-workflow.tsx @@ -15,6 +15,7 @@ type Props = { editorKey: string onChange: (text: string) => void generatorType: GeneratorType + isShowCurrentBlock: boolean } const InstructionEditorInWorkflow: FC = ({ @@ -23,6 +24,7 @@ const InstructionEditorInWorkflow: FC = ({ editorKey, onChange, generatorType, + isShowCurrentBlock, }) => { const workflowStore = useWorkflowStore() @@ -49,6 +51,7 @@ const InstructionEditorInWorkflow: FC = ({ availableVars={availableVars} availableNodes={availableNodes} getVarType={getVarType} + isShowCurrentBlock={isShowCurrentBlock} /> ) } diff --git a/web/app/components/app/configuration/config/automatic/instruction-editor.tsx b/web/app/components/app/configuration/config/automatic/instruction-editor.tsx index 2750cc7bfc..4c68424046 100644 --- a/web/app/components/app/configuration/config/automatic/instruction-editor.tsx +++ b/web/app/components/app/configuration/config/automatic/instruction-editor.tsx @@ -20,6 +20,7 @@ type Props = { nodeId: string, valueSelector: ValueSelector, }) => Type + isShowCurrentBlock: boolean } const i18nPrefix = 'appDebug.generate' @@ -32,6 +33,7 @@ const InstructionEditor: FC = ({ availableVars, availableNodes, getVarType = () => Type.string, + isShowCurrentBlock, }) => { const { t } = useTranslation() const isBasicMode = !!getVarType @@ -79,7 +81,7 @@ const InstructionEditor: FC = ({ }, {} as any), }} currentBlock={{ - show: true, + show: isShowCurrentBlock, generatorType, }} errorMessageBlock={{ diff --git a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx index 049ac7601a..cfdf7b918f 100644 --- a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx +++ b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx @@ -225,6 +225,7 @@ export const GetCodeGeneratorResModal: FC = ( onChange={setInstruction} nodeId={nodeId} generatorType={GeneratorType.code} + isShowCurrentBlock={!!currentCode} />