mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 20:17:29 +08:00
fix: Fix node panel positioning issue when chat log modal is open
This commit is contained in:
parent
3b70f8ac08
commit
9dbb06fccc
@ -120,6 +120,7 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||||||
return
|
return
|
||||||
if (workflowCanvasWidth - 400 <= nodePanelWidth + otherPanelWidth)
|
if (workflowCanvasWidth - 400 <= nodePanelWidth + otherPanelWidth)
|
||||||
debounceUpdate(workflowCanvasWidth - 400 - otherPanelWidth)
|
debounceUpdate(workflowCanvasWidth - 400 - otherPanelWidth)
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [nodePanelWidth, otherPanelWidth, workflowCanvasWidth, updateNodePanelWidth])
|
}, [nodePanelWidth, otherPanelWidth, workflowCanvasWidth, updateNodePanelWidth])
|
||||||
|
|
||||||
const { handleNodeSelect } = useNodesInteractions()
|
const { handleNodeSelect } = useNodesInteractions()
|
||||||
@ -151,11 +152,11 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||||||
const [isPaused, setIsPaused] = useState(false)
|
const [isPaused, setIsPaused] = useState(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(data._singleRunningStatus === NodeRunningStatus.Running) {
|
if (data._singleRunningStatus === NodeRunningStatus.Running) {
|
||||||
hasClickRunning.current = true
|
hasClickRunning.current = true
|
||||||
setIsPaused(false)
|
setIsPaused(false)
|
||||||
}
|
}
|
||||||
else if(data._isSingleRun && data._singleRunningStatus === undefined && hasClickRunning) {
|
else if (data._isSingleRun && data._singleRunningStatus === undefined && hasClickRunning) {
|
||||||
setIsPaused(true)
|
setIsPaused(true)
|
||||||
hasClickRunning.current = false
|
hasClickRunning.current = false
|
||||||
}
|
}
|
||||||
@ -216,9 +217,9 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||||||
return {}
|
return {}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
if(logParams.showSpecialResultPanel) {
|
if (logParams.showSpecialResultPanel) {
|
||||||
return (
|
return (
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
'relative mr-1 h-full',
|
'relative mr-1 h-full',
|
||||||
)}>
|
)}>
|
||||||
<div
|
<div
|
||||||
@ -269,10 +270,15 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn(
|
<div
|
||||||
'relative mr-1 h-full',
|
className={cn(
|
||||||
showMessageLogModal && '!absolute -top-[5px] right-[416px] z-0 !mr-0 w-[384px] overflow-hidden rounded-2xl border-[0.5px] border-components-panel-border shadow-lg transition-all',
|
'relative mr-1 h-full',
|
||||||
)}>
|
showMessageLogModal && 'absolute z-0 mr-2 w-[400px] overflow-hidden rounded-2xl border-[0.5px] border-components-panel-border shadow-lg transition-all',
|
||||||
|
)}
|
||||||
|
style={{
|
||||||
|
right: !showMessageLogModal ? '0' : `${otherPanelWidth}px`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
ref={triggerRef}
|
ref={triggerRef}
|
||||||
className='absolute -left-1 top-0 flex h-full w-1 cursor-col-resize resize-x items-center justify-center'>
|
className='absolute -left-1 top-0 flex h-full w-1 cursor-col-resize resize-x items-center justify-center'>
|
||||||
@ -280,7 +286,7 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
className={cn('flex h-full flex-col rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg', showSingleRunPanel ? 'overflow-hidden' : 'overflow-y-auto')}
|
className={cn('flex h-full flex-col rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg transition-[width] ease-linear', showSingleRunPanel ? 'overflow-hidden' : 'overflow-y-auto')}
|
||||||
style={{
|
style={{
|
||||||
width: `${nodePanelWidth}px`,
|
width: `${nodePanelWidth}px`,
|
||||||
}}
|
}}
|
||||||
@ -308,7 +314,7 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||||||
<div
|
<div
|
||||||
className='mr-1 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md hover:bg-state-base-hover'
|
className='mr-1 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md hover:bg-state-base-hover'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if(isSingleRunning) {
|
if (isSingleRunning) {
|
||||||
handleNodeDataUpdate({
|
handleNodeDataUpdate({
|
||||||
id,
|
id,
|
||||||
data: {
|
data: {
|
||||||
@ -324,7 +330,7 @@ const BasePanel: FC<BasePanelProps> = ({
|
|||||||
>
|
>
|
||||||
{
|
{
|
||||||
isSingleRunning ? <Stop className='h-4 w-4 text-text-tertiary' />
|
isSingleRunning ? <Stop className='h-4 w-4 text-text-tertiary' />
|
||||||
: <RiPlayLargeLine className='h-4 w-4 text-text-tertiary' />
|
: <RiPlayLargeLine className='h-4 w-4 text-text-tertiary' />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user