From 6ec8bfdfee3733c54ba2f3349a1d8aca46ee8706 Mon Sep 17 00:00:00 2001 From: hjlarry Date: Sat, 6 Sep 2025 11:29:45 +0800 Subject: [PATCH] add mouse over avatar display username --- .../workflow/header/online-users.tsx | 65 +++++++++++++------ 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/web/app/components/workflow/header/online-users.tsx b/web/app/components/workflow/header/online-users.tsx index ecccd3cb5b..7f6792d860 100644 --- a/web/app/components/workflow/header/online-users.tsx +++ b/web/app/components/workflow/header/online-users.tsx @@ -5,6 +5,7 @@ import { useStore } from '../store' import cn from '@/utils/classnames' import { ChevronDown } from '@/app/components/base/icons/src/vender/solid/arrows' import { getUserColor } from '../collaboration/utils/user-color' +import Tooltip from '@/app/components/base/tooltip' const OnlineUsers = () => { const appId = useStore(s => s.appId) @@ -28,32 +29,56 @@ const OnlineUsers = () => { {visibleUsers.map((user, index) => { const userColor = getUserColor(user.user_id) return ( -
- -
+
+ +
+ ) })} {remainingCount > 0 && ( -
+ {onlineUsers.slice(maxVisible).map((user, index) => ( +
+ {user.username || 'User'} +
+ ))} +
+ } + position="bottom" + triggerMethod="hover" + needsDelay={false} + asChild > - +{remainingCount} - +
+ +{remainingCount} +
+ )} {remainingCount > 0 && (