diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index 64ba94bb..56a6d92e 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -19,6 +19,7 @@ module.exports = { parserOptions: { ecmaVersion: 'latest', sourceType: 'module', + project: './tsconfig.json', }, rules: { 'react-refresh/only-export-components': 'off', @@ -32,6 +33,7 @@ module.exports = { }, ], '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/switch-exhaustiveness-check': 'error', // i18n rule - only active when LINT_I18N=true 'i18next/no-literal-string': i18nCheck ? [ @@ -64,5 +66,15 @@ module.exports = { 'i18next/no-literal-string': 'off', }, }, + { + // Disable type-aware linting for config files + files: ['*.config.{ts,js,cjs,mjs}', '.eslintrc.cjs'], + parserOptions: { + project: null, + }, + rules: { + '@typescript-eslint/switch-exhaustiveness-check': 'off', + }, + }, ], }; diff --git a/frontend/public/ide/windsurf-dark.svg b/frontend/public/ide/windsurf-dark.svg index 386f8c03..f64cd8c6 100644 --- a/frontend/public/ide/windsurf-dark.svg +++ b/frontend/public/ide/windsurf-dark.svg @@ -1,3 +1,3 @@ - - + + diff --git a/frontend/public/ide/windsurf-light.svg b/frontend/public/ide/windsurf-light.svg index 2e4e4e49..dab66e66 100644 --- a/frontend/public/ide/windsurf-light.svg +++ b/frontend/public/ide/windsurf-light.svg @@ -1,3 +1,3 @@ - - + + diff --git a/frontend/public/ide/zed-dark.svg b/frontend/public/ide/zed-dark.svg index a6ab472a..06b5c183 100644 --- a/frontend/public/ide/zed-dark.svg +++ b/frontend/public/ide/zed-dark.svg @@ -1,3 +1,3 @@ - + diff --git a/frontend/public/ide/zed-light.svg b/frontend/public/ide/zed-light.svg index 06b5c183..a6ab472a 100644 --- a/frontend/public/ide/zed-light.svg +++ b/frontend/public/ide/zed-light.svg @@ -1,3 +1,3 @@ - + diff --git a/frontend/src/components/ide/IdeIcon.tsx b/frontend/src/components/ide/IdeIcon.tsx index 628e0dab..dd7d0451 100644 --- a/frontend/src/components/ide/IdeIcon.tsx +++ b/frontend/src/components/ide/IdeIcon.tsx @@ -16,54 +16,61 @@ function getResolvedTheme(theme: ThemeMode): 'light' | 'dark' { return theme === ThemeMode.DARK ? 'dark' : 'light'; } +export function getIdeName(editorType: EditorType | undefined | null): string { + if (!editorType) return 'IDE'; + switch (editorType) { + case EditorType.VS_CODE: + return 'VS Code'; + case EditorType.CURSOR: + return 'Cursor'; + case EditorType.WINDSURF: + return 'Windsurf'; + case EditorType.INTELLI_J: + return 'IntelliJ IDEA'; + case EditorType.ZED: + return 'Zed'; + case EditorType.XCODE: + return 'Xcode'; + case EditorType.CUSTOM: + return 'IDE'; + } +} + export function IdeIcon({ editorType, className = 'h-4 w-4' }: IdeIconProps) { const { theme } = useTheme(); const resolvedTheme = getResolvedTheme(theme); + const isDark = resolvedTheme === 'dark'; - if (editorType === EditorType.VS_CODE) { - const vscodeIcon = - resolvedTheme === 'dark' - ? '/ide/vscode-dark.svg' - : '/ide/vscode-light.svg'; + const ideName = getIdeName(editorType); + let ideIconPath = ''; - return VS Code; + if (!editorType || editorType === EditorType.CUSTOM) { + // Generic fallback for other IDEs or no IDE configured + return ; } - if (editorType === EditorType.CURSOR) { - const cursorIcon = - resolvedTheme === 'dark' - ? '/ide/cursor-dark.svg' // dark - : '/ide/cursor-light.svg'; // light - - return Cursor; + switch (editorType) { + case EditorType.VS_CODE: + ideIconPath = isDark ? '/ide/vscode-dark.svg' : '/ide/vscode-light.svg'; + break; + case EditorType.CURSOR: + ideIconPath = isDark ? '/ide/cursor-dark.svg' : '/ide/cursor-light.svg'; + break; + case EditorType.WINDSURF: + ideIconPath = isDark + ? '/ide/windsurf-dark.svg' + : '/ide/windsurf-light.svg'; + break; + case EditorType.INTELLI_J: + ideIconPath = '/ide/intellij.svg'; + break; + case EditorType.ZED: + ideIconPath = isDark ? '/ide/zed-dark.svg' : '/ide/zed-light.svg'; + break; + case EditorType.XCODE: + ideIconPath = '/ide/xcode.svg'; + break; } - if (editorType === EditorType.WINDSURF) { - const windsurfIcon = - resolvedTheme === 'dark' - ? '/ide/windsurf-light.svg' - : '/ide/windsurf-dark.svg'; - - return Windsurf; - } - - if (editorType === EditorType.INTELLI_J) { - return ( - IntelliJ IDEA - ); - } - - if (editorType === EditorType.ZED) { - const zedIcon = - resolvedTheme === 'dark' ? '/ide/zed-light.svg' : '/ide/zed-dark.svg'; - - return Zed; - } - - if (editorType === EditorType.XCODE) { - return Xcode; - } - - // Generic fallback for other IDEs or no IDE configured - return ; + return {ideName}; } diff --git a/frontend/src/components/ide/OpenInIdeButton.tsx b/frontend/src/components/ide/OpenInIdeButton.tsx index e02ffc9f..39105096 100644 --- a/frontend/src/components/ide/OpenInIdeButton.tsx +++ b/frontend/src/components/ide/OpenInIdeButton.tsx @@ -1,8 +1,7 @@ import { useMemo } from 'react'; import { Button } from '@/components/ui/button'; import { useUserSystem } from '@/components/config-provider'; -import { IdeIcon } from './IdeIcon'; -import { EditorType } from 'shared/types'; +import { IdeIcon, getIdeName } from './IdeIcon'; type OpenInIdeButtonProps = { onClick: () => void; @@ -10,27 +9,6 @@ type OpenInIdeButtonProps = { className?: string; }; -function getIdeName(editorType: EditorType | undefined | null): string { - switch (editorType) { - case EditorType.VS_CODE: - return 'VS Code'; - case EditorType.CURSOR: - return 'Cursor'; - case EditorType.WINDSURF: - return 'Windsurf'; - case EditorType.INTELLI_J: - return 'IntelliJ IDEA'; - case EditorType.ZED: - return 'Zed'; - case EditorType.XCODE: - return 'Xcode'; - case EditorType.CUSTOM: - return 'IDE'; - default: - return 'IDE'; - } -} - export function OpenInIdeButton({ onClick, disabled = false,