feat(chat): add Ctrl+Enter shortcut to send messages

Allows users to send messages using Ctrl+Enter (or Cmd+Enter on Mac)
in addition to the existing Enter key shortcut.
This commit is contained in:
Claude
2026-01-12 09:34:01 +00:00
parent ef1032964c
commit 09d0b06150

View File

@@ -216,8 +216,11 @@ export const MentionEditor = forwardRef<
"prose prose-sm max-w-none focus:outline-none min-h-[2rem] px-3 py-1.5",
},
handleKeyDown: (view, event) => {
// Submit on Enter (without Shift)
if (event.key === "Enter" && !event.shiftKey) {
// Submit on Enter (without Shift) or Ctrl/Cmd+Enter
if (
event.key === "Enter" &&
(!event.shiftKey || event.ctrlKey || event.metaKey)
) {
event.preventDefault();
// Get editor from view state
const editorInstance = (view as any).editor;