Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix/single run panel show parent scrollbar (#5574)

AIxGEEK7c9e88dfb31e
diff --git a/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts b/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts
index ec2ce217b11..a3ffcbcc1f2 100644
--- a/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts
+++ b/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts
@@ -12,6 +12,7 @@ import { getNodeInfoById, isSystemVar, toNodeOutputVars } from '@/app/components
import type { CommonNodeType, InputVar, ValueSelector, Var, Variable } from '@/app/components/workflow/types'
import { BlockEnum, InputVarType, NodeRunningStatus, VarType } from '@/app/components/workflow/types'
import { useStore as useAppStore } from '@/app/components/app/store'
+import { useWorkflowStore } from '@/app/components/workflow/store'
import { getIterationSingleNodeRunUrl, singleNodeRun } from '@/service/workflow'
import Toast from '@/app/components/base/toast'
import LLMDefault from '@/app/components/workflow/nodes/llm/default'
@@ -164,6 +165,12 @@ const useOneStepRun = <T>({
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [data._isSingleRun])
+
+ const workflowStore = useWorkflowStore()
+ useEffect(() => {
+ workflowStore.getState().setShowSingleRunPanel(!!isShowSingleRun)
+ }, [isShowSingleRun])
+
const hideSingleRun = () => {
handleNodeDataUpdate({
id,
diff --git a/web/app/components/workflow/nodes/_base/panel.tsx b/web/app/components/workflow/nodes/_base/panel.tsx
index 05b65ee518b..1750ce1a1bf 100644
--- a/web/app/components/workflow/nodes/_base/panel.tsx
+++ b/web/app/components/workflow/nodes/_base/panel.tsx
@@ -36,6 +36,7 @@ import { canRunBySingle } from '@/app/components/workflow/utils'
import TooltipPlus from '@/app/components/base/tooltip-plus'
import type { Node } from '@/app/components/workflow/types'
import { useStore as useAppStore } from '@/app/components/app/store'
+import { useStore } from '@/app/components/workflow/store'
type BasePanelProps = {
children: ReactElement
@@ -50,6 +51,7 @@ const BasePanel: FC<BasePanelProps> = ({
const { showMessageLogModal } = useAppStore(useShallow(state => ({
showMessageLogModal: state.showMessageLogModal,
})))
+ const showSingleRunPanel = useStore(s => s.showSingleRunPanel)
const panelWidth = localStorage.getItem('workflow-node-panel-width') ? parseFloat(localStorage.getItem('workflow-node-panel-width')!) : 420
const {
setPanelWidth,
@@ -99,7 +101,7 @@ const BasePanel: FC<BasePanelProps> = ({
</div>
<div
ref={containerRef}
- className='relative h-full bg-white shadow-lg border-[0.5px] border-gray-200 rounded-2xl overflow-y-auto'
+ className={cn('relative h-full bg-white shadow-lg border-[0.5px] border-gray-200 rounded-2xl', showSingleRunPanel ? 'overflow-hidden' : 'overflow-y-auto')}
style={{
width: `${panelWidth}px`,
}}
diff --git a/web/app/components/workflow/store.ts b/web/app/components/workflow/store.ts
index 2bf6de5b591..203aa828383 100644
--- a/web/app/components/workflow/store.ts
+++ b/web/app/components/workflow/store.ts
@@ -28,6 +28,8 @@ type PreviewRunningData = WorkflowRunningData & {
type Shape = {
appId: string
panelWidth: number
+ showSingleRunPanel: boolean
+ setShowSingleRunPanel: (showSingleRunPanel: boolean) => void
workflowRunningData?: PreviewRunningData
setWorkflowRunningData: (workflowData: PreviewRunningData) => void
historyWorkflowData?: HistoryWorkflowData
@@ -137,6 +139,8 @@ export const createWorkflowStore = () => {
return createStore<Shape>(set => ({
appId: '',
panelWidth: localStorage.getItem('workflow-node-panel-width') ? parseFloat(localStorage.getItem('workflow-node-panel-width')!) : 420,
+ showSingleRunPanel: false,
+ setShowSingleRunPanel: showSingleRunPanel => set(() => ({ showSingleRunPanel })),
workflowRunningData: undefined,
setWorkflowRunningData: workflowRunningData => set(() => ({ workflowRunningData })),
historyWorkflowData: undefined,