Chore/variable label (#23270)

This commit is contained in:
zxhlyh
2025-08-01 15:43:36 +08:00
committed by GitHub
parent fd086b06a6
commit f78b903a49
30 changed files with 595 additions and 483 deletions

View File

@@ -11,16 +11,12 @@ import {
import ActionButton from '@/app/components/base/action-button'
import Tooltip from '@/app/components/base/tooltip'
import BlockIcon from '@/app/components/workflow/block-icon'
import {
BubbleX,
Env,
} from '@/app/components/base/icons/src/vender/line/others'
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
import type { currentVarType } from './panel'
import { VarInInspectType } from '@/types/workflow'
import type { NodeWithVar, VarInInspect } from '@/types/workflow'
import cn from '@/utils/classnames'
import { useToolIcon } from '../hooks'
import { VariableIconWithColor } from '@/app/components/workflow/nodes/_base/components/variable/variable-label'
type Props = {
nodeData?: NodeWithVar
@@ -158,9 +154,11 @@ const Group = ({
)}
onClick={() => handleSelectVar(varItem, varType)}
>
{isEnv && <Env className='h-4 w-4 shrink-0 text-util-colors-violet-violet-600' />}
{isChatVar && <BubbleX className='h-4 w-4 shrink-0 text-util-colors-teal-teal-700' />}
{(isSystem || nodeData) && <Variable02 className={cn('h-4 w-4 shrink-0 text-text-accent', ['error_type', 'error_message'].includes(varItem.name) && 'text-text-warning')} />}
<VariableIconWithColor
variableCategory={varType}
isExceptionVariable={['error_type', 'error_message'].includes(varItem.name)}
className='size-4'
/>
<div className='system-sm-medium grow truncate text-text-secondary'>{varItem.name}</div>
<div className='system-xs-regular shrink-0 text-text-tertiary'>{varItem.value_type}</div>
</div>

View File

@@ -14,12 +14,11 @@ import Badge from '@/app/components/base/badge'
import CopyFeedback from '@/app/components/base/copy-feedback'
import Tooltip from '@/app/components/base/tooltip'
import BlockIcon from '@/app/components/workflow/block-icon'
import { BubbleX, Env } from '@/app/components/base/icons/src/vender/line/others'
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
import Loading from '@/app/components/base/loading'
import type { currentVarType } from './panel'
import { VarInInspectType } from '@/types/workflow'
import cn from '@/utils/classnames'
import { VariableIconWithColor } from '@/app/components/workflow/nodes/_base/components/variable/variable-label'
type Props = {
currentNodeVar?: currentVarType
@@ -86,15 +85,14 @@ const Right = ({
<div className='flex w-0 grow items-center gap-1'>
{currentNodeVar && (
<>
{currentNodeVar.nodeType === VarInInspectType.environment && (
<Env className='h-4 w-4 shrink-0 text-util-colors-violet-violet-600' />
)}
{currentNodeVar.nodeType === VarInInspectType.conversation && (
<BubbleX className='h-4 w-4 shrink-0 text-util-colors-teal-teal-700' />
)}
{currentNodeVar.nodeType === VarInInspectType.system && (
<Variable02 className='h-4 w-4 shrink-0 text-text-accent' />
)}
{
[VarInInspectType.environment, VarInInspectType.conversation, VarInInspectType.system].includes(currentNodeVar.nodeType as VarInInspectType) && (
<VariableIconWithColor
variableCategory={currentNodeVar.nodeType as VarInInspectType}
className='size-4'
/>
)
}
{currentNodeVar.nodeType !== VarInInspectType.environment && currentNodeVar.nodeType !== VarInInspectType.conversation && currentNodeVar.nodeType !== VarInInspectType.system && (
<>
<BlockIcon