From c458091698fb7d386178d48805613fc2923f29d8 Mon Sep 17 00:00:00 2001 From: Lucas Gaitzsch Date: Fri, 8 May 2026 20:41:19 +0200 Subject: [PATCH] add new shortcuts --- components/email/email-composer.tsx | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/components/email/email-composer.tsx b/components/email/email-composer.tsx index f15d681f..4014b937 100644 --- a/components/email/email-composer.tsx +++ b/components/email/email-composer.tsx @@ -1285,6 +1285,40 @@ export function EmailComposer({ } }; + const handleComposerKeyDown = (e: React.KeyboardEvent) => { + if (e.defaultPrevented) return; + + const isPlainEscape = e.key === 'Escape' && !e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey; + const isSendShortcut = e.key === 'Enter' && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey; + if (!isPlainEscape && !isSendShortcut) return; + + if ( + showTemplatePicker || + showSaveAsTemplate || + showScheduleDialog || + smimePassphrasePrompt || + showAttachmentWarning || + showCloseDialog + ) return; + + if (isPlainEscape) { + if (activeAutoField) return; + e.preventDefault(); + handleClose(); + return; + } + + if (isSendShortcut) { + if (e.repeat) { + e.preventDefault(); + return; + } + + e.preventDefault(); + handleSend(); + } + }; + return (
{/* Drag overlay */} {isDraggingOver && (