Show Xiaomi branding for direct provider names and MiMo model labels. - Add an accessible, tokenized Xiaomi provider mark - Infer boundary-safe MiMo labels through the shared provider icon key - Reuse shared inference in usage cards and cover Xiaomi mappings - Add a patch changeset for Xiaomi provider branding Files changed: .changeset/fn-8500-xiaomi-provider-icon.md | 7 +++ packages/dashboard/app/components/ProviderIcon.tsx | 24 +++++++++ .../dashboard/app/components/UsageIndicator.tsx | 58 +++------------------- .../app/components/__tests__/ProviderIcon.test.tsx | 48 ++++++++++++++++++ .../components/__tests__/UsageIndicator.test.tsx | 17 +++++++ packages/dashboard/app/styles.css | 1 + .../app/utils/__tests__/providerIconKey.test.ts | 9 ++++ packages/dashboard/app/utils/providerIconKey.ts | 8 +++ 8 files changed, 120 insertions(+), 52 deletions(-) Fusion-Task-Id: FN-8500 Fusion-Task-Lineage: 1784a180-cf41-4666-a59e-10aa24f47b72 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
58 lines
2.0 KiB
TypeScript
58 lines
2.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { inferProviderIconKey } from "../providerIconKey";
|
|
|
|
describe("inferProviderIconKey", () => {
|
|
it.each([
|
|
["claude-sonnet-4-5", "anthropic"],
|
|
["Anthropic Claude", "anthropic"],
|
|
["gpt-4o", "openai"],
|
|
["openai-codex", "openai"],
|
|
["gemini-2.5-pro", "google"],
|
|
["google-antigravity", "google"],
|
|
["cursor", "cursor-cli"],
|
|
["Cursor", "cursor-cli"],
|
|
["cursor-agent", "cursor-cli"],
|
|
["cursor/gpt-5", "cursor-cli"],
|
|
["omp-cli/MiniMax-M2.5", "omp-cli"],
|
|
["omp/claude-sonnet-4", "omp-cli"],
|
|
["Oh My Pi", "omp-cli"],
|
|
["xiaomi", "xiaomi"],
|
|
["Xiaomi", "xiaomi"],
|
|
["xiaomi/MiMo-V2-Flash", "xiaomi"],
|
|
["MiMo-V2-Flash", "xiaomi"],
|
|
["ollama/llama3", "ollama"],
|
|
["minimax-text-01", "minimax"],
|
|
["zhipu-glm-4", "zai"],
|
|
["zai/glm-4.5", "zai"],
|
|
["glm-5.1", "zai"],
|
|
["glm-4.5-air", "zai"],
|
|
["glm-5v-turbo", "zai"],
|
|
["kimi-k2", "kimi"],
|
|
["moonshot-v1", "kimi"],
|
|
["amazon-bedrock-claude", "anthropic"],
|
|
["bedrock-titan", "bedrock"],
|
|
["xai-grok-4", "xai"],
|
|
["opencode", "opencode"],
|
|
["github copilot", "github-copilot"],
|
|
["copilot-gpt-4", "openai"],
|
|
])("maps %s to %s", (input, expected) => {
|
|
expect(inferProviderIconKey(input)).toBe(expected);
|
|
});
|
|
|
|
it("does not attribute bare model ids to OMP", () => {
|
|
expect(inferProviderIconKey("MiniMax-M2.5")).toBe("minimax");
|
|
expect(inferProviderIconKey("claude-sonnet-4")).not.toBe("omp-cli");
|
|
});
|
|
|
|
it("does not infer Xiaomi from near-match custom names", () => {
|
|
expect(inferProviderIconKey("mimosa-v1")).toBe("mimosa-v1");
|
|
expect(inferProviderIconKey("custom-mimoized-model")).toBe("custom-mimoized-model");
|
|
});
|
|
|
|
it("returns unknown ids unchanged so ProviderIcon can render its fallback", () => {
|
|
expect(inferProviderIconKey("custom-model-v1")).toBe("custom-model-v1");
|
|
expect(inferProviderIconKey("not-a-glmish-model")).toBe("not-a-glmish-model");
|
|
expect(inferProviderIconKey("")).toBe("");
|
|
});
|
|
});
|