feat: message ux improvements (#52)

* 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.

* fix(chat): disable autofocus on message editor

Prevents keyboard from popping up automatically on mobile devices.

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Alejandro
2026-01-12 10:43:59 +01:00
committed by GitHub
parent ef1032964c
commit bff51857d6
2 changed files with 6 additions and 4 deletions

View File

@@ -423,7 +423,6 @@ export function ChatViewer({
handleSend(content, replyTo);
}
}}
autoFocus
className="flex-1 min-w-0"
/>
<Button

View File

@@ -47,7 +47,7 @@ export const MentionEditor = forwardRef<
placeholder = "Type a message...",
onSubmit,
searchProfiles,
autoFocus = true,
autoFocus = false,
className = "",
},
ref,
@@ -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;