@@ -136,35 +136,29 @@ function UserListItem({
136136 onAdd ?: ( ) => void ;
137137 onRemove ?: ( ) => void ;
138138} ) {
139- const [ isHovered , setIsHovered ] = useState ( false ) ;
140-
141139 return (
142- < div
143- className = "flex items-center justify-between py-2 px-1 rounded-md hover:bg-neutral-bg transition-colors"
144- onMouseEnter = { ( ) => setIsHovered ( true ) }
145- onMouseLeave = { ( ) => setIsHovered ( false ) }
146- >
147- < div className = "flex items-center gap-3" >
140+ < div className = "group flex min-w-0 items-center justify-between gap-2 py-2 px-1 rounded-md hover:bg-neutral-bg transition-colors" >
141+ < div className = "flex min-w-0 flex-1 items-center gap-3" >
148142 < Avatar className = "size-8" >
149143 < AvatarImage src = { user . avatarUrl } alt = { user . name } />
150144 < AvatarFallback className = "text-xs bg-muted" >
151145 { getInitials ( user . name ) }
152146 </ AvatarFallback >
153147 </ Avatar >
154- < span className = "text-sm font-medium" >
148+ < span className = "truncate text-sm font-medium" >
155149 { user . name }
156150 { isCurrentUser && (
157151 < span className = "text-muted-foreground" > (You)</ span >
158152 ) }
159153 </ span >
160154 </ div >
161- { isAdded && isHovered && onRemove && (
155+ { isAdded && onRemove && (
162156 < Button
163157 variant = "link"
164158 size = "xs"
165159 colorScheme = "primary"
166160 onClick = { onRemove }
167- className = "h-auto py-0.5 px-2 no-underline hover:no-underline font-bold"
161+ className = "h-auto py-0.5 px-2 no-underline hover:no-underline font-bold opacity-0 group-hover:opacity-100 focus-visible:opacity-100 "
168162 >
169163 Remove
170164 </ Button >
@@ -294,6 +288,7 @@ export function Collaboration<T extends User = User>({
294288 < PopoverContent
295289 align = "end"
296290 sideOffset = { 8 }
291+ aria-label = { title }
297292 className = "w-[368px] p-0 border-0 bg-transparent shadow-none"
298293 >
299294 { /* Users Panel */ }
@@ -313,7 +308,7 @@ export function Collaboration<T extends User = User>({
313308 { emptyStateMessage }
314309 </ div >
315310 ) : (
316- < div className = "space-y-1 max-h-48 overflow-y-auto " >
311+ < div className = "max-h-48 space-y-1 overflow-y-auto overflow-x-hidden " >
317312 { users . map ( ( user ) => {
318313 const userId = getUserId ( user as T ) ;
319314 const currentUserId = currentUser
@@ -360,6 +355,7 @@ export function Collaboration<T extends User = User>({
360355 align = "center"
361356 sideOffset = { - 8 }
362357 alignOffset = { 26 }
358+ aria-label = "Add users"
363359 className = "w-[420px] p-0 border-0 bg-transparent shadow-none"
364360 >
365361 { /* Add Users Panel */ }
@@ -412,7 +408,7 @@ export function Collaboration<T extends User = User>({
412408 </ SearchInput >
413409 </ div >
414410
415- < div className = "space-y-1 max-h-48 overflow-y-auto " >
411+ < div className = "max-h-48 space-y-1 overflow-y-auto overflow-x-hidden " >
416412 { isSearching && (
417413 < div className = "text-sm text-muted-foreground py-4 text-center" >
418414 Searching...
0 commit comments