This commit is contained in:
StyleZhang
2024-03-16 15:00:30 +08:00
parent 5ee7fc4fde
commit 05f97f6e06
20 changed files with 78 additions and 43 deletions

View File

@ -10,7 +10,7 @@ import { useChat } from './hooks'
import Chat from '@/app/components/base/chat/chat'
import type { OnSend } from '@/app/components/base/chat/types'
import { useFeaturesStore } from '@/app/components/base/features/hooks'
import { fetchConvesationMessages } from '@/service/debug'
import { fetchSuggestedQuestions } from '@/service/debug'
import { useStore as useAppStore } from '@/app/components/app/store'
const ChatWrapper = () => {
@ -49,10 +49,10 @@ const ChatWrapper = () => {
query,
files,
inputs: workflowStore.getState().inputs,
conversationId,
conversation_id: conversationId,
},
{
onGetSuggestedQuestions: (conversationId, getAbortController) => fetchConvesationMessages(appId, conversationId, getAbortController),
onGetSuggestedQuestions: (messageId, getAbortController) => fetchSuggestedQuestions(appId, messageId, getAbortController),
},
)
}

View File

@ -1,9 +1,9 @@
import type { FC } from 'react'
import { memo } from 'react'
import { useTranslation } from 'react-i18next'
import { useStore } from '../../store'
import ChatWrapper from './chat-wrapper'
const DebugAndPreview: FC = () => {
const DebugAndPreview = () => {
const { t } = useTranslation()
const showRunHistory = useStore(s => s.showRunHistory)
@ -28,4 +28,4 @@ const DebugAndPreview: FC = () => {
)
}
export default DebugAndPreview
export default memo(DebugAndPreview)

View File

@ -29,6 +29,9 @@ const UserInput = () => {
})
}
if (!variables.length)
return null
return (
<div
className={`

View File

@ -3,7 +3,9 @@ import Run from '../run'
import { useStore } from '../store'
const Record = () => {
const { currentSequenceNumber, workflowRunId } = useStore()
const currentSequenceNumber = useStore(s => s.currentSequenceNumber)
const workflowRunId = useStore(s => s.workflowRunId)
return (
<div className='flex flex-col w-[400px] h-full rounded-2xl border-[0.5px] border-gray-200 shadow-xl bg-white'>
<div className='flex items-center justify-between p-4 pb-1 text-base font-semibold text-gray-900'>