mirror of
https://github.com/langgenius/dify.git
synced 2026-02-20 10:01:59 -05:00
fix: collaboration user's name display in editor line 1
This commit is contained in:
@@ -369,8 +369,11 @@ export const useSkillCodeCursors = ({ editor, fileId, enabled }: UseSkillCodeCur
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="absolute -top-5 left-2 max-w-[160px] overflow-hidden text-ellipsis whitespace-nowrap rounded px-1.5 py-0.5 text-[11px] font-medium text-white shadow-sm"
|
||||
className="absolute left-2 max-w-[160px] overflow-hidden text-ellipsis whitespace-nowrap rounded px-1.5 py-0.5 text-[11px] font-medium text-white shadow-sm"
|
||||
style={{
|
||||
top: position.y < 20
|
||||
? Math.max(position.height + 4, 18)
|
||||
: -20,
|
||||
backgroundColor: position.color,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -626,6 +626,9 @@ export const SkillRemoteCursors = ({ fileId, enabled }: SkillRemoteCursorsProps)
|
||||
const user = onlineUserMap[cursor.userId]
|
||||
const name = user?.username || cursor.userId.slice(-4)
|
||||
const color = getUserColor(cursor.userId)
|
||||
const labelOffset = cursor.y < 20
|
||||
? Math.max(cursor.height + 4, 18)
|
||||
: -20
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -644,8 +647,9 @@ export const SkillRemoteCursors = ({ fileId, enabled }: SkillRemoteCursorsProps)
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className="absolute -top-5 left-2 max-w-[160px] overflow-hidden text-ellipsis whitespace-nowrap rounded px-1.5 py-0.5 text-[11px] font-medium text-white shadow-sm"
|
||||
className="absolute left-2 max-w-[160px] overflow-hidden text-ellipsis whitespace-nowrap rounded px-1.5 py-0.5 text-[11px] font-medium text-white shadow-sm"
|
||||
style={{
|
||||
top: labelOffset,
|
||||
backgroundColor: color,
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user