@@ -41,20 +41,20 @@ interface AgentCallRelationshipModalProps {
4141const NODE_W = 140 ;
4242const NODE_H = 60 ;
4343
44- /* ================== 新增/调整:统一尺寸与紧凑布局(最小改动) ================== */
45- const AGENT_W = 160 ; // Agent 统一宽
46- const AGENT_H = 56 ; // Agent 统一高
47- const TOOL_SIZE = 86 ; // Tool 齿轮统一直径
48- const TOOL_TEETH = 10 ; // 齿数(更圆润)
49- const TOOL_TEETH_DEPTH_RATIO = 0.085 ; // 齿深比例
44+ /* ================== New/Adjusted: Unified dimensions and compact layout (minimal changes) ================== */
45+ const AGENT_W = 160 ; // Agent unified width
46+ const AGENT_H = 56 ; // Agent unified height
47+ const TOOL_SIZE = 86 ; // Tool gear unified diameter
48+ const TOOL_TEETH = 10 ; // Number of teeth (more rounded)
49+ const TOOL_TEETH_DEPTH_RATIO = 0.085 ; // Teeth depth ratio
5050
51- const MAX_TOOL_NAME_CHARS = 10 ; // 工具名最大展示字符数
51+ const MAX_TOOL_NAME_CHARS = 10 ; // Maximum display characters for tool names
5252
53- const TREE_DEPTH_FACTOR = 120 ; // 更紧凑的层距
53+ const TREE_DEPTH_FACTOR = 120 ; // More compact layer spacing
5454const TREE_SEP_SIB = 1.15 ;
5555const TREE_SEP_NON = 1.35 ;
5656
57- /* 简单且稳定的 code point 截断(兼容 emoji 基本场景) */
57+ /* Simple and stable code point truncation (compatible with basic emoji scenarios) */
5858function truncateByCodePoints ( s : string , max : number ) {
5959 const arr = Array . from ( s ) ;
6060 return arr . length > max ? arr . slice ( 0 , max ) . join ( '' ) + '…' : s ;
@@ -103,17 +103,17 @@ const CustomNode = ({ nodeDatum }: any) => {
103103 const color = getNodeColor ( nodeDatum . type , nodeDatum . depth ) ;
104104 const icon = isAgent ? < RobotOutlined /> : < ToolOutlined /> ;
105105
106- // 工具名按最大字符数截断(避免过长)
106+ // Truncate tool names by maximum character count (avoid too long)
107107 const rawName : string = nodeDatum . name || '' ;
108108 const displayName : string = ! isAgent
109109 ? truncateByCodePoints ( rawName , MAX_TOOL_NAME_CHARS )
110110 : rawName ;
111111
112- // 统一字体
112+ // Unified font
113113 const fontSize = isAgent ? '14px' : '12px' ;
114114 const fontWeight = isAgent ? '600' : '500' ;
115115
116- // —— 尺寸统一: Agent 矩形、 Tool 齿轮固定大小 ——
116+ // —— Unified dimensions: Agent rectangles, Tool gears fixed size ——
117117 const nodeWidth = isAgent ? AGENT_W : TOOL_SIZE ;
118118 const nodeHeight = isAgent ? AGENT_H : TOOL_SIZE ;
119119
@@ -137,15 +137,15 @@ const CustomNode = ({ nodeDatum }: any) => {
137137 />
138138 ) ;
139139 } else {
140- // Tool nodes use gear shape (仅外轮廓),统一尺寸
140+ // Tool nodes use gear shape (outer contour only), unified size
141141 const cx = nodeWidth / 2 ;
142142 const cy = nodeHeight / 2 ;
143143 const outerRadius = nodeWidth / 2 - 2 ;
144144 const teethDepth = Math . max ( outerRadius * TOOL_TEETH_DEPTH_RATIO , 3.5 ) ;
145145
146146 const d : string [ ] = [ ] ;
147147 for ( let i = 0 ; i < TOOL_TEETH * 2 ; i ++ ) {
148- const angle = ( i * Math . PI ) / TOOL_TEETH ; // 每半齿
148+ const angle = ( i * Math . PI ) / TOOL_TEETH ; // Each half tooth
149149 const r = i % 2 === 0 ? outerRadius : outerRadius - teethDepth ;
150150 const x = cx + r * Math . cos ( angle ) ;
151151 const y = cy + r * Math . sin ( angle ) ;
@@ -297,11 +297,11 @@ export default function AgentCallRelationshipModal({
297297 if ( result . success ) {
298298 setRelationshipData ( result . data )
299299 } else {
300- message . error ( result . message || '获取调用关系失败 ' )
300+ message . error ( result . message || 'Failed to fetch call relationship ' )
301301 }
302302 } catch ( error ) {
303- console . error ( '获取Agent调用关系失败 :' , error )
304- message . error ( '获取Agent调用关系失败,请稍后重试 ' )
303+ console . error ( 'Failed to fetch Agent call relationship :' , error )
304+ message . error ( 'Failed to fetch Agent call relationship, please try again later ' )
305305 } finally {
306306 setLoading ( false )
307307 }
0 commit comments