feat(composer): Ctrl+Enter / Cmd+Enter sends the open draft

Adds the universal "send with the platform modifier" shortcut every
mainstream mail client (Gmail, Outlook, Apple Mail, Proton, Tutanota,
Fastmail, Thunderbird) supports. Closes #343.

Behaviour:

* Window-level keydown listener registered while the composer is
  mounted. Fires when focus is anywhere inside the composer — chip
  inputs, subject, body textarea, or the rich-text contentEditable.
* Plain Enter is untouched; only Enter + Ctrl (Win/Linux) or Cmd
  (macOS) triggers send. Shift/Alt modifiers are ignored so existing
  autocomplete-confirm / chip-commit Enters are not hijacked.
* Routes through a ref so handleSend's per-render rebind doesn't
  re-register the listener every render.
* All existing send-time validation, attachment-warning, draft-save
  and undo-send flows still apply — the shortcut just calls the
  same handleSend() as the toolbar button.
* Listed in the Keyboard Shortcuts dialog under the existing
  Composer section.

Tested:

* Compose -> type body -> Ctrl+Enter -> Outbox.
* Cc/Bcc autocomplete suggestion + Enter still selects (alt-free
  Enter without Ctrl, so the new listener bails).
* Subject input -> Ctrl+Enter -> sends.
* Body Enter without modifier -> newline.
This commit is contained in:
Shuki Vaknin
2026-05-28 18:23:37 +02:00
committed by Linus Rath
parent e93dd44111
commit 2818a16f06
3 changed files with 26 additions and 1 deletions
+2 -1
View File
@@ -1882,7 +1882,8 @@
"expand_collapse": "Expand/collapse thread"
},
"composer": {
"template_picker": "Open template picker"
"template_picker": "Open template picker",
"send": "Send email"
}
},
"threads": {