fix(webui): align provider icons across compact surfaces

This commit is contained in:
Xubin Ren committed 2026-09-19 17:59:17 +08:00
1 parent 5aac672b98
commit f4d863a148
7 files changed
+149 -9

No files matched your search

@@ -501,7 +501,8 @@ export function ProviderPickerIcon({
}) {
const brand = providerBrand(provider);
const Icon = PROVIDER_ICONS[provider] ?? Hexagon;
const { logoUrl, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
const { logoUrl, logoLoaded, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
const isLogoTile = brand?.logoLayout === "tile" && logoUrl === brand.logoUrl;
if (unconfigured) {
return (
@@ -519,7 +520,10 @@ export function ProviderPickerIcon({
return (
<span
data-testid={`provider-picker-logo-${provider}`}
className="grid h-5 w-5 shrink-0 place-items-center overflow-hidden rounded-md border border-border/35 bg-background"
className={cn(
"grid h-5 w-5 shrink-0 place-items-center overflow-hidden rounded-md",
logoLoaded ? (isLogoTile ? "bg-transparent" : "bg-white") : "bg-muted",
)}
aria-hidden
>
<img
@@ -527,7 +531,13 @@ export function ProviderPickerIcon({
alt=""
decoding="async"
loading="lazy"
className="h-3.5 w-3.5 object-contain"
referrerPolicy="no-referrer"
draggable={false}
className={cn(
"object-contain",
isLogoTile ? "h-5 w-5" : "h-3.5 w-3.5",
logoLoaded ? "opacity-100" : "opacity-0",
)}
onLoad={onLogoLoad}
onError={onLogoError}
/>