Skip to content

feat(json-chat): add 'send on Enter' setting; show active send hotkey on button + placeholder - #83

Merged
frenchie4111 merged 2 commits into
mainfrom
json-chat-send-on-enter-setting
May 25, 2026
Merged

feat(json-chat): add 'send on Enter' setting; show active send hotkey on button + placeholder#83
frenchie4111 merged 2 commits into
mainfrom
json-chat-send-on-enter-setting

Conversation

@frenchie4111

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new jsonModeSendOnEnter setting (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).
  • Plumbs the setting through the full 5-file slice checklist: shared slice + test, persistence, initial state, IPC handler in main, backend method, and ElectronAPI type.
  • Composer placeholder and Send button now show the active hotkey — ⌘↵ / on Mac, Ctrl+Enter / Enter elsewhere — and the button carries a screen-reader-friendly aria-label spelling it out (Send (Cmd+Enter), etc.).
  • IME composition guard added (e.nativeEvent.isComposing + keyCode === 229), so Enter during CJK input never sends.
  • The @-mention picker's Enter handler is untouched — it still consumes plain Enter while the popover is open.
  • New toggle in Settings → JSON-mode card (right under Chat density), labelled "Send messages with Enter" with subtext "Plain Enter sends; Shift+Enter inserts a newline. When off, Cmd/Ctrl+Enter sends."

Test plan

  • Default (off): Cmd/Ctrl+Enter sends; plain Enter inserts a newline; Send button shows Send ⌘↵ / Send Ctrl+Enter; placeholder reads Message Claude — Cmd+Enter to send.
  • Toggle on in Settings: plain Enter sends; Shift+Enter inserts a newline; Send button shows Send ↵ / Send Enter; placeholder reads Message Claude — Enter to send, Shift+Enter for newline.
  • IME guard: switch input source to Japanese/Korean, type composing chars + Enter → no send.
  • @-mention picker still works: type @ 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, and npx vitest run src/shared all green.

🤖 Generated with Claude Code

frenchie4111 and others added 2 commits May 25, 2026 12:35
… 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
@frenchie4111
frenchie4111 merged commit 86eec3f into main May 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant