From 77deaf390b23cf147845c3f73ae877c97e243e68 Mon Sep 17 00:00:00 2001 From: balibabu Date: Fri, 18 Jul 2025 19:26:24 +0800 Subject: [PATCH] Feat: Adjust the style of the agent canvas connection line #3221 (#8922) ### What problem does this PR solve? Feat: Adjust the style of the agent canvas connection line #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- web/src/pages/agent/canvas/edge/index.less | 31 ------------------- web/src/pages/agent/canvas/edge/index.tsx | 10 +++--- web/src/pages/agent/canvas/index.tsx | 4 +-- .../pages/agent/canvas/node/agent-node.tsx | 2 +- .../pages/agent/canvas/node/begin-node.tsx | 4 +-- .../agent/canvas/node/categorize-node.tsx | 2 +- web/src/pages/agent/canvas/node/index.tsx | 2 +- .../agent/canvas/node/iteration-node.tsx | 3 +- .../pages/agent/canvas/node/logic-node.tsx | 2 +- .../pages/agent/canvas/node/message-node.tsx | 2 +- .../pages/agent/canvas/node/node-wrapper.tsx | 10 +++--- .../agent/canvas/node/note-node/index.tsx | 7 +++-- .../agent/canvas/node/retrieval-node.tsx | 2 +- .../pages/agent/canvas/node/switch-node.tsx | 2 +- web/src/pages/agent/canvas/node/tool-node.tsx | 8 +++-- web/src/pages/agent/debug-content/index.tsx | 11 +------ .../form-sheet/single-debug-sheet/index.tsx | 19 +++++++++--- 17 files changed, 48 insertions(+), 73 deletions(-) delete mode 100644 web/src/pages/agent/canvas/edge/index.less diff --git a/web/src/pages/agent/canvas/edge/index.less b/web/src/pages/agent/canvas/edge/index.less deleted file mode 100644 index 281b67251..000000000 --- a/web/src/pages/agent/canvas/edge/index.less +++ /dev/null @@ -1,31 +0,0 @@ -.edgeButton { - width: 14px; - height: 14px; - background: #eee; - border: 1px solid #fff; - padding: 0; - cursor: pointer; - border-radius: 50%; - font-size: 10px; - line-height: 1; -} - -.edgeButton:hover { - box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.08); -} - -.edgeButtonDark { - width: 14px; - height: 14px; - background: #0e0c0c; - border: 1px solid #fff; - padding: 0; - cursor: pointer; - border-radius: 50%; - font-size: 10px; - line-height: 1; -} - -.edgeButtonDark:hover { - box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.08); -} diff --git a/web/src/pages/agent/canvas/edge/index.tsx b/web/src/pages/agent/canvas/edge/index.tsx index aa6e8f94d..6358fdc9d 100644 --- a/web/src/pages/agent/canvas/edge/index.tsx +++ b/web/src/pages/agent/canvas/edge/index.tsx @@ -7,12 +7,10 @@ import { } from '@xyflow/react'; import useGraphStore from '../../store'; -import { useTheme } from '@/components/theme-provider'; import { useFetchAgent } from '@/hooks/use-agent-request'; import { cn } from '@/lib/utils'; import { useMemo } from 'react'; import { NodeHandleId, Operator } from '../../constant'; -import styles from './index.less'; export function ButtonEdge({ id, @@ -39,9 +37,8 @@ export function ButtonEdge({ targetY, targetPosition, }); - const { theme } = useTheme(); const selectedStyle = useMemo(() => { - return selected ? { strokeWidth: 2, stroke: '#1677ff' } : {}; + return selected ? { strokeWidth: 1, stroke: 'rgba(76, 164, 231, 1)' } : {}; }, [selected]); const onEdgeClick = () => { @@ -71,7 +68,7 @@ export function ButtonEdge({ // The set of elements following source const slicedGraphPath = graphPath.slice(idx + 1); if (slicedGraphPath.some((x) => x === target)) { - return { strokeWidth: 2, stroke: 'red' }; + return { strokeWidth: 1, stroke: 'red' }; } } return {}; @@ -91,6 +88,7 @@ export function ButtonEdge({ path={edgePath} markerEnd={markerEnd} style={{ ...style, ...selectedStyle, ...highlightStyle }} + className="text-text-sub-title" /> @@ -108,7 +106,7 @@ export function ButtonEdge({ >