From 1f47b7a6a985cbf8a87ab37d86108458d075f92c Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sun, 17 May 2026 23:44:13 +0200 Subject: [PATCH] fix: remove white halo around photo avatars --- components/ui/avatar.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx index a3a8bb81..13ac7c20 100644 --- a/components/ui/avatar.tsx +++ b/components/ui/avatar.tsx @@ -235,11 +235,10 @@ export function Avatar({ name, email, contactPhotoUri, size = "md", className, d // Priority: contact photo > plugin avatar (e.g. Gravatar) > custom avatar > profile picture > company favicon > initials const customAvatar = devMode && email ? CUSTOM_AVATARS[email.toLowerCase()] : null; const pluginAvatar = pluginAvatarFailed ? null : pluginAvatarUrl; - const imgSrc = disableImages - ? null - : !imgError && !domainFailed - ? resolvedContactPhoto || pluginAvatar || customAvatar || profilePic || (showFavicon ? `/api/favicon?domain=${encodeURIComponent(faviconDomain!)}` : null) - : (resolvedContactPhoto || pluginAvatar || customAvatar || profilePic || null); + const photoSrc = resolvedContactPhoto || pluginAvatar || customAvatar || profilePic || null; + const faviconSrc = !imgError && !domainFailed && showFavicon ? `/api/favicon?domain=${encodeURIComponent(faviconDomain!)}` : null; + const imgSrc = disableImages ? null : (photoSrc || faviconSrc); + const isFavicon = imgSrc !== null && imgSrc === faviconSrc; const handleImgError = useCallback(() => { // If the plugin avatar just failed, mark it and fall through to the next source @@ -261,7 +260,7 @@ export function Avatar({ name, email, contactPhotoUri, size = "md", className, d sizeClasses[size], className )} - style={{ backgroundColor: imgSrc ? "#ffffff" : (fallbackColor ?? getBackgroundColor()) }} + style={{ backgroundColor: imgSrc ? (isFavicon ? "#ffffff" : "transparent") : (fallbackColor ?? getBackgroundColor()) }} title={name || email} > {imgSrc ? (