diff --git a/web/app/components/rag-pipeline/components/panel/index.tsx b/web/app/components/rag-pipeline/components/panel/index.tsx
index 7b5986a6fe..4bc4976b79 100644
--- a/web/app/components/rag-pipeline/components/panel/index.tsx
+++ b/web/app/components/rag-pipeline/components/panel/index.tsx
@@ -5,10 +5,10 @@ import { useStore } from '@/app/components/workflow/store'
import TestRunPanel from './test-run'
const RagPipelinePanelOnRight = () => {
- const showTestRunPanel = useStore(s => s.showTestRunPanel)
+ const showDebugAndPreviewPanel = useStore(s => s.showDebugAndPreviewPanel)
return (
<>
- {showTestRunPanel && }
+ {showDebugAndPreviewPanel && }
>
)
}
diff --git a/web/app/components/rag-pipeline/components/panel/test-run/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/index.tsx
index f6c95c7a62..d1ec48d6af 100644
--- a/web/app/components/rag-pipeline/components/panel/test-run/index.tsx
+++ b/web/app/components/rag-pipeline/components/panel/test-run/index.tsx
@@ -1,4 +1,4 @@
-import { useStore } from '@/app/components/workflow/store'
+import { useWorkflowStore } from '@/app/components/workflow/store'
import { RiCloseLine } from '@remixicon/react'
import { useCallback, useMemo, useState } from 'react'
import StepIndicator from './step-indicator'
@@ -20,6 +20,7 @@ import Actions from './data-source/actions'
import DocumentProcessing from './document-processing'
const TestRunPanel = () => {
+ const workflowStore = useWorkflowStore()
const [currentStep, setCurrentStep] = useState(2)
const [dataSource, setDataSource] = useState(DataSourceProvider.waterCrawl)
const [fileList, setFiles] = useState([])
@@ -28,7 +29,6 @@ const TestRunPanel = () => {
const [websiteCrawlJobId, setWebsiteCrawlJobId] = useState('')
const [crawlOptions, setCrawlOptions] = useState(DEFAULT_CRAWL_OPTIONS)
- const setShowTestRunPanel = useStore(s => s.setShowTestRunPanel)
const plan = useProviderContextSelector(state => state.plan)
const enableBilling = useProviderContextSelector(state => state.enableBilling)
@@ -60,7 +60,8 @@ const TestRunPanel = () => {
}, [dataSource, nextDisabled, isShowVectorSpaceFull, notionPages.length, websitePages.length])
const handleClose = () => {
- setShowTestRunPanel?.(false)
+ const { setShowDebugAndPreviewPanel } = workflowStore.getState()
+ setShowDebugAndPreviewPanel(false)
}
const handleDataSourceSelect = useCallback((option: string) => {
diff --git a/web/app/components/rag-pipeline/hooks/use-workflow-start-run.tsx b/web/app/components/rag-pipeline/hooks/use-workflow-start-run.tsx
index bf411774b5..37c610cd16 100644
--- a/web/app/components/rag-pipeline/hooks/use-workflow-start-run.tsx
+++ b/web/app/components/rag-pipeline/hooks/use-workflow-start-run.tsx
@@ -31,16 +31,15 @@ export const useWorkflowStartRun = () => {
const startNode = nodes.find(node => node.data.type === BlockEnum.Start)
const startVariables = startNode?.data.variables || []
const {
- showTestRunPanel,
+ showDebugAndPreviewPanel,
setShowInputsPanel,
setShowEnvPanel,
- setShowTestRunPanel,
+ setShowDebugAndPreviewPanel,
} = workflowStore.getState()
setShowEnvPanel(false)
- if (showTestRunPanel) {
- setShowTestRunPanel?.(false)
+ if (showDebugAndPreviewPanel) {
handleCancelDebugAndPreviewPanel()
return
}
@@ -48,11 +47,11 @@ export const useWorkflowStartRun = () => {
if (!startVariables.length) {
await doSyncWorkflowDraft()
handleRun({ inputs: {}, files: [] })
- setShowTestRunPanel?.(true)
+ setShowDebugAndPreviewPanel(true)
setShowInputsPanel(false)
}
else {
- setShowTestRunPanel?.(true)
+ setShowDebugAndPreviewPanel(true)
setShowInputsPanel(true)
}
}, [store, workflowStore, handleCancelDebugAndPreviewPanel, handleRun, doSyncWorkflowDraft])
diff --git a/web/app/components/rag-pipeline/store/index.ts b/web/app/components/rag-pipeline/store/index.ts
index 80c5027d72..f5e4a7eb64 100644
--- a/web/app/components/rag-pipeline/store/index.ts
+++ b/web/app/components/rag-pipeline/store/index.ts
@@ -6,8 +6,6 @@ export type RagPipelineSliceShape = {
setShowInputFieldDialog: (showInputFieldPanel: boolean) => void
nodesDefaultConfigs: Record
setNodesDefaultConfigs: (nodesDefaultConfigs: Record) => void
- showTestRunPanel: boolean
- setShowTestRunPanel: (showTestRunPanel: boolean) => void
}
export type CreateRagPipelineSliceSlice = StateCreator
@@ -17,6 +15,4 @@ export const createRagPipelineSliceSlice: StateCreator =
setShowInputFieldDialog: showInputFieldDialog => set(() => ({ showInputFieldDialog })),
nodesDefaultConfigs: {},
setNodesDefaultConfigs: nodesDefaultConfigs => set(() => ({ nodesDefaultConfigs })),
- showTestRunPanel: false,
- setShowTestRunPanel: showTestRunPanel => set(() => ({ showTestRunPanel })),
})