Skip to content

Commit 608a841

Browse files
authored
fix(ui): show official opencode logo in the Apps tab (#185)
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 669e99f commit 608a841

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

apps/desktop/src/features/clients/ClientsPage.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import claudeIcon from '@/assets/client-icons/claude.svg';
66
import windsurfIcon from '@/assets/client-icons/windsurf.svg';
77
import jetbrainsIcon from '@/assets/client-icons/jetbrains.svg';
88
import androidStudioIcon from '@/assets/client-icons/android-studio.svg';
9+
import opencodeIcon from '@/assets/client-icons/opencode.svg';
10+
import opencodeIconDark from '@/assets/client-icons/opencode-dark.svg';
11+
import { ClientBrandIcon } from '@/components/ClientBrandIcon';
912
import { resolveKnownClientKey } from '@/lib/clientIcons';
1013
import {
1114
Laptop,
@@ -65,6 +68,18 @@ const CLIENT_ICON_ASSETS: Record<string, string> = {
6568

6669
function ClientIcon({ logo_uri, client_name }: { logo_uri?: string | null; client_name: string }) {
6770
const knownKey = resolveKnownClientKey(client_name);
71+
// opencode ships theme-specific marks; render our bundled official logo
72+
// (overriding any outdated self-reported logo_uri).
73+
if (knownKey === 'opencode') {
74+
return (
75+
<ClientBrandIcon
76+
light={opencodeIcon}
77+
dark={opencodeIconDark}
78+
alt={client_name}
79+
className="h-full w-full rounded object-contain"
80+
/>
81+
);
82+
}
6883
const iconUrl = (knownKey && CLIENT_ICON_ASSETS[knownKey]) || logo_uri;
6984
if (iconUrl) {
7085
return (

apps/desktop/src/lib/clientIcons.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const KNOWN_CLIENT_PATTERNS: { pattern: string; iconKey: string }[] = [
2121
{ pattern: 'clion', iconKey: 'jetbrains' },
2222
{ pattern: 'jetbrains', iconKey: 'jetbrains' },
2323
{ pattern: 'cursor', iconKey: 'cursor' },
24+
{ pattern: 'opencode', iconKey: 'opencode' },
2425
{ pattern: 'vscode', iconKey: 'vscode' },
2526
{ pattern: 'claude', iconKey: 'claude' },
2627
];

tests/ts/lib/clientIcons.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ describe('resolveKnownClientKey', () => {
3838
it('should resolve "codeium" to windsurf', () => {
3939
expect(resolveKnownClientKey('codeium')).toBe('windsurf');
4040
});
41+
42+
it('should resolve "opencode" to opencode', () => {
43+
expect(resolveKnownClientKey('opencode')).toBe('opencode');
44+
});
45+
46+
it('should resolve "opencode (mcpmux)" to opencode', () => {
47+
expect(resolveKnownClientKey('opencode (mcpmux)')).toBe('opencode');
48+
});
4149
});
4250

4351
describe('prefix matches with parenthesised suffix', () => {

0 commit comments

Comments
 (0)