populateComposeFrom (compose.js)

agenticmail ยท email

Gmail-style bottom-right compose popup. Handles both new-message and reply flows. `wake` is the AgenticMail selective-wake hint. Draft autosave: every keystroke on the to / cc / subject / body fields schedules a 2s-debounced save to `/drafts`. First save POSTs and stores the retu

// Source: https://github.com/agenticmail/agenticmail | License: MIT | Copyright 2026 Ope Olatunji
// Provided via justclaw.it.com; keep this notice with the code.
// Gmail-style bottom-right compose popup. Handles both new-message
// and reply flows. `wake` is the AgenticMail selective-wake hint.
//
// Draft autosave: every keystroke on the to / cc / subject / body
// fields schedules a 2s-debounced save to `/drafts`. First save
// POSTs and stores the returned id; subsequent saves PUT to that
// id. On Send, the draft (if any) is deleted after the send
// succeeds โ€” otherwise it stays around so the user can find it
// in the Drafts folder.
import { state } from './state.js';
import { escapeHtml, toast } from './utils.js';
import { apiGet, apiPost, apiPut, apiDelete } from './api.js';
imp

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key