From 50151f4007561970170c1e3ee44f1565ff871636 Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Wed, 15 Oct 2025 10:21:54 +0800 Subject: [PATCH] fix(web): adjust workflow online-users icon and label styles --- .../workflow/header/online-users.tsx | 47 +++++++++++++------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/web/app/components/workflow/header/online-users.tsx b/web/app/components/workflow/header/online-users.tsx index 7923c95b64..b1e030498f 100644 --- a/web/app/components/workflow/header/online-users.tsx +++ b/web/app/components/workflow/header/online-users.tsx @@ -5,7 +5,7 @@ import Avatar from '@/app/components/base/avatar' import { useCollaboration } from '../collaboration/hooks/use-collaboration' import { useStore } from '../store' import cn from '@/utils/classnames' -import { ChevronDown } from '@/app/components/base/icons/src/vender/solid/arrows' +import { ChevronDownIcon } from '@heroicons/react/20/solid' import { getUserColor } from '../collaboration/utils/user-color' import Tooltip from '@/app/components/base/tooltip' import { @@ -58,6 +58,27 @@ const OnlineUsers = () => { const currentUserId = userProfile?.id + const renderDisplayName = ( + user: any, + baseClassName: string, + suffixClassName: string, + ) => { + const baseName = user.username || 'User' + const isCurrentUser = user.user_id === currentUserId + + return ( + + {baseName} + {isCurrentUser && ( + + {' '} + (You) + + )} + + ) + } + // Function to jump to user's cursor position const jumpToUserCursor = (userId: string) => { const cursor = cursors[userId] @@ -89,14 +110,14 @@ const OnlineUsers = () => { {visibleUsers.map((user, index) => { const isCurrentUser = user.user_id === currentUserId const userColor = isCurrentUser ? undefined : getUserColor(user.user_id) - const displayName = isCurrentUser - ? `${user.username || 'User'} (You)` - : (user.username || 'User') - return ( { > +{remainingCount} - + { {onlineUsers.map((user) => { const isCurrentUser = user.user_id === currentUserId const userColor = isCurrentUser ? undefined : getUserColor(user.user_id) - const displayName = isCurrentUser - ? `${user.username || 'User'} (You)` - : (user.username || 'User') - return (
{ backgroundColor={userColor} />
- - {displayName} - + {renderDisplayName( + user, + 'system-xs-medium text-text-secondary', + 'text-text-tertiary', + )} ) })}