From 31cba28e8a96b12898751f91f58176fd57bbec4d Mon Sep 17 00:00:00 2001 From: hjlarry Date: Tue, 23 Sep 2025 15:28:22 +0800 Subject: [PATCH] improve comment cursor icon --- .../icons/assets/public/other/comment.svg | 3 +++ .../base/icons/src/public/other/Comment.json | 26 +++++++++++++++++++ .../base/icons/src/public/other/Comment.tsx | 20 ++++++++++++++ .../base/icons/src/public/other/index.ts | 1 + .../components/workflow/comment/cursor.tsx | 6 ++--- .../components/workflow/operator/control.tsx | 4 +-- 6 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 web/app/components/base/icons/assets/public/other/comment.svg create mode 100644 web/app/components/base/icons/src/public/other/Comment.json create mode 100644 web/app/components/base/icons/src/public/other/Comment.tsx diff --git a/web/app/components/base/icons/assets/public/other/comment.svg b/web/app/components/base/icons/assets/public/other/comment.svg new file mode 100644 index 0000000000..7f48f22fbd --- /dev/null +++ b/web/app/components/base/icons/assets/public/other/comment.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/other/Comment.json b/web/app/components/base/icons/src/public/other/Comment.json new file mode 100644 index 0000000000..c4865a010c --- /dev/null +++ b/web/app/components/base/icons/src/public/other/Comment.json @@ -0,0 +1,26 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "xmlns": "http://www.w3.org/2000/svg", + "width": "14", + "height": "12", + "viewBox": "0 0 14 12", + "fill": "none" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "d": "M12.3334 4C12.3334 2.52725 11.1395 1.33333 9.66671 1.33333H4.33337C2.86062 1.33333 1.66671 2.52724 1.66671 4V10.6667H9.66671C11.1395 10.6667 12.3334 9.47274 12.3334 8V4ZM7.66671 6.66667V8H4.33337V6.66667H7.66671ZM9.66671 4V5.33333H4.33337V4H9.66671ZM13.6667 8C13.6667 10.2091 11.8758 12 9.66671 12H0.333374V4C0.333374 1.79086 2.12424 0 4.33337 0H9.66671C11.8758 0 13.6667 1.79086 13.6667 4V8Z", + "fill": "currentColor" + }, + "children": [] + } + ] + }, + "name": "Comment" +} diff --git a/web/app/components/base/icons/src/public/other/Comment.tsx b/web/app/components/base/icons/src/public/other/Comment.tsx new file mode 100644 index 0000000000..85c2559b76 --- /dev/null +++ b/web/app/components/base/icons/src/public/other/Comment.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './Comment.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconData } from '@/app/components/base/icons/IconBase' + +const Icon = ( + { + ref, + ...props + }: React.SVGProps & { + ref?: React.RefObject>; + }, +) => + +Icon.displayName = 'Comment' + +export default Icon diff --git a/web/app/components/base/icons/src/public/other/index.ts b/web/app/components/base/icons/src/public/other/index.ts index a7558ca0ab..3637525202 100644 --- a/web/app/components/base/icons/src/public/other/index.ts +++ b/web/app/components/base/icons/src/public/other/index.ts @@ -1,4 +1,5 @@ export { default as Icon3Dots } from './Icon3Dots' +export { default as Comment } from './Comment' export { default as DefaultToolIcon } from './DefaultToolIcon' export { default as Message3Fill } from './Message3Fill' export { default as RowStruct } from './RowStruct' diff --git a/web/app/components/workflow/comment/cursor.tsx b/web/app/components/workflow/comment/cursor.tsx index dbd430b019..194f1a72e6 100644 --- a/web/app/components/workflow/comment/cursor.tsx +++ b/web/app/components/workflow/comment/cursor.tsx @@ -2,6 +2,7 @@ import type { FC } from 'react' import { memo } from 'react' import { useStore } from '../store' import { ControlMode } from '../types' +import { Comment } from '@/app/components/base/icons/src/public/other' type CommentCursorProps = { mousePosition: { elementX: number; elementY: number } @@ -22,10 +23,7 @@ export const CommentCursor: FC = memo(({ mousePosition }) => transform: 'translate(-50%, -50%)', }} > - - - - + ) }) diff --git a/web/app/components/workflow/operator/control.tsx b/web/app/components/workflow/operator/control.tsx index 344c09d20b..5cb1a72fcc 100644 --- a/web/app/components/workflow/operator/control.tsx +++ b/web/app/components/workflow/operator/control.tsx @@ -9,9 +9,9 @@ import { RiCursorLine, RiFunctionAddLine, RiHand, - RiMessage3Line, RiStickyNoteAddLine, } from '@remixicon/react' +import { Comment } from '@/app/components/base/icons/src/public/other' import { useNodesReadOnly, useWorkflowCanvasMaximize, @@ -106,7 +106,7 @@ const Control = () => { )} onClick={addComment} > - +