feat: option to hide workflow steps (#5436)

This commit is contained in:
crazywoola
2024-06-21 12:51:10 +08:00
committed by GitHub
parent 1336b844fd
commit 92ddb410cd
29 changed files with 165 additions and 9 deletions

View File

@@ -20,6 +20,7 @@ import LoadingAnim from '@/app/components/app/chat/loading-anim'
import Citation from '@/app/components/app/chat/citation'
import { EditTitle } from '@/app/components/app/annotation/edit-annotation-modal/edit-item'
import type { Emoji } from '@/app/components/tools/types'
import type { AppData } from '@/models/share'
type AnswerProps = {
item: ChatItem
@@ -32,6 +33,7 @@ type AnswerProps = {
showPromptLog?: boolean
chatAnswerContainerInner?: string
hideProcessDetail?: boolean
appData?: AppData
}
const Answer: FC<AnswerProps> = ({
item,
@@ -44,6 +46,7 @@ const Answer: FC<AnswerProps> = ({
showPromptLog,
chatAnswerContainerInner,
hideProcessDetail,
appData,
}) => {
const { t } = useTranslation()
const {
@@ -129,8 +132,20 @@ const Answer: FC<AnswerProps> = ({
/>
)
}
{/** Render the normal steps */}
{
workflowProcess && (
workflowProcess && !hideProcessDetail && (
<WorkflowProcess
data={workflowProcess}
item={item}
hideInfo
hideProcessDetail={hideProcessDetail}
/>
)
}
{/** Hide workflow steps by it's settings in siteInfo */}
{
workflowProcess && hideProcessDetail && appData && appData.site.show_workflow_steps && (
<WorkflowProcess
data={workflowProcess}
item={item}