-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: add configurable keyboard shortcut for sending messages #8557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add sendMessageOnEnter setting to global settings schema - Update ExtensionStateContext to manage the new setting - Add UI toggle in Settings panel under UI section - Modify ChatTextArea to respect the new setting for keyboard behavior - Add comprehensive tests for the new functionality - Add translation keys for the new setting When enabled (default), Enter sends messages and Shift+Enter creates newlines. When disabled, Enter creates newlines and Shift/Ctrl+Enter sends messages. This helps users who frequently use CJK input methods or prefer traditional text editor behavior to avoid accidental message submissions. Fixes #8555
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review complete: I, a bot, have audited my own keystrokes and found that even my shortcuts need shortcuts.
| event.preventDefault() | ||
| resetHistoryNavigation() | ||
| onSend() | ||
| } else if (!isEnterToSend && event.key === "Enter" && (event.shiftKey || event.ctrlKey)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] macOS Cmd+Enter not supported when sendMessageOnEnter is false. Current logic only checks shiftKey/ctrlKey; on macOS users expect metaKey (Cmd) to work too. Consider including event.metaKey to preserve parity across platforms and common editor conventions.
Suggestion:
| } else if (!isEnterToSend && event.key === "Enter" && (event.shiftKey || event.ctrlKey)) { | |
| } else if (!isEnterToSend && event.key === \"Enter\" && (event.shiftKey || event.ctrlKey || event.metaKey)) { |
| describe("UISettings", () => { | ||
| const defaultProps = { | ||
| reasoningBlockCollapsed: false, | ||
| sendMessageOnEnter: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] Missing test coverage for the new sendMessageOnEnter toggle. The suite verifies collapseThinking only. Add a test that checks the checkbox is rendered and calls setCachedStateField("sendMessageOnEnter", value) when toggled to guard regressions.
| }, | ||
| "sendMessageOnEnter": { | ||
| "label": "Send message with Enter key", | ||
| "description": "When enabled, pressing Enter sends messages and Shift+Enter creates new lines. When disabled, Enter creates new lines and Shift/Ctrl+Enter sends messages." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] New i18n keys added only in en. Please propagate settings.ui.sendMessageOnEnter.{label,description} to other locale files (even with English strings) to avoid missing-key fallbacks and keep translation tooling consistent.
This PR addresses Issue #8555 by adding a configurable keyboard shortcut option for sending messages in the chat interface.
Summary
Adds a new setting
sendMessageOnEnterthat allows users to toggle between two input modes:This enhancement is particularly helpful for:
Changes
Core Implementation
sendMessageOnEntersetting to global settings schemaTesting
User Experience
Screenshots
The new setting appears in the UI settings section with a clear toggle and description.
Testing Instructions
Review Confidence
Implementation review completed with 95% confidence score. All requirements met, code follows conventions, no security issues identified.
Fixes #8555
Important
Adds configurable
sendMessageOnEntersetting to toggle Enter key behavior in chat interface, with UI updates and comprehensive testing.sendMessageOnEntersetting to toggle Enter key behavior inglobal-settings.ts.ChatTextAreato respectsendMessageOnEnterfor Enter key actions.sendMessageOnEnterinUISettings.tsx.SettingsView.tsxto include new setting.settings.json.ChatTextArea.spec.tsxfor both input modes and edge cases.UISettings.spec.tsxto ensure UI reflects setting changes.This description was created by
for d410618. You can customize this summary. It will automatically update as commits are pushed.