Show inferred provider icons beside model names across Command Center bar and table surfaces. - Add dashboard-side provider-icon inference for model/provider strings. - Render provider icons on Command Center model bar rows and token table rows while keeping pie chart labels text-only. - Cover overview, token, and ecosystem model-icon surfaces with tests and add a changeset. Files changed: .changeset/fn-6969-provider-icons.md | 7 ++ .../components/command-center/CommandCenter.tsx | 15 ++- .../__tests__/CommandCenter.test.tsx | 33 ++++++- .../command-center/areas/EcosystemArea.tsx | 15 ++- .../components/command-center/areas/TokensArea.tsx | 37 +++++++- .../areas/__tests__/TokensArea.test.tsx | 105 +++++++++++++++++++++ .../command-center/areas/__tests__/areas.test.tsx | 42 ++++++++- .../app/components/command-center/charts/Bar.tsx | 25 ++++- .../components/command-center/charts/charts.css | 42 +++++++++ .../app/utils/__tests__/providerIconKey.test.ts | 32 +++++++ packages/dashboard/app/utils/providerIconKey.ts | 45 +++++++++ 11 files changed, 377 insertions(+), 21 deletions(-) Fusion-Task-Id: FN-6969 Fusion-Task-Lineage: 6caf8864-1ecc-46e3-b7fa-bfa8e9a70aaa
33 lines
1.1 KiB
TypeScript
33 lines
1.1 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"],
|
|
["ollama/llama3", "ollama"],
|
|
["minimax-text-01", "minimax"],
|
|
["zhipu-glm-4", "zai"],
|
|
["zai/glm-4.5", "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("returns unknown ids unchanged so ProviderIcon can render its fallback", () => {
|
|
expect(inferProviderIconKey("custom-model-v1")).toBe("custom-model-v1");
|
|
expect(inferProviderIconKey("")).toBe("");
|
|
});
|
|
});
|