pref: reduce next step components reRender (#28783)

This commit is contained in:
Joel 2025-11-27 17:12:00 +08:00 committed by GitHub
parent 1f72571c06
commit 5f2e0d6347
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -365,6 +365,10 @@ const BasePanel: FC<BasePanelProps> = ({
return !pluginDetail ? null : <ReadmeEntrance pluginDetail={pluginDetail as any} className='mt-auto' />
}, [data.type, currToolCollection, currentDataSource, currentTriggerPlugin])
const selectedNode = useMemo(() => ({
id,
data,
}) as Node, [id, data])
if (logParams.showSpecialResultPanel) {
return (
<div className={cn(
@ -628,7 +632,7 @@ const BasePanel: FC<BasePanelProps> = ({
<div className='system-xs-regular mb-2 text-text-tertiary'>
{t('workflow.panel.addNextStep')}
</div>
<NextStep selectedNode={{ id, data } as Node} />
<NextStep selectedNode={selectedNode} />
</div>
)
}