feat(webui): improve model and provider settings UX (#6145)
* feat(webui): improve model and provider settings UX * refactor(webui): organize provider forms and model picker interactions * fix(webui): separate OAuth credentials from provider configuration * fix(webui): stabilize shared combobox navigation * refactor(config): store provider connections as sparse entries * fix(webui): preserve provider validation and isolate catalog tests * refactor(config): manage explicit provider connections * refactor(webui): decouple settings UX from provider removal * fix(webui): select current combobox options during rapid input * feat(webui): refine model preset and provider management * style(webui): refine preset footer actions * fix(webui): align model settings with responsive layout rules * refactor(webui): finalize preset dialogs and simplify provider state * fix(webui): keep fallback heading stable while sorting presets Animate card dimensions without changing layout height and keep the section heading outside sortable cards. Remove proxy normalization from this PR. * docs: update WebUI model and provider setup instructions * docs: start model setup from new preset * docs: remove duplicate WebUI model setup instructions
This commit is contained in:
1 parent
8080ea843a
commit
9261e731ce
88 files changed
+2854
-1734
No files matched your search
@@ -0,0 +1,65 @@
|
||||
import { Hexagon } from "lucide-react";
|
||||
import { useLogoFallback } from "@/hooks/useLogoFallback";
|
||||
import { providerBrand } from "@/lib/provider-brand";
|
||||
import { PROVIDER_ICONS } from "@/lib/provider-icons";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export function ProviderIcon({
|
||||
provider,
|
||||
showBrandLogos,
|
||||
compact = false,
|
||||
fill = false,
|
||||
}: {
|
||||
provider: string;
|
||||
showBrandLogos: boolean;
|
||||
compact?: boolean;
|
||||
fill?: boolean;
|
||||
}) {
|
||||
const brand = providerBrand(provider);
|
||||
const Icon = PROVIDER_ICONS[provider] ?? Hexagon;
|
||||
const { logoUrl, logoLoaded, onLogoError, onLogoLoad } = useLogoFallback(brand?.logoUrls);
|
||||
const showRemoteLogo = showBrandLogos && Boolean(logoUrl);
|
||||
const showLoadedLogo = showRemoteLogo && logoLoaded;
|
||||
const isLogoTile = brand?.logoLayout === "tile" && logoUrl === brand.logoUrl;
|
||||
|
||||
return (
|
||||
<span
|
||||
data-testid={`provider-logo-${provider}`}
|
||||
className={cn(
|
||||
"relative grid shrink-0 place-items-center overflow-hidden font-semibold text-muted-foreground",
|
||||
fill ? "h-full w-full rounded-[9px] text-[11px]" : compact ? "h-6 w-6 rounded-[7px] text-[9px]" : "h-8 w-8 rounded-[9px] text-[11px]",
|
||||
showLoadedLogo ? (isLogoTile ? "bg-transparent" : "bg-white") : "bg-muted",
|
||||
)}
|
||||
aria-hidden
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
"transition-opacity duration-150 motion-reduce:transition-none",
|
||||
fill && "grid h-3/4 w-3/4 place-items-center",
|
||||
showLoadedLogo ? "opacity-0" : "opacity-100",
|
||||
)}
|
||||
>
|
||||
{showBrandLogos && brand
|
||||
? brand.initials
|
||||
: <Icon className={fill ? "h-full w-full" : "h-5 w-5"} strokeWidth={2} />}
|
||||
</span>
|
||||
{showRemoteLogo ? (
|
||||
<img
|
||||
src={logoUrl}
|
||||
alt=""
|
||||
decoding="async"
|
||||
loading="lazy"
|
||||
referrerPolicy="no-referrer"
|
||||
draggable={false}
|
||||
className={cn(
|
||||
"absolute object-contain transition-opacity duration-150 motion-reduce:transition-none",
|
||||
fill ? (isLogoTile ? "h-full w-full" : "h-3/4 w-3/4") : isLogoTile ? (compact ? "h-6 w-6" : "h-8 w-8") : compact ? "h-[18px] w-[18px]" : "h-6 w-6",
|
||||
logoLoaded ? "opacity-100" : "opacity-0",
|
||||
)}
|
||||
onLoad={onLogoLoad}
|
||||
onError={onLogoError}
|
||||
/>
|
||||
) : null}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user