diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index 47668ea3..16ba54b2 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -481,7 +481,8 @@ "reset_to_default": "Reset to Default", "clear_shortcut": "Clear Shortcut", "toggle_show_assistants": "Toggle Assistants", - "toggle_show_topics": "Toggle Topics" + "toggle_show_topics": "Toggle Topics", + "copy_last_message": "Copy Last Message" }, "theme.auto": "Auto", "theme.dark": "Dark", diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index 89331f2d..cfa0553e 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -481,7 +481,8 @@ "reset_to_default": "Сбросить настройки по умолчанию", "clear_shortcut": "Очистить сочетание клавиш", "toggle_show_assistants": "Переключить отображение ассистентов", - "toggle_show_topics": "Переключить отображение топиков" + "toggle_show_topics": "Переключить отображение топиков", + "copy_last_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 7c9a1803..01ae0033 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -469,7 +469,8 @@ "reset_to_default": "重置为默认", "clear_shortcut": "清除快捷键", "toggle_show_assistants": "切换助手显示", - "toggle_show_topics": "切换话题显示" + "toggle_show_topics": "切换话题显示", + "copy_last_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 4aa29292..2fd3038a 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -469,7 +469,8 @@ "reset_to_default": "重置為預設", "clear_shortcut": "清除快捷鍵", "toggle_show_assistants": "切換助手顯示", - "toggle_show_topics": "切換話題顯示" + "toggle_show_topics": "切換話題顯示", + "copy_last_message": "複製上一条消息" }, "theme.auto": "自動", "theme.dark": "深色主題", diff --git a/src/renderer/src/pages/apps/AppsPage.tsx b/src/renderer/src/pages/apps/AppsPage.tsx index 0fd42985..ce97717e 100644 --- a/src/renderer/src/pages/apps/AppsPage.tsx +++ b/src/renderer/src/pages/apps/AppsPage.tsx @@ -74,8 +74,8 @@ const ContentContainer = styled.div` const AppsContainer = styled.div` display: flex; - min-width: 900px; - max-width: 900px; + min-width: 950px; + max-width: 950px; flex-direction: row; flex-wrap: wrap; align-content: flex-start; diff --git a/src/renderer/src/pages/home/Messages/Messages.tsx b/src/renderer/src/pages/home/Messages/Messages.tsx index 8e2d9ee6..f9cbdfd8 100644 --- a/src/renderer/src/pages/home/Messages/Messages.tsx +++ b/src/renderer/src/pages/home/Messages/Messages.tsx @@ -2,6 +2,7 @@ import Scrollbar from '@renderer/components/Scrollbar' import db from '@renderer/databases' import { useAssistant } from '@renderer/hooks/useAssistant' import { useSettings } from '@renderer/hooks/useSettings' +import { useShortcut } from '@renderer/hooks/useShortcuts' import { getTopic, TopicManager } from '@renderer/hooks/useTopic' import { fetchMessagesSummary } from '@renderer/services/ApiService' import { getDefaultTopic } from '@renderer/services/AssistantService' @@ -266,6 +267,14 @@ const Messages: FC = ({ assistant, topic, setActiveTopic }) => { }, 300) }, [displayMessages, hasMore, isLoadingMore, messages]) + useShortcut('copy_last_message', () => { + const lastMessage = last(messages) + if (lastMessage) { + navigator.clipboard.writeText(lastMessage.content) + window.message.success(t('message.copy.success')) + } + }) + return ( { state.settings.showMinappIcon = true state.settings.showFilesIcon = true + if (state.shortcuts) { + state.shortcuts.shortcuts.push({ + key: 'copy_last_message', + shortcut: [isMac ? 'Command' : 'Ctrl', 'Shift', 'C'], + editable: true, + enabled: false, + system: false + }) + } return state } } diff --git a/src/renderer/src/store/shortcuts.ts b/src/renderer/src/store/shortcuts.ts index 29ef3f09..93f91ade 100644 --- a/src/renderer/src/store/shortcuts.ts +++ b/src/renderer/src/store/shortcuts.ts @@ -37,6 +37,13 @@ const initialState: ShortcutsState = { editable: true, enabled: true, system: false + }, + { + key: 'copy_last_message', + shortcut: [isMac ? 'Command' : 'Ctrl', 'Shift', 'C'], + editable: true, + enabled: false, + system: false } ] }