fix(webui): normalize provider mark and tile spacing
This commit is contained in:
1 parent
f7902d3e53
commit
e45bedc560
4 files changed
+63
-19
No files matched your search
@@ -55,7 +55,8 @@ describe("provider brand logos", () => {
|
||||
});
|
||||
|
||||
it("keeps Zhipu on the current Z.ai brand domain", () => {
|
||||
expect(providerBrand("zhipu")?.logoUrls[0]).toBe("https://z-cdn.chatglm.cn/z-ai/static/logo.svg");
|
||||
expect(providerBrand("zhipu")?.logoUrls[0]).toBe("https://mintcdn.com/zhipu-32152247/B_E8wI-eiNa1QlPV/logo/dark.svg");
|
||||
expect(providerBrand("zhipu")?.logoUrls).toContain("https://z-cdn.chatglm.cn/z-ai/static/logo.svg");
|
||||
expect(providerBrand("zhipu")?.logoUrls).toContain("https://www.google.com/s2/favicons?domain=z.ai&sz=64");
|
||||
expect(providerBrand("zhipu")?.logoUrls).toContain("https://z.ai/favicon.ico");
|
||||
expect(providerBrand("zhipu")?.initials).toBe("Z");
|
||||
@@ -78,6 +79,7 @@ describe("provider brand logos", () => {
|
||||
});
|
||||
|
||||
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");
|
||||
expect(providerBrand("openrouter")?.initials).toBe("OR");
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ 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"])(
|
||||
it.each(["openai_codex", "anthropic", "deepseek", "gemini", "xai_grok", "longcat", "openrouter"])(
|
||||
"shows %s on a single white tile with a small inset after loading",
|
||||
(provider) => {
|
||||
const { container } = render(<ProviderIcon provider={provider} showBrandLogos />);
|
||||
@@ -26,7 +26,7 @@ describe("settings provider icons", () => {
|
||||
expect(icon).toHaveClass("bg-muted");
|
||||
expect(fallback).toHaveTextContent(providerBrand(provider)!.initials);
|
||||
expect(fallback).toHaveClass("opacity-100");
|
||||
expect(image).toHaveClass("h-7", "w-7", "object-contain", "opacity-0");
|
||||
expect(image).toHaveClass("h-6", "w-6", "object-contain", "opacity-0");
|
||||
expect(image).toHaveAttribute("alt", "");
|
||||
|
||||
fireEvent.load(image);
|
||||
@@ -41,6 +41,30 @@ describe("settings provider icons", () => {
|
||||
},
|
||||
);
|
||||
|
||||
it.each(["aihubmix", "bedrock", "exa", "groq", "lm_studio", "minimax", "minimax_anthropic", "modelscope", "moonshot", "olostep", "tavily", "zhipu"])(
|
||||
"does not double-frame %s's primary tile, but preserves unknown fallback assets",
|
||||
(provider) => {
|
||||
const { container } = render(<ProviderIcon provider={provider} showBrandLogos />);
|
||||
const icon = container.firstElementChild!;
|
||||
const image = icon.querySelector("img")!;
|
||||
expectFootprint(icon);
|
||||
expect(image).toHaveAttribute("src", providerBrand(provider)!.logoUrl);
|
||||
expect(image).toHaveClass("h-8", "w-8", "object-contain", "opacity-0");
|
||||
|
||||
fireEvent.load(image);
|
||||
expect(image).toHaveClass("opacity-100");
|
||||
expect(icon).toHaveClass("bg-white");
|
||||
|
||||
fireEvent.error(image);
|
||||
expect(image).toHaveAttribute("src", providerBrand(provider)!.logoUrls[1]);
|
||||
expect(image).toHaveClass("h-6", "w-6", "object-contain", "opacity-0");
|
||||
expect(icon).toHaveClass("bg-muted");
|
||||
fireEvent.load(image);
|
||||
expectFootprint(icon);
|
||||
expect(image).toHaveClass("h-6", "w-6", "opacity-100");
|
||||
},
|
||||
);
|
||||
|
||||
it("keeps its placeholder through alternate URLs and complete image failure", () => {
|
||||
const { container } = render(<ProviderIcon provider="openai_codex" showBrandLogos />);
|
||||
const icon = container.firstElementChild!;
|
||||
|
||||
Reference in new issue
Block a user