Skip to content

feat: "Return to submit" keyboard preference (Enter to send, Shift+Enter for newline)#33

Merged
soyasis merged 1 commit into
masterfrom
feat/enter-to-send
Jun 21, 2026
Merged

feat: "Return to submit" keyboard preference (Enter to send, Shift+Enter for newline)#33
soyasis merged 1 commit into
masterfrom
feat/enter-to-send

Conversation

@soyasis

@soyasis soyasis commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

What

Adds an optional "Return to submit" preference (Settings → General). When on, a bare Return submits and Shift+Return inserts a newline. Everywhere the app currently uses ⌘+Return to submit. Off by default, so nothing changes for existing users unless they opt in.

Closes #32.

Why

⌘+Return-to-submit isn't discoverable and doesn't match the muscle memory of chat-style apps. This makes Enter-to-send a global, opt-in preference rather than an Ask-AI-only tweak.

Where it applies

All six submit surfaces, driven by one shared decision:

  • Ask AI box & "New Chat"
  • Result follow-up
  • MCP connector form
  • Destination add/edit form
  • Custom shortcut form
  • Inline LLM directive editor (chain steps)

How

The submit-vs-newline rule lives in one pure function, WindowController.returnSubmitsPrompt(...) , consulted by both keyboard substrates: the floating-window key monitor (Ask AI / follow-up / MCP) and ForwardingTextView (the MultilineTextEditor forms). Rule: only a bare Return submits; Shift/Option/Control+Return insert a newline; ⌘+Return always submits. The setting (CaiSettings.pressReturnToSend) lives in General with a symbol subtitle.

Testing

  • EnterToSendTests — 8 cases over the pure predicate (off/on, bare vs Shift/Option/Control/CapsLock, in/out of a submit screen).
  • Manual: verified all six surfaces in both toggle states — Enter submits when on, ⌘+Return submits in both states, Shift+Return inserts newlines.

Notes

  • In the multi-field forms (MCP / Destinations / Shortcuts), with the setting on a bare Return submits the whole form and Shift+Return inserts a newline — the intended tradeoff for app-wide consistency.
  • Default off → zero behavior change until opted in.

@soyasis soyasis merged commit 973173c into master Jun 21, 2026
1 check passed
@soyasis soyasis deleted the feat/enter-to-send branch June 21, 2026 16:49
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.

Feature Request: Customizable submit shortcut in Ask AI panel

1 participant