Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gui/public/provider-icons/commandcode-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gui/public/provider-icons/openai.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions gui/src/provider-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const PROVIDER_ICON_ALIASES: Record<string, string> = {
"cloudflare-workers-ai": "cloudflare-ai-gateway-color.svg",
cline: "cline-color.svg",
"cline-pass": "cline-color.svg",
commandcode: "commandcode-color.svg",
cursor: "cursor-color.svg",
deepseek: "deepseek-color.svg",
firepass: "firepass-color.svg",
Expand Down Expand Up @@ -63,6 +64,7 @@ const PROVIDER_DISPLAY_NAMES: Record<string, string> = {
"cloudflare-workers-ai": "Cloudflare Workers AI",
cline: "Cline",
"cline-pass": "ClinePass",
commandcode: "Command Code",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Route Command Code through the locale files.

formatProviderDisplayName returns PROVIDER_DISPLAY_NAMES[key] directly when no localized key exists. This hardcoded value prevents locale-specific translations for commandcode.

Add commandcode to PROVIDER_DISPLAY_NAME_KEYS and define the matching value in the locale resources. Update the test to verify the localized key path, not only englishT.

As per path instructions, user-visible strings must go through i18n locale files rather than hardcoded text.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gui/src/provider-icons.ts` at line 67, Update formatProviderDisplayName and
its provider-name configuration so commandcode is included in
PROVIDER_DISPLAY_NAME_KEYS and resolved through the existing locale lookup path
instead of the hardcoded PROVIDER_DISPLAY_NAMES fallback. Add the matching
commandcode translation to each locale resource, and update the related test to
assert the localized key path rather than only englishT.

Source: Path instructions

nvidia: "NVIDIA NIM",
ollama: "Ollama",
"ollama-cloud": "Ollama Cloud",
Expand Down
6 changes: 6 additions & 0 deletions tests/provider-workspace-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import {
formatProviderDisplayName,
isCatalogProviderId,
providerIconSrc,
} from "../gui/src/provider-icons";
import { en } from "../gui/src/i18n/en";
import { interpolate, type TFn } from "../gui/src/i18n/shared";
Expand Down Expand Up @@ -456,6 +457,11 @@ describe("provider-icons", () => {
expect(isCatalogProviderId("openai-multi")).toBe(false);
expect(isCatalogProviderId("my-proxy")).toBe(false);
});

test("commandcode maps to its own brand mark and display name", () => {
expect(providerIconSrc("commandcode")).toBe("/provider-icons/commandcode-color.svg");
expect(formatProviderDisplayName("commandcode", englishT)).toBe("Command Code");
});
});

describe("add-provider catalog presets (WP050a)", () => {
Expand Down
Loading