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
15 changes: 15 additions & 0 deletions apps/desktop/src/features/clients/ClientsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import claudeIcon from '@/assets/client-icons/claude.svg';
import windsurfIcon from '@/assets/client-icons/windsurf.svg';
import jetbrainsIcon from '@/assets/client-icons/jetbrains.svg';
import androidStudioIcon from '@/assets/client-icons/android-studio.svg';
import opencodeIcon from '@/assets/client-icons/opencode.svg';
import opencodeIconDark from '@/assets/client-icons/opencode-dark.svg';
import { ClientBrandIcon } from '@/components/ClientBrandIcon';
import { resolveKnownClientKey } from '@/lib/clientIcons';
import {
Laptop,
Expand Down Expand Up @@ -65,6 +68,18 @@ const CLIENT_ICON_ASSETS: Record<string, string> = {

function ClientIcon({ logo_uri, client_name }: { logo_uri?: string | null; client_name: string }) {
const knownKey = resolveKnownClientKey(client_name);
// opencode ships theme-specific marks; render our bundled official logo
// (overriding any outdated self-reported logo_uri).
if (knownKey === 'opencode') {
return (
<ClientBrandIcon
light={opencodeIcon}
dark={opencodeIconDark}
alt={client_name}
className="h-full w-full rounded object-contain"
/>
);
}
const iconUrl = (knownKey && CLIENT_ICON_ASSETS[knownKey]) || logo_uri;
if (iconUrl) {
return (
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/lib/clientIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const KNOWN_CLIENT_PATTERNS: { pattern: string; iconKey: string }[] = [
{ pattern: 'clion', iconKey: 'jetbrains' },
{ pattern: 'jetbrains', iconKey: 'jetbrains' },
{ pattern: 'cursor', iconKey: 'cursor' },
{ pattern: 'opencode', iconKey: 'opencode' },
{ pattern: 'vscode', iconKey: 'vscode' },
{ pattern: 'claude', iconKey: 'claude' },
];
Expand Down
8 changes: 8 additions & 0 deletions tests/ts/lib/clientIcons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ describe('resolveKnownClientKey', () => {
it('should resolve "codeium" to windsurf', () => {
expect(resolveKnownClientKey('codeium')).toBe('windsurf');
});

it('should resolve "opencode" to opencode', () => {
expect(resolveKnownClientKey('opencode')).toBe('opencode');
});

it('should resolve "opencode (mcpmux)" to opencode', () => {
expect(resolveKnownClientKey('opencode (mcpmux)')).toBe('opencode');
});
});

describe('prefix matches with parenthesised suffix', () => {
Expand Down
Loading