feat(json-chat): add 'send on Enter' setting; show active send hotkey on button + placeholder - #83
Merged
Merged
Conversation
… on Send button + placeholder Adds jsonModeSendOnEnter (default off) to the settings slice with the full 5-file wiring (slice + test, persistence, initial state, IPC, backend, types). When on, plain Enter sends in the JSON-mode chat composer and Shift+Enter inserts a newline; when off the historical Cmd/Ctrl+Enter-to-send behavior is preserved. The Send button and placeholder now reflect the active hotkey (⌘↵ vs ↵ on Mac, Ctrl+Enter vs Enter elsewhere) with a screen-reader-friendly aria-label. The keydown handler guards IME composition so Enter during CJK input never sends. The @-mention picker path is untouched — Enter still picks the suggestion while the popover is open. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…er-setting # Conflicts: # src/renderer/components/JsonModeChat.tsx # src/renderer/components/Settings.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jsonModeSendOnEntersetting (default off) so users can opt into the conventional plain-Enter-to-send behavior in the JSON-mode chat composer. When off, the historical Cmd/Ctrl+Enter behavior is preserved. Shift+Enter is honored as the newline shortcut in both modes (just falls through to native textarea behavior).ElectronAPItype.⌘↵/↵on Mac,Ctrl+Enter/Enterelsewhere — and the button carries a screen-reader-friendlyaria-labelspelling it out (Send (Cmd+Enter), etc.).e.nativeEvent.isComposing+keyCode === 229), so Enter during CJK input never sends.Test plan
Send ⌘↵/Send Ctrl+Enter; placeholder readsMessage Claude — Cmd+Enter to send.Send ↵/Send Enter; placeholder readsMessage Claude — Enter to send, Shift+Enter for newline.@to open it, plain Enter still picks the suggestion (doesn't send the message), regardless of the setting.npm run typecheck,npx electron-vite build, andnpx vitest run src/sharedall green.🤖 Generated with Claude Code