diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 11f15171..84d877c6 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -10,6 +10,7 @@ import TopViewContainer from './components/TopView' import AntdProvider from './context/AntdProvider' import { SyntaxHighlighterProvider } from './context/SyntaxHighlighterProvider' import { ThemeProvider } from './context/ThemeProvider' +import NavigationHandler from './handler/NavigationHandler' import AgentsPage from './pages/agents/AgentsPage' import AppsPage from './pages/apps/AppsPage' import FilesPage from './pages/files/FilesPage' @@ -28,6 +29,8 @@ function App(): JSX.Element { + + {/* 添加导航处理组件 */} } /> diff --git a/src/renderer/src/handler/NavigationHandler.tsx b/src/renderer/src/handler/NavigationHandler.tsx new file mode 100644 index 00000000..c780e467 --- /dev/null +++ b/src/renderer/src/handler/NavigationHandler.tsx @@ -0,0 +1,17 @@ +import { useHotkeys } from 'react-hotkeys-hook' +import { useNavigate } from 'react-router-dom' + +const NavigationHandler: React.FC = () => { + const navigate = useNavigate() + useHotkeys( + 'meta+, ! ctrl+,', + function () { + navigate('/settings/provider') + }, + { splitKey: '!' } + ) + + return null +} + +export default NavigationHandler diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index b17e4ef1..fe7d4845 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -757,7 +757,8 @@ "toggle_show_topics": "Toggle Topics", "zoom_in": "Zoom In", "zoom_out": "Zoom Out", - "zoom_reset": "Reset Zoom" + "zoom_reset": "Reset Zoom", + "show_settings": "Open Settings" }, "theme.auto": "Auto", "theme.dark": "Dark", @@ -810,4 +811,4 @@ "title": "Docs" } } -} +} \ No newline at end of file diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 1fae1c95..3910e62b 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -768,7 +768,8 @@ "toggle_show_topics": "トピックの表示を切り替え", "zoom_in": "ズームイン", "zoom_out": "ズームアウト", - "zoom_reset": "ズームをリセット" + "zoom_reset": "ズームをリセット", + "show_settings": "設定を開く" }, "theme.auto": "自動", "theme.dark": "ダークテーマ", @@ -814,4 +815,4 @@ "title": "ドキュメント" } } -} +} \ No newline at end of file diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index de2c6929..c0ba5b19 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -746,7 +746,8 @@ "toggle_show_topics": "Переключить отображение топиков", "zoom_in": "Увеличить", "zoom_out": "Уменьшить", - "zoom_reset": "Сбросить масштаб" + "zoom_reset": "Сбросить масштаб", + "show_settings": "Открыть настройки" }, "theme.auto": "Автоматически", "theme.dark": "Темная", @@ -793,4 +794,4 @@ "title": "Документация" } } -} +} \ No newline at end of file diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 9bcb8546..d74752ad 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -755,6 +755,7 @@ "reset_to_default": "重置为默认", "search_message": "搜索消息", "show_app": "显示应用", + "show_settings": "打开设置", "title": "快捷方式", "toggle_new_context": "清除上下文", "toggle_show_assistants": "切换助手显示", @@ -814,4 +815,4 @@ "title": "帮助文档" } } -} +} \ No newline at end of file diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index 7844f882..a43f5b03 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -748,7 +748,8 @@ "toggle_show_topics": "切換話題顯示", "zoom_in": "放大界面", "zoom_out": "縮小界面", - "zoom_reset": "重置縮放" + "zoom_reset": "重置縮放", + "show_settings": "打開設定" }, "theme.auto": "自動", "theme.dark": "深色主題", @@ -795,4 +796,4 @@ "title": "幫助文件" } } -} +} \ No newline at end of file diff --git a/src/renderer/src/store/shortcuts.ts b/src/renderer/src/store/shortcuts.ts index 982ed6e9..7fe4f239 100644 --- a/src/renderer/src/store/shortcuts.ts +++ b/src/renderer/src/store/shortcuts.ts @@ -10,6 +10,13 @@ export interface ShortcutsState { const initialState: ShortcutsState = { shortcuts: [ ...ZOOM_SHORTCUTS, + { + key: 'show_settings', + shortcut: [isMac ? 'Command' : 'Ctrl', ','], + editable: false, + enabled: true, + system: true + }, { key: 'show_app', shortcut: [],