From b33a97ea5b406af58cd0b0ccff0cbbfb6b8b4fa1 Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Mon, 13 Oct 2025 12:42:41 +0800 Subject: [PATCH] style: update comment thread UI with design specs - Fix edit bubble: keep avatar visible and match ThreadMessage layout - Update edit container: rounded-xl, p-1, shadow-md, backdrop-blur - Add keyboard shortcut icons (Cmd+Enter) to Save button - Fix hover background: full-width with -mx-4 negative margin technique - Apply design tokens consistently across components --- .../workflow/comment/mention-input.tsx | 11 ++++- .../components/workflow/comment/thread.tsx | 42 ++++++++++++------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/web/app/components/workflow/comment/mention-input.tsx b/web/app/components/workflow/comment/mention-input.tsx index 9fb438c516..7f5ca1e924 100644 --- a/web/app/components/workflow/comment/mention-input.tsx +++ b/web/app/components/workflow/comment/mention-input.tsx @@ -15,7 +15,7 @@ import { import { createPortal } from 'react-dom' import { useParams } from 'next/navigation' import { useTranslation } from 'react-i18next' -import { RiArrowUpLine, RiAtLine, RiLoader2Line } from '@remixicon/react' +import { RiArrowUpLine, RiAtLine, RiCommandLine, RiCornerDownLeftLine, RiLoader2Line } from '@remixicon/react' import Textarea from 'react-textarea-autosize' import Button from '@/app/components/base/button' import Avatar from '@/app/components/base/avatar' @@ -583,9 +583,16 @@ const MentionInputInner = forwardRef(({ size='small' disabled={loading || !value.trim()} onClick={() => handleSubmit()} + className='gap-1' > {loading && } - {t('common.operation.save')} + {t('common.operation.save')} + {!loading && ( +
+ + +
+ )} diff --git a/web/app/components/workflow/comment/thread.tsx b/web/app/components/workflow/comment/thread.tsx index aee576d857..291da66c07 100644 --- a/web/app/components/workflow/comment/thread.tsx +++ b/web/app/components/workflow/comment/thread.tsx @@ -414,7 +414,7 @@ export const CommentThread: FC = memo(({ ref={messageListRef} className='relative mt-2 flex-1 overflow-y-auto px-4 pb-4' > -
+
= memo(({ return (
{isOwnReply && !isReplyEditing && ( = memo(({ )} {isReplyEditing ? ( -
- setEditingReply(prev => prev ? { ...prev, content: newContent } : prev)} - onSubmit={handleEditSubmit} - onCancel={handleCancelEdit} - placeholder={t('workflow.comments.placeholder.editReply')} - disabled={loading} - loading={replyUpdating} - isEditing={true} - className="system-sm-regular" - autoFocus - /> +
+
+ +
+
+
+ setEditingReply(prev => prev ? { ...prev, content: newContent } : prev)} + onSubmit={handleEditSubmit} + onCancel={handleCancelEdit} + placeholder={t('workflow.comments.placeholder.editReply')} + disabled={loading} + loading={replyUpdating} + isEditing={true} + className="system-sm-regular" + autoFocus + /> +
+
) : (