Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

Preserve standalone avatar identity hints

Bingxi Zhao (Frank)76cbcb1b6be3
diff --git a/web/components/UserAvatar.tsx b/web/components/UserAvatar.tsx
index 1bb7c337f..20cee9328 100644
--- a/web/components/UserAvatar.tsx
+++ b/web/components/UserAvatar.tsx
@@ -80,6 +80,8 @@ interface UserAvatarProps {
role?: string;
size?: number;
className?: string;
+ /** The parent already provides an identity tooltip. */
+ suppressTitle?: boolean;
}
export function UserAvatar({
@@ -89,6 +91,7 @@ export function UserAvatar({
role,
size = 28,
className,
+ suppressTitle = false,
}: UserAvatarProps) {
const { t } = useTranslation();
const [imageBroken, setImageBroken] = useState(false);
@@ -137,6 +140,7 @@ export function UserAvatar({
<span
className={`relative inline-flex shrink-0 ${className ?? ""}`}
style={{ width: size, height: size }}
+ title={suppressTitle ? undefined : isAdmin ? `${username} — ${adminLabel}` : username}
aria-label={isAdmin ? `${username} (${adminLabel})` : username}
>
{isImage ? (
diff --git a/web/components/auth/ProfileLink.tsx b/web/components/auth/ProfileLink.tsx
index b74dbef23..352500990 100644
--- a/web/components/auth/ProfileLink.tsx
+++ b/web/components/auth/ProfileLink.tsx
@@ -34,6 +34,7 @@ export function ProfileLink({ collapsed = false }: ProfileLinkProps) {
avatar={status.avatar}
role={status.role}
size={collapsed ? 18 : 16}
+ suppressTitle
/>
);