feat: handle is show current prompt

feat/enchance-prompt-and-code-fe
Joel 7 months ago
parent 534ece0ad0
commit 71d08d0580

@ -336,6 +336,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
onChange={setInstruction}
availableVars={[]}
availableNodes={[]}
isShowCurrentBlock={!!currentPrompt}
/>
) : (
<InstructionEditorInWorkflow
@ -344,6 +345,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
value={instruction}
onChange={setInstruction}
nodeId={nodeId || ''}
isShowCurrentBlock={!!currentPrompt}
/>
)}
</div>

@ -15,6 +15,7 @@ type Props = {
editorKey: string
onChange: (text: string) => void
generatorType: GeneratorType
isShowCurrentBlock: boolean
}
const InstructionEditorInWorkflow: FC<Props> = ({
@ -23,6 +24,7 @@ const InstructionEditorInWorkflow: FC<Props> = ({
editorKey,
onChange,
generatorType,
isShowCurrentBlock,
}) => {
const workflowStore = useWorkflowStore()
@ -49,6 +51,7 @@ const InstructionEditorInWorkflow: FC<Props> = ({
availableVars={availableVars}
availableNodes={availableNodes}
getVarType={getVarType}
isShowCurrentBlock={isShowCurrentBlock}
/>
)
}

@ -20,6 +20,7 @@ type Props = {
nodeId: string,
valueSelector: ValueSelector,
}) => Type
isShowCurrentBlock: boolean
}
const i18nPrefix = 'appDebug.generate'
@ -32,6 +33,7 @@ const InstructionEditor: FC<Props> = ({
availableVars,
availableNodes,
getVarType = () => Type.string,
isShowCurrentBlock,
}) => {
const { t } = useTranslation()
const isBasicMode = !!getVarType
@ -79,7 +81,7 @@ const InstructionEditor: FC<Props> = ({
}, {} as any),
}}
currentBlock={{
show: true,
show: isShowCurrentBlock,
generatorType,
}}
errorMessageBlock={{

@ -225,6 +225,7 @@ export const GetCodeGeneratorResModal: FC<IGetCodeGeneratorResProps> = (
onChange={setInstruction}
nodeId={nodeId}
generatorType={GeneratorType.code}
isShowCurrentBlock={!!currentCode}
/>
</div>
<IdeaOutput

Loading…
Cancel
Save