fix username overflows

This commit is contained in:
Face 2025-06-08 21:16:21 +03:00
parent e590a0ded2
commit 96f6db41db
5 changed files with 50 additions and 43 deletions

View file

@ -228,10 +228,10 @@
<div class="flex items-center gap-2">
<HoverCard.Root>
<HoverCard.Trigger
class="cursor-pointer font-medium underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-offset-8 truncate max-w-[120px] sm:max-w-none text-sm sm:text-base"
class="min-w-0 max-w-[120px] flex-shrink cursor-pointer text-sm font-medium underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-offset-8 sm:max-w-[180px] sm:text-base"
onclick={() => goto(`/user/${comment.userUsername}`)}
>
{comment.userName}
<span class="block truncate">{comment.userName}</span>
</HoverCard.Trigger>
<HoverCard.Content class="w-80" side="top" sideOffset={3}>
<UserProfilePreview userId={comment.userId} />
@ -239,13 +239,13 @@
</HoverCard.Root>
<button
onclick={() => goto(`/user/${comment.userUsername}`)}
class="cursor-pointer flex-shrink-0 max-w-[80px] sm:max-w-none"
class="max-w-[80px] flex-shrink-0 cursor-pointer sm:max-w-none"
>
<Badge variant="outline" class="text-xs w-full justify-start">
<Badge variant="outline" class="w-full justify-start text-xs">
<span class="truncate">@{comment.userUsername}</span>
</Badge>
</button>
<span class="text-muted-foreground whitespace-nowrap text-xs flex-shrink-0">
<span class="text-muted-foreground flex-shrink-0 whitespace-nowrap text-xs">
{formatTimeAgo(comment.createdAt)}
</span>
</div>

View file

@ -85,8 +85,10 @@
<Avatar.Fallback class="text-sm">{profile.name?.charAt(0) || '?'}</Avatar.Fallback>
</Avatar.Root>
<div class="min-w-0 flex-1 space-y-1">
<div class="flex items-center gap-2">
<h4 class="text-sm font-semibold">{profile.name}</h4>
<div class="flex min-w-0 items-center gap-2">
<h4 class="max-w-[150px] truncate text-sm font-semibold sm:max-w-[200px]">
{profile.name}
</h4>
<ProfileBadges user={profile} showId={true} size="sm" />
</div>
<p class="text-muted-foreground text-sm">@{profile.username}</p>