diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index 64e959a6..f01e6609 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -501,7 +501,8 @@ "clear_shortcut": "Clear Shortcut", "toggle_show_assistants": "Toggle Assistants", "toggle_show_topics": "Toggle Topics", - "copy_last_message": "Copy Last Message" + "copy_last_message": "Copy Last Message", + "search_message": "Search Message" }, "theme.auto": "Auto", "theme.dark": "Dark", diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 2e69952c..a555def5 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -487,7 +487,8 @@ "clear_shortcut": "ショートカットをクリア", "toggle_show_assistants": "アシスタントの表示を切り替え", "toggle_show_topics": "トピックの表示を切り替え", - "copy_last_message": "最後のメッセージをコピー" + "copy_last_message": "最後のメッセージをコピー", + "search_message": "メッセージを検索" }, "theme.auto": "自動", "theme.dark": "ダークテーマ", diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index b3539e92..e67aab93 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -501,7 +501,8 @@ "clear_shortcut": "Очистить сочетание клавиш", "toggle_show_assistants": "Переключить отображение ассистентов", "toggle_show_topics": "Переключить отображение топиков", - "copy_last_message": "Копировать последнее сообщение" + "copy_last_message": "Копировать последнее сообщение", + "search_message": "Поиск сообщения" }, "theme.auto": "Автоматически", "theme.dark": "Темная", diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 07c37d88..757b8ee1 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -490,7 +490,8 @@ "clear_shortcut": "清除快捷键", "toggle_show_assistants": "切换助手显示", "toggle_show_topics": "切换话题显示", - "copy_last_message": "复制上一条消息" + "copy_last_message": "复制上一条消息", + "search_message": "搜索消息" }, "theme.auto": "跟随系统", "theme.dark": "深色主题", diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index e5dcf528..7c5b6b79 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -489,7 +489,8 @@ "clear_shortcut": "清除快捷鍵", "toggle_show_assistants": "切換助手顯示", "toggle_show_topics": "切換話題顯示", - "copy_last_message": "複製上一条消息" + "copy_last_message": "複製上一条消息", + "search_message": "搜索消息" }, "theme.auto": "自動", "theme.dark": "深色主題", diff --git a/src/renderer/src/pages/home/Navbar.tsx b/src/renderer/src/pages/home/Navbar.tsx index beefff48..f2eb5785 100644 --- a/src/renderer/src/pages/home/Navbar.tsx +++ b/src/renderer/src/pages/home/Navbar.tsx @@ -40,6 +40,10 @@ const HeaderNavbar: FC = ({ activeAssistant }) => { } }) + useShortcut('search_message', () => { + SearchPopup.show() + }) + return ( {showAssistants && ( diff --git a/src/renderer/src/store/index.ts b/src/renderer/src/store/index.ts index 1e9c599f..fd488b0b 100644 --- a/src/renderer/src/store/index.ts +++ b/src/renderer/src/store/index.ts @@ -28,7 +28,7 @@ const persistedReducer = persistReducer( { key: 'cherry-studio', storage, - version: 51, + version: 52, blacklist: ['runtime'], migrate }, diff --git a/src/renderer/src/store/migrate.ts b/src/renderer/src/store/migrate.ts index 21148fb6..1dd66e7e 100644 --- a/src/renderer/src/store/migrate.ts +++ b/src/renderer/src/store/migrate.ts @@ -775,6 +775,18 @@ const migrateConfig = { '51': (state: RootState) => { state.settings.topicNamingPrompt = '' return state + }, + '52': (state: RootState) => { + if (state.shortcuts) { + state.shortcuts.shortcuts.push({ + key: 'search_message', + shortcut: [isMac ? 'Command' : 'Ctrl', 'F'], + editable: true, + enabled: true, + system: false + }) + } + return state } } diff --git a/src/renderer/src/store/shortcuts.ts b/src/renderer/src/store/shortcuts.ts index 93f91ade..39ccbfd0 100644 --- a/src/renderer/src/store/shortcuts.ts +++ b/src/renderer/src/store/shortcuts.ts @@ -44,6 +44,13 @@ const initialState: ShortcutsState = { editable: true, enabled: false, system: false + }, + { + key: 'search_message', + shortcut: [isMac ? 'Command' : 'Ctrl', 'F'], + editable: true, + enabled: true, + system: false } ] }