Skip to content

Composer & Rich Text Editor

Message Composition & Rich Text Editor

The DodaMail Composer (Composer.tsx) is a distraction-free, professional email authoring suite. It combines a rich text formatting engine (RichTextEditor.tsx), smart auto-complete for contacts, intelligent forgotten-attachment detection, scheduled delivery, and a 5-second safety undo window.


The Composer Window Architecture

You can launch the composer by clicking the + Compose button on the sidebar or pressing Ctrl+N (Cmd+N). It can run as a floating docked window in the bottom-right or maximized to full-screen.

Control-by-Control Breakdown of Composer Elements

# Control Name Control Type Default State Behavior & Purpose
1 From Account Selector Dropdown Selector Default Account Selects which configured identity and SMTP server will transmit the email. Changing the account automatically updates the default signature attached to the message.
2 “To” Recipient Field Autocomplete Pill Input Empty Accepts destination email addresses. As you type, searches your local contacts database and frequent recipients with auto-complete. Displays VIP badges next to starred contacts.
3 “Cc” Toggle Button Text Button Hidden Reveals the Carbon Copy (Cc) recipient input line.
4 “Bcc” Toggle Button Text Button Hidden Reveals the Blind Carbon Copy (Bcc) recipient line.
5 Subject Line Text Input Empty The subject line of your message. Supports emojis and international characters.
6 AI Subject Generator (Magic Wand) Action Icon Button Enabled Analyzes the text currently written in the email body and generates three high-conversion, professional subject line suggestions.
7 Formatting Toolbar Toggle (A) Icon Button Active (Visible) Toggles visibility of the Rich Text formatting toolbar.
8 Attach File Button (Paperclip) File Picker Trigger Enabled Opens the OS native file dialog to attach documents, images, archives, or PDFs. Also supports dragging and dropping files directly into the window.
9 Insert Template / Snippet Drawer Icon Button Enabled Opens a slide-out drawer containing your pre-written canned response templates and dynamic variable snippets.
10 Signature Selector Dropdown Menu Account Default Allows switching between different pre-configured signatures (e.g., Corporate HTML, Brief Mobile, or None).
11 Schedule Send Button (Clock) Icon Button Enabled Opens the Schedule Send Dialog to defer delivery to a specific future date and time.
12 AI Proofreader Button Icon Button Enabled Launches the inline spelling, grammar, tone, and cliché analyzer.
13 Discard Draft Button (Trash) Danger Icon Button Enabled Deletes the work-in-progress draft. If text has been typed, prompts the Discard Confirmation Modal to prevent accidental data loss.
14 “Send Email” Button Primary Action Button Enabled Transmits the email immediately via SMTP (Ctrl+Enter). Initiates the 5-second Undo Send timer.

The Rich Text Formatting Toolbar (RichTextEditor.tsx)

DodaMail provides a full-featured WYSIWYG editor supporting standard semantic HTML output. Every tool button on the editor toolbar is detailed below:

Icon / Tool Tool Name Shortcut Output / Effect
B Bold Ctrl+B Wraps selected text in <strong> tags for heavy emphasis.
I Italic Ctrl+I Wraps selected text in <em> tags for italicized emphasis.
U Underline Ctrl+U Underlines selected text using <u>.
S Strikethrough Ctrl+Shift+X Applies strike-through line via <del> tags.
H1 Heading 1 Ctrl+Alt+1 Formats selection as a major title block (<h1>).
H2 Heading 2 Ctrl+Alt+2 Formats selection as a section subheading (<h2>).
Paragraph Ctrl+Alt+0 Converts selection back to normal body text (<p>).
•= Bulleted List Ctrl+Shift+8 Inserts an unordered bullet list (<ul><li>...</li></ul>).
1.= Numbered List Ctrl+Shift+7 Inserts an ordered numeric list (<ol><li>...</li></ol>).
“” Quote Block Ctrl+Shift+9 Indents and styles selected text as a blockquote (<blockquote>).
</> Code Block Ctrl+Alt+C Creates a monospaced syntax block for snippets (<pre><code>).
c Inline Code Ctrl+ ` Applies inline monospaced styling to terms or commands.
🔗 Insert Link Ctrl+K Opens link dialog asking for Display Text and Destination URL (href).
🎨 Text Color Palette Opens color swatch picker to change text foreground color.
🖍 Highlight Color Palette Changes background highlight color for marked text.
⇤ Align Left Ctrl+Shift+L Aligns paragraph text to the left margin.
≡ Align Center Ctrl+Shift+E Centers paragraph text.
⇥ Align Right Ctrl+Shift+R Aligns paragraph text to the right margin.
▦ Insert Table Grid Picker Lets you select rows and columns (e.g., 3x3) to insert a styled responsive table.
🧹 Clear Formatting Ctrl+\ Strips all styling, fonts, colors, and links, resetting to plain text.
↩ Undo Ctrl+Z Reverts the last typing or formatting change.
↪ Redo Ctrl+Y Re-applies the previously undone modification.

Dialogs Associated with the Composer

1. The Forgotten Attachment Guard (ForgottenAttachmentModal.tsx)

If your message body contains phrases indicating attachments (e.g., “please find attached”, “I have attached”, “see attached file”, “enclosed invoice”), but you attempt to click Send without adding any files, DodaMail intercepts the action and displays this safety prompt:

Controls on the Forgotten Attachment Dialog

  • Detected Keyword Alert: Highlights the specific sentence that triggered the alert (e.g., "I have attached the spreadsheet").
  • “Attach Files” Button: Cancels transmission and immediately launches the OS file browser so you can select the intended document.
  • “Send Anyway” Button: Overrides the warning and delivers the email without attachments.
  • “Cancel” Button: Closes the modal and returns focus to the editor.

2. Discard Draft Confirmation Dialog

To prevent catastrophic accidental data loss when closing or clicking Discard on a composed email with content:

  • “Keep Editing” Button: Dismisses the dialog and keeps your draft intact in the editor.
  • “Discard Draft” Button: Deletes the temporary draft from the local SQLite storage and closes the composer window.

3. Attachment Lightbox Modal (AttachmentLightboxModal.tsx)

Clicking any attached image, PDF, or media file in either the Composer or Thread View opens the Attachment Lightbox:

Controls in the Lightbox

Control Name Icon / Key Action
Zoom In / Zoom Out + / - Scales the visual preview smoothly from 25% to 400%.
Rotate ↻ Rotates the image orientation 90 degrees clockwise.
Download File Download Icon Prompts OS “Save File As” dialog to save the file locally.
Copy to Clipboard Copy Icon Copies the rendered image data directly to your clipboard.
Fullscreen Expand Icon Toggles distraction-free full-screen inspection mode.
Close Esc / X Closes the lightbox view.

The 5-Second Undo Send Window

When you click Send or press Ctrl+Enter, DodaMail holds the message in an active volatile memory queue for 5 seconds before opening the SMTP socket:

+-----------------------------------------------------------+
| (i) Sending message... [ Undo (4s) ]                 [ X ]|
+-----------------------------------------------------------+
  • “Undo” Button: Immediately halts the transmission pipeline, returns the email to the composer editor, and removes the pending job from the dispatch queue.
  • Auto-Dismiss: Once the countdown reaches 0, DodaMail opens the encrypted TLS connection to your SMTP server, sends the MIME payload, and saves a local copy in your Sent folder.