feat: handle is show current prompt

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

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

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

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

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

Loading…
Cancel
Save