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
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
/*
|
|
FNXC:ProviderIcons 2026-06-25-00:00:
|
|
Command Center model analytics group rows by model id only, so dashboard model-name surfaces must infer the provider icon from the model/provider text before handing off to ProviderIcon's fallback-safe renderer.
|
|
*/
|
|
export function inferProviderIconKey(modelOrProviderName: string): string {
|
|
const normalized = modelOrProviderName.toLowerCase();
|
|
|
|
// Map common provider/model names to their icon keys.
|
|
if (normalized.includes("claude") || normalized.includes("anthropic")) {
|
|
return "anthropic";
|
|
}
|
|
if (normalized.includes("codex") || normalized.includes("openai") || normalized.includes("gpt")) {
|
|
return "openai";
|
|
}
|
|
if (normalized.includes("gemini") || normalized.includes("google") || normalized.includes("antigravity")) {
|
|
return "google";
|
|
}
|
|
if (normalized.includes("ollama")) {
|
|
return "ollama";
|
|
}
|
|
if (normalized.includes("minimax")) {
|
|
return "minimax";
|
|
}
|
|
if (normalized.includes("zai") || normalized.includes("zhipu")) {
|
|
return "zai";
|
|
}
|
|
if (normalized.includes("kimi") || normalized.includes("moonshot")) {
|
|
return "kimi";
|
|
}
|
|
if (normalized.includes("bedrock") || normalized.includes("amazon")) {
|
|
return "bedrock";
|
|
}
|
|
if (normalized.includes("xai") || normalized.includes("grok")) {
|
|
return "xai";
|
|
}
|
|
if (normalized.includes("opencode")) {
|
|
return "opencode";
|
|
}
|
|
if (normalized.includes("copilot") || normalized === "github copilot") {
|
|
return "github-copilot";
|
|
}
|
|
|
|
// Return the original name as fallback (ProviderIcon will show a default icon).
|
|
return modelOrProviderName;
|
|
}
|