fix(webui): finish provider icon fallback and tile audit

This commit is contained in:
Xubin Ren committed 2026-09-19 17:59:17 +08:00
1 parent cd2410a55b
commit 8f6e609c4e
3 files changed
+32 -6

No files matched your search

+16 -4
View File
@@ -201,7 +201,16 @@ const PROVIDER_BRANDS: Record<string, ProviderBrand> = {
orcarouter: brand("orcarouter.ai", "#111827", "OR"),
ovms: brand("openvino.ai", "#0071C5", "OV"),
qianfan: brand("cloud.baidu.com", "#2932E1", "QF"),
searxng: brand("searxng.org", "#3050FF", "SX"),
// Its landing page redirects without an icon; favicon proxies return their own placeholder.
searxng: {
logoUrl: "https://raw.githubusercontent.com/searxng/searxng/master/searx/static/themes/simple/img/favicon.svg",
logoUrls: [
"https://raw.githubusercontent.com/searxng/searxng/master/searx/static/themes/simple/img/favicon.svg",
"https://raw.githubusercontent.com/searxng/searxng/master/searx/static/themes/simple/img/favicon.png",
],
color: "#3050FF",
initials: "SX",
},
siliconflow: brand("siliconflow.cn", "#111827", "SF"),
skywork: brand("skywork.ai", "#5B5BF6", "SW"),
stepfun: brand("stepfun.com", "#2F6BFF", "SF", [
@@ -210,9 +219,12 @@ const PROVIDER_BRANDS: Record<string, ProviderBrand> = {
tavily: { ...brand("tavily.com", "#111827", "T"), logoLayout: "tile" },
volcengine: brand("volcengine.com", "#1664FF", "VE"),
vllm: brand("vllm.ai", "#2563EB", "VL"),
xiaomi_mimo: brand("mimo.xiaomi.com", "#FF6900", "MI", [
"https://cdn.cnbj1.fds.api.mi-img.com/aife/mimo-blog-fe/doc_build/mimo.ico",
]),
xiaomi_mimo: {
...brand("mimo.xiaomi.com", "#FF6900", "MI", [
"https://cdn.cnbj1.fds.api.mi-img.com/aife/mimo-blog-fe/doc_build/mimo.ico",
]),
logoLayout: "tile",
},
xai: brand("x.ai", "#111827", "xAI"),
zhipu: {
...brand("z.ai", "#155EEF", "Z", [
+9
View File
@@ -82,6 +82,15 @@ describe("provider brand logos", () => {
expect(providerBrand("github_copilot")?.logoUrl).toBe("https://raw.githubusercontent.com/primer/octicons/main/icons/copilot-24.svg");
});
it("never substitutes a favicon proxy's placeholder for SearXNG", () => {
const brand = providerBrand("searxng")!;
expect(brand.logoUrl).toBe(brand.logoUrls[0]);
expect(brand.logoUrls).toEqual([
"https://raw.githubusercontent.com/searxng/searxng/master/searx/static/themes/simple/img/favicon.svg",
"https://raw.githubusercontent.com/searxng/searxng/master/searx/static/themes/simple/img/favicon.png",
]);
});
it("keeps OpenRouter voice settings on the first-party brand domain", () => {
expect(providerBrand("openrouter")?.logoUrl).toBe("https://openrouter.ai/brand/logos/transparent/glyph/svg/glyph-grape.svg");
expect(providerBrand("openrouter")?.logoUrls).toContain("https://openrouter.ai/favicon.ico");
+7 -2
View File
@@ -14,7 +14,9 @@ describe("settings provider icons", () => {
expect(icon.className.split(/\s+/).some((value) => value.startsWith("border"))).toBe(false);
}
it.each(["openai_codex", "anthropic", "deepseek", "gemini", "xai_grok", "longcat", "openrouter", "github_copilot", "xiaomi_mimo"])(
it.each([
"openai_codex", "anthropic", "deepseek", "gemini", "xai_grok", "longcat", "openrouter", "github_copilot",
])(
"shows %s on a single white tile with a small inset after loading",
(provider) => {
const { container } = render(<ProviderIcon provider={provider} showBrandLogos />);
@@ -41,7 +43,10 @@ describe("settings provider icons", () => {
},
);
it.each(["aihubmix", "bedrock", "exa", "groq", "lm_studio", "minimax", "minimax_anthropic", "modelscope", "moonshot", "olostep", "tavily", "zhipu"])(
it.each([
"aihubmix", "bedrock", "exa", "groq", "lm_studio", "minimax", "minimax_anthropic",
"modelscope", "moonshot", "olostep", "tavily", "xiaomi_mimo", "zhipu",
])(
"does not double-frame %s's primary tile, but preserves unknown fallback assets",
(provider) => {
const { container } = render(<ProviderIcon provider={provider} showBrandLogos />);