diff --git a/web/app/components/workflow/panel/chat-record.tsx b/web/app/components/workflow/panel/chat-record.tsx new file mode 100644 index 0000000000..8776572a16 --- /dev/null +++ b/web/app/components/workflow/panel/chat-record.tsx @@ -0,0 +1,20 @@ +import { memo } from 'react' +import UserInput from './debug-and-preview/user-input' +import Chat from '@/app/components/base/chat/chat' + +const ChatRecord = () => { + return ( + } + allToolIcons={{}} + /> + ) +} + +export default memo(ChatRecord) diff --git a/web/app/components/workflow/panel/debug-and-preview/index.tsx b/web/app/components/workflow/panel/debug-and-preview/index.tsx index df6abcdb77..ff055a59e7 100644 --- a/web/app/components/workflow/panel/debug-and-preview/index.tsx +++ b/web/app/components/workflow/panel/debug-and-preview/index.tsx @@ -3,7 +3,6 @@ import { useRef, } from 'react' import { useTranslation } from 'react-i18next' -import { useStore } from '../../store' import ChatWrapper from './chat-wrapper' import Button from '@/app/components/base/button' import { RefreshCcw01 } from '@/app/components/base/icons/src/vender/line/arrows' @@ -14,16 +13,14 @@ export type ChatWrapperRefType = { const DebugAndPreview = () => { const { t } = useTranslation() const chatRef = useRef({ handleRestart: () => {} }) - const showRunHistory = useStore(s => s.showRunHistory) return (
diff --git a/web/app/components/workflow/panel/index.tsx b/web/app/components/workflow/panel/index.tsx index f5d508e6d5..94d20ba577 100644 --- a/web/app/components/workflow/panel/index.tsx +++ b/web/app/components/workflow/panel/index.tsx @@ -30,9 +30,9 @@ const Panel: FC = () => { return { showWorkflowInfoPanel: !isChatMode && !selectedNode && !runningStatus, showNodePanel: !!selectedNode && !runningStatus, - showDebugAndPreviewPanel: isChatMode && runningStatus, + showDebugAndPreviewPanel: isChatMode && runningStatus && !showRunHistory, } - }, [selectedNode, isChatMode, runningStatus]) + }, [selectedNode, isChatMode, runningStatus, showRunHistory]) return (
{ ) } + { + runningStatus && isChatMode && showRunHistory && ( + + ) + } { showNodePanel && ( diff --git a/web/app/components/workflow/panel/record.tsx b/web/app/components/workflow/panel/record.tsx index 0f5e3855f1..22f1482a4c 100644 --- a/web/app/components/workflow/panel/record.tsx +++ b/web/app/components/workflow/panel/record.tsx @@ -1,17 +1,27 @@ import { memo } from 'react' +import { useIsChatMode } from '../hooks' import Run from '../run' import { useStore } from '../store' +import ChatRecord from './chat-record' const Record = () => { + const isChatMode = useIsChatMode() const currentSequenceNumber = useStore(s => s.currentSequenceNumber) const workflowRunId = useStore(s => s.workflowRunId) return ( -
+
{`Test Run#${currentSequenceNumber}`}
- + { + isChatMode + ? + : + }
) }