mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
fix: collaboration user's name display in editor line 1
This commit is contained in:
parent
7535b67423
commit
36bfb08f34
@ -369,8 +369,11 @@ export const useSkillCodeCursors = ({ editor, fileId, enabled }: UseSkillCodeCur
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div
|
<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={{
|
style={{
|
||||||
|
top: position.y < 20
|
||||||
|
? Math.max(position.height + 4, 18)
|
||||||
|
: -20,
|
||||||
backgroundColor: position.color,
|
backgroundColor: position.color,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -626,6 +626,9 @@ export const SkillRemoteCursors = ({ fileId, enabled }: SkillRemoteCursorsProps)
|
|||||||
const user = onlineUserMap[cursor.userId]
|
const user = onlineUserMap[cursor.userId]
|
||||||
const name = user?.username || cursor.userId.slice(-4)
|
const name = user?.username || cursor.userId.slice(-4)
|
||||||
const color = getUserColor(cursor.userId)
|
const color = getUserColor(cursor.userId)
|
||||||
|
const labelOffset = cursor.y < 20
|
||||||
|
? Math.max(cursor.height + 4, 18)
|
||||||
|
: -20
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@ -644,8 +647,9 @@ export const SkillRemoteCursors = ({ fileId, enabled }: SkillRemoteCursorsProps)
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div
|
<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={{
|
style={{
|
||||||
|
top: labelOffset,
|
||||||
backgroundColor: color,
|
backgroundColor: color,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user