diff --git a/frontend/src/i18n/locales/en/common.json b/frontend/src/i18n/locales/en/common.json index 41c936d8..b5745952 100644 --- a/frontend/src/i18n/locales/en/common.json +++ b/frontend/src/i18n/locales/en/common.json @@ -10,7 +10,8 @@ "reset": "Reset", "manage": "Manage", "connect": "Connect", - "disconnect": "Disconnect" + "disconnect": "Disconnect", + "close": "Close" }, "states": { "loading": "Loading...", diff --git a/frontend/src/i18n/locales/en/settings.json b/frontend/src/i18n/locales/en/settings.json index 6753c50f..30b0e904 100644 --- a/frontend/src/i18n/locales/en/settings.json +++ b/frontend/src/i18n/locales/en/settings.json @@ -8,8 +8,7 @@ "agents": "Agents", "agentsDesc": "Coding agent configurations", "mcp": "MCP Servers", - "mcpDesc": "Model Context Protocol servers", - "backToApp": "Back to app" + "mcpDesc": "Model Context Protocol servers" } }, "general": { diff --git a/frontend/src/i18n/locales/es/common.json b/frontend/src/i18n/locales/es/common.json index 68b2f233..559afa6f 100644 --- a/frontend/src/i18n/locales/es/common.json +++ b/frontend/src/i18n/locales/es/common.json @@ -10,7 +10,8 @@ "reset": "Restablecer", "manage": "Gestionar", "connect": "Conectar", - "disconnect": "Desconectar" + "disconnect": "Desconectar", + "close": "Cerrar" }, "states": { "loading": "Cargando...", diff --git a/frontend/src/i18n/locales/es/settings.json b/frontend/src/i18n/locales/es/settings.json index f6cc62e3..116c412d 100644 --- a/frontend/src/i18n/locales/es/settings.json +++ b/frontend/src/i18n/locales/es/settings.json @@ -8,8 +8,7 @@ "agents": "Agentes", "agentsDesc": "Configuraciones de agentes", "mcp": "Servidores MCP", - "mcpDesc": "Servidores de Protocolo de Contexto de Modelo (MCP)", - "backToApp": "Volver a la app" + "mcpDesc": "Servidores de Protocolo de Contexto de Modelo (MCP)" } }, "general": { diff --git a/frontend/src/i18n/locales/ja/common.json b/frontend/src/i18n/locales/ja/common.json index a5d7f180..0c6955ac 100644 --- a/frontend/src/i18n/locales/ja/common.json +++ b/frontend/src/i18n/locales/ja/common.json @@ -10,7 +10,8 @@ "reset": "リセット", "manage": "管理", "connect": "接続", - "disconnect": "切断" + "disconnect": "切断", + "close": "閉じる" }, "states": { "loading": "読み込み中...", diff --git a/frontend/src/i18n/locales/ja/settings.json b/frontend/src/i18n/locales/ja/settings.json index 68e249dd..2989df61 100644 --- a/frontend/src/i18n/locales/ja/settings.json +++ b/frontend/src/i18n/locales/ja/settings.json @@ -8,8 +8,7 @@ "agents": "エージェント", "agentsDesc": "コーディングエージェントの設定", "mcp": "MCPサーバー", - "mcpDesc": "モデルコンテキストプロトコルサーバー", - "backToApp": "アプリに戻る" + "mcpDesc": "モデルコンテキストプロトコルサーバー" } }, "general": { diff --git a/frontend/src/i18n/locales/ko/common.json b/frontend/src/i18n/locales/ko/common.json index a994d897..6cff3a49 100644 --- a/frontend/src/i18n/locales/ko/common.json +++ b/frontend/src/i18n/locales/ko/common.json @@ -10,7 +10,8 @@ "reset": "초기화", "manage": "관리", "connect": "연결", - "disconnect": "연결 해제" + "disconnect": "연결 해제", + "close": "닫기" }, "states": { "loading": "로딩 중...", diff --git a/frontend/src/i18n/locales/ko/settings.json b/frontend/src/i18n/locales/ko/settings.json index 2bb27698..896d19bb 100644 --- a/frontend/src/i18n/locales/ko/settings.json +++ b/frontend/src/i18n/locales/ko/settings.json @@ -8,8 +8,7 @@ "agents": "에이전트", "agentsDesc": "코딩 에이전트 구성", "mcp": "MCP 서버", - "mcpDesc": "Model Context Protocol 서버", - "backToApp": "앱으로 돌아가기" + "mcpDesc": "Model Context Protocol 서버" } }, "general": { diff --git a/frontend/src/keyboard/registry.ts b/frontend/src/keyboard/registry.ts index a8161ebc..42936230 100644 --- a/frontend/src/keyboard/registry.ts +++ b/frontend/src/keyboard/registry.ts @@ -3,6 +3,7 @@ export enum Scope { DIALOG = 'dialog', KANBAN = 'kanban', PROJECTS = 'projects', + SETTINGS = 'settings', EDIT_COMMENT = 'edit-comment', APPROVALS = 'approvals', FOLLOW_UP = 'follow-up', @@ -62,6 +63,13 @@ export const keyBindings: KeyBinding[] = [ description: 'Cancel comment', group: 'Comments', }, + { + action: Action.EXIT, + keys: 'esc', + scopes: [Scope.SETTINGS], + description: 'Close settings', + group: 'Navigation', + }, // Creation actions { diff --git a/frontend/src/pages/settings/SettingsLayout.tsx b/frontend/src/pages/settings/SettingsLayout.tsx index 7d9fc2d0..79153dd6 100644 --- a/frontend/src/pages/settings/SettingsLayout.tsx +++ b/frontend/src/pages/settings/SettingsLayout.tsx @@ -1,9 +1,13 @@ import { NavLink, Outlet } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { Settings, Cpu, Server, ArrowLeft } from 'lucide-react'; +import { Settings, Cpu, Server, X } from 'lucide-react'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; import { usePreviousPath } from '@/hooks/usePreviousPath'; +import { useEffect } from 'react'; +import { useHotkeysContext } from 'react-hotkeys-hook'; +import { useKeyExit } from '@/keyboard/hooks'; +import { Scope } from '@/keyboard/registry'; const settingsNavigation = [ { @@ -23,20 +27,39 @@ const settingsNavigation = [ export function SettingsLayout() { const { t } = useTranslation('settings'); const goToPreviousPath = usePreviousPath(); + const { enableScope, disableScope } = useHotkeysContext(); + + // Enable SETTINGS scope when component mounts + useEffect(() => { + enableScope(Scope.SETTINGS); + return () => { + disableScope(Scope.SETTINGS); + }; + }, [enableScope, disableScope]); + + // Register ESC keyboard shortcut + useKeyExit(goToPreviousPath, { scope: Scope.SETTINGS }); return ( -