fix: Fix the display of state icon of base node (#32208)

This commit is contained in:
Wu Tianwei 2026-02-10 22:45:56 +08:00 committed by GitHub
parent 83f64104fd
commit 16b8733886
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 25 deletions

View File

@ -4,13 +4,6 @@ import type {
} from 'react'
import type { IterationNodeType } from '@/app/components/workflow/nodes/iteration/types'
import type { NodeProps } from '@/app/components/workflow/types'
import {
RiAlertFill,
RiCheckboxCircleFill,
RiErrorWarningFill,
RiLoader2Line,
RiPauseCircleFill,
} from '@remixicon/react'
import {
cloneElement,
memo,
@ -109,7 +102,7 @@ const BaseNode: FC<BaseNodeProps> = ({
} = useMemo(() => {
return {
showRunningBorder: (data._runningStatus === NodeRunningStatus.Running || data._runningStatus === NodeRunningStatus.Paused) && !showSelectedBorder,
showSuccessBorder: (data._runningStatus === NodeRunningStatus.Succeeded || hasVarValue) && !showSelectedBorder,
showSuccessBorder: (data._runningStatus === NodeRunningStatus.Succeeded || (hasVarValue && !data._runningStatus)) && !showSelectedBorder,
showFailedBorder: data._runningStatus === NodeRunningStatus.Failed && !showSelectedBorder,
showExceptionBorder: data._runningStatus === NodeRunningStatus.Exception && !showSelectedBorder,
}
@ -127,7 +120,7 @@ const BaseNode: FC<BaseNodeProps> = ({
return (
<div
className={cn(
'system-xs-medium mr-2 text-text-tertiary',
'mr-2 text-text-tertiary system-xs-medium',
data._runningStatus === NodeRunningStatus.Running && 'text-text-accent',
)}
>
@ -167,7 +160,7 @@ const BaseNode: FC<BaseNodeProps> = ({
{
data.type === BlockEnum.DataSource && (
<div className="absolute inset-[-2px] top-[-22px] z-[-1] rounded-[18px] bg-node-data-source-bg p-0.5 backdrop-blur-[6px]">
<div className="system-2xs-semibold-uppercase flex h-5 items-center px-2.5 text-text-tertiary">
<div className="flex h-5 items-center px-2.5 text-text-tertiary system-2xs-semibold-uppercase">
{t('blocks.datasource', { ns: 'workflow' })}
</div>
</div>
@ -252,7 +245,7 @@ const BaseNode: FC<BaseNodeProps> = ({
/>
<div
title={data.title}
className="system-sm-semibold-uppercase mr-1 flex grow items-center truncate text-text-primary"
className="mr-1 flex grow items-center truncate text-text-primary system-sm-semibold-uppercase"
>
<div>
{data.title}
@ -268,7 +261,7 @@ const BaseNode: FC<BaseNodeProps> = ({
</div>
)}
>
<div className="system-2xs-medium-uppercase ml-1 flex items-center justify-center rounded-[5px] border-[1px] border-text-warning px-[5px] py-[3px] text-text-warning ">
<div className="ml-1 flex items-center justify-center rounded-[5px] border-[1px] border-text-warning px-[5px] py-[3px] text-text-warning system-2xs-medium-uppercase">
{t('nodes.iteration.parallelModeUpper', { ns: 'workflow' })}
</div>
</Tooltip>
@ -288,26 +281,26 @@ const BaseNode: FC<BaseNodeProps> = ({
!!(data.type === BlockEnum.Loop && data._loopIndex) && LoopIndex
}
{
isLoading && <RiLoader2Line className="h-3.5 w-3.5 animate-spin text-text-accent" />
isLoading && <span className="i-ri-loader-2-line h-3.5 w-3.5 animate-spin text-text-accent" />
}
{
!isLoading && data._runningStatus === NodeRunningStatus.Failed && (
<RiErrorWarningFill className="h-3.5 w-3.5 text-text-destructive" />
<span className="i-ri-error-warning-fill h-3.5 w-3.5 text-text-destructive" />
)
}
{
!isLoading && data._runningStatus === NodeRunningStatus.Exception && (
<RiAlertFill className="h-3.5 w-3.5 text-text-warning-secondary" />
<span className="i-ri-alert-fill h-3.5 w-3.5 text-text-warning-secondary" />
)
}
{
!isLoading && (data._runningStatus === NodeRunningStatus.Succeeded || hasVarValue) && (
<RiCheckboxCircleFill className="h-3.5 w-3.5 text-text-success" />
!isLoading && (data._runningStatus === NodeRunningStatus.Succeeded || (hasVarValue && !data._runningStatus)) && (
<span className="i-ri-checkbox-circle-fill h-3.5 w-3.5 text-text-success" />
)
}
{
!isLoading && data._runningStatus === NodeRunningStatus.Paused && (
<RiPauseCircleFill className="h-3.5 w-3.5 text-text-warning-secondary" />
<span className="i-ri-pause-circle-fill h-3.5 w-3.5 text-text-warning-secondary" />
)
}
</div>
@ -341,7 +334,7 @@ const BaseNode: FC<BaseNodeProps> = ({
}
{
!!(data.desc && data.type !== BlockEnum.Iteration && data.type !== BlockEnum.Loop) && (
<div className="system-xs-regular whitespace-pre-line break-words px-3 pb-2 pt-1 text-text-tertiary">
<div className="whitespace-pre-line break-words px-3 pb-2 pt-1 text-text-tertiary system-xs-regular">
{data.desc}
</div>
)

View File

@ -6800,12 +6800,6 @@
}
},
"app/components/workflow/nodes/_base/node.tsx": {
"tailwindcss/enforce-consistent-class-order": {
"count": 5
},
"tailwindcss/no-unnecessary-whitespace": {
"count": 1
},
"ts/no-explicit-any": {
"count": 3
}