diff --git a/src/apps/chat/AppChat.tsx b/src/apps/chat/AppChat.tsx index e2a038cf9..6da905a73 100644 --- a/src/apps/chat/AppChat.tsx +++ b/src/apps/chat/AppChat.tsx @@ -17,7 +17,7 @@ import { useCapabilityTextToImage } from '~/modules/t2i/t2i.client'; import { ConfirmationModal } from '~/common/components/ConfirmationModal'; import { ConversationsManager } from '~/common/chats/ConversationsManager'; -import { GlobalShortcutDefinition, ShortcutKeyName, useGlobalShortcuts } from '~/common/components/useGlobalShortcuts'; +import { GlobalShortcutDefinition, useGlobalShortcuts } from '~/common/components/useGlobalShortcuts'; import { PanelResizeInset } from '~/common/components/panes/GoodPanelResizeHandler'; import { PreferencesTab, useOptimaLayout, usePluggableOptimaLayout } from '~/common/layout/optima/useOptimaLayout'; import { ScrollToBottom } from '~/common/scroll-to-bottom/ScrollToBottom'; @@ -400,20 +400,19 @@ export function AppChat() { const shortcuts = React.useMemo((): GlobalShortcutDefinition[] => [ // focused conversation ['b', true, true, false, handleMessageBeamLastInFocusedPane], - ['r', true, true, false, handleMessageRegenerateLastInFocusedPane], - ['n', true, false, true, handleConversationNewInFocusedPane], + ['g', true, true, false, handleMessageRegenerateLastInFocusedPane], ['o', true, false, false, handleFileOpenConversation], ['s', true, false, false, () => handleFileSaveConversation(focusedPaneConversationId)], - ['b', true, false, true, () => isFocusedChatEmpty || (focusedPaneConversationId && handleConversationBranch(focusedPaneConversationId, null))], - ['x', true, false, true, () => isFocusedChatEmpty || (focusedPaneConversationId && handleConversationClear(focusedPaneConversationId))], - ['d', true, false, true, () => focusedPaneConversationId && handleDeleteConversations([focusedPaneConversationId], false)], - [ShortcutKeyName.Left, true, false, true, () => handleNavigateHistoryInFocusedPane('back')], - [ShortcutKeyName.Right, true, false, true, () => handleNavigateHistoryInFocusedPane('forward')], + ['n', true, true, false, handleConversationNewInFocusedPane], + ['x', true, true, false, () => isFocusedChatEmpty || (focusedPaneConversationId && handleConversationClear(focusedPaneConversationId))], + ['d', true, true, false, () => focusedPaneConversationId && handleDeleteConversations([focusedPaneConversationId], false)], + ['[', true, false, false, () => handleNavigateHistoryInFocusedPane('back')], + [']', true, false, false, () => handleNavigateHistoryInFocusedPane('forward')], // global ['o', true, true, false, handleOpenChatLlmOptions], ['+', true, true, false, useUIPreferencesStore.getState().increaseContentScaling], ['-', true, true, false, useUIPreferencesStore.getState().decreaseContentScaling], - ], [focusedPaneConversationId, handleConversationBranch, handleConversationClear, handleConversationNewInFocusedPane, handleFileOpenConversation, handleFileSaveConversation, handleDeleteConversations, handleMessageBeamLastInFocusedPane, handleMessageRegenerateLastInFocusedPane, handleNavigateHistoryInFocusedPane, handleOpenChatLlmOptions, isFocusedChatEmpty]); + ], [focusedPaneConversationId, handleConversationClear, handleConversationNewInFocusedPane, handleFileOpenConversation, handleFileSaveConversation, handleDeleteConversations, handleMessageBeamLastInFocusedPane, handleMessageRegenerateLastInFocusedPane, handleNavigateHistoryInFocusedPane, handleOpenChatLlmOptions, isFocusedChatEmpty]); useGlobalShortcuts(shortcuts); diff --git a/src/apps/chat/components/ChatPageMenuItems.tsx b/src/apps/chat/components/ChatPageMenuItems.tsx index 87d24da18..d6cbc446e 100644 --- a/src/apps/chat/components/ChatPageMenuItems.tsx +++ b/src/apps/chat/components/ChatPageMenuItems.tsx @@ -143,7 +143,7 @@ export function ChatPageMenuItems(props: { Reset Chat - {!props.disableItems && } + {!props.disableItems && } diff --git a/src/apps/chat/components/message/ChatMessage.tsx b/src/apps/chat/components/message/ChatMessage.tsx index b26f728ba..64045db6e 100644 --- a/src/apps/chat/components/message/ChatMessage.tsx +++ b/src/apps/chat/components/message/ChatMessage.tsx @@ -765,7 +765,7 @@ export function ChatMessage(props: { ? <>Restart from here : !props.isBottom ? <>Retry from here - : Retry} + : Retry} )} {!!props.onMessageBeam && ( diff --git a/src/apps/settings-modal/ShortcutsModal.tsx b/src/apps/settings-modal/ShortcutsModal.tsx index 6f39ce434..c19bc43d7 100644 --- a/src/apps/settings-modal/ShortcutsModal.tsx +++ b/src/apps/settings-modal/ShortcutsModal.tsx @@ -3,38 +3,36 @@ import * as React from 'react'; import { BlocksRenderer } from '~/modules/blocks/BlocksRenderer'; import { GoodModal } from '~/common/components/GoodModal'; -import { isMacUser } from '~/common/util/pwaUtils'; import { platformAwareKeystrokes } from '~/common/components/KeyStroke'; import { useIsMobile } from '~/common/components/useMatchMedia'; const shortcutsMd = platformAwareKeystrokes(` -| Shortcut | Description | -|-----------------------------------------|-------------------------------------------------| -| **Edit** | | -| Shift + Enter | Newline | -| Alt + Enter | Append (no response) | -| Ctrl + Shift + B | **Beam** last message | -| Ctrl + Shift + R | **Regenerate** last message | -| Ctrl + Shift + V | Attach clipboard (better than Ctrl + V) | -| Ctrl + M | Microphone (voice typing) | -| **Chats** | | -| Ctrl + O | Open Chat ... | -| Ctrl + S | Save Chat ... | -| Ctrl + ${isMacUser ? '' : 'Alt +'} N | **New** chat | -| Ctrl + ${isMacUser ? '' : 'Alt +'} X | **Reset** chat | -| Ctrl + ${isMacUser ? '' : 'Alt +'} D | **Delete** chat | -| Ctrl + ${isMacUser ? '' : 'Alt +'} B | **Branch** chat | -| Ctrl + Alt + Left | **Previous** chat (in history) | -| Ctrl + Alt + Right | **Next** chat (in history) | -| **Settings** | | -| Ctrl + Shift + P | ⚙️ Preferences | -| Ctrl + Shift + M | 🧠 Models | -| Ctrl + Shift + O | 💬 Options (current Chat Model) | -| Ctrl + Shift + + | Increase Text Size | -| Ctrl + Shift + - | Decrease Text Size | -| Ctrl + Shift + ${isMacUser ? '/' : '?'} | Shortcuts | +| Shortcut | Description | +|------------------|-----------------------------------------| +| **Edit** | | +| Shift + Enter | Newline | +| Alt + Enter | Append (no response) | +| Ctrl + Shift + B | **Beam** last message | +| Ctrl + Shift + G | Re**generate** last message | +| Ctrl + Shift + V | Attach clipboard (better than Ctrl + V) | +| Ctrl + M | Microphone (voice typing) | +| **Chats** | | +| Ctrl + O | Open Chat ... | +| Ctrl + S | Save Chat ... | +| Ctrl + Shift + N | **New** chat | +| Ctrl + Shift + X | **Reset** chat | +| Ctrl + Shift + D | **Delete** chat | +| Ctrl + [ | **Previous** chat (in history) | +| Ctrl + ] | **Next** chat (in history) | +| **Settings** | | +| Ctrl + , | ⚙️ Preferences | +| Ctrl + Shift + M | 🧠 Models | +| Ctrl + Shift + O | 💬 Options (current Chat Model) | +| Ctrl + Shift + + | Increase Text Size | +| Ctrl + Shift + - | Decrease Text Size | +| Ctrl + Shift + / | Shortcuts | `).trim(); diff --git a/src/common/layout/optima/PageBar.tsx b/src/common/layout/optima/PageBar.tsx index 3438f7c85..5c88b5d84 100644 --- a/src/common/layout/optima/PageBar.tsx +++ b/src/common/layout/optima/PageBar.tsx @@ -64,7 +64,7 @@ function CommonPageMenuItems(props: { onClose: () => void }) { {/**/} {/* Preferences |...| Dark Mode Toggle */} - {/*}>*/} + {/*}>*/} Preferences diff --git a/src/common/layout/optima/useOptimaLayout.tsx b/src/common/layout/optima/useOptimaLayout.tsx index d2802a5f6..3cd52a59a 100644 --- a/src/common/layout/optima/useOptimaLayout.tsx +++ b/src/common/layout/optima/useOptimaLayout.tsx @@ -117,8 +117,8 @@ export function OptimaLayoutProvider(props: { children: React.ReactNode }) { // global shortcuts for Optima const shortcuts = React.useMemo((): GlobalShortcutDefinition[] => [ [isMacUser ? '/' : '?', true, true, false, actions.openShortcuts], + [',', true, false, false, actions.openPreferencesTab], ['m', true, true, false, actions.openModelsSetup], - ['p', true, true, false, actions.openPreferencesTab], ], [actions]); useGlobalShortcuts(shortcuts);