Offline compose: write mail offline, Scheduled folder, undo countdown fix

Compose, Reply and Forward work offline. Drafts are kept on the device
(IndexedDB, lib/scheduled.ts), with files attached offline; Send becomes
"Schedule" and puts the message in a new Scheduled folder. When the server
is reachable again, scheduled messages are sent through the normal outbox
(Undo offered for a single one) and offline drafts become server drafts —
files uploaded first, each step recorded so nothing is created or sent
twice, under a Web Lock so two tabs never send the same message. Drafts
written offline show in Drafts as "On this device". Sign-out sends what
is scheduled, then wipes the device's copy.

Also: offline failures from keyboard shortcuts show "Not available
offline"; no recipient suggestions are asked for offline; a reply no
longer quotes an error page when the original is not saved.

The undo countdown counted to the server's deadline on the browser's
clock, so a few seconds of skew showed (18 s instead of 10). /send now
also returns undo_seconds, and the composer counts down from that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-05 21:11:41 +02:00
co-authored by Claude Opus 5.5
parent c9c24e7e2f
commit e1bda37188
14 changed files with 808 additions and 107 deletions
+13
View File
@@ -556,6 +556,19 @@ export const en = {
"offline.notAvailable": "Not available offline",
"offline.threadNotSaved": "This conversation isn't saved on this device.",
"offline.folderNotSaved": "This folder isn't saved on this device.",
"offline.noticeScheduled": "Saved to Scheduled — it will be sent when you're back online.",
"offline.noticeSendingScheduled": "Sending {count} scheduled messages…",
"offline.draftsNotSaved": "Only drafts written on this device are available offline.",
"compose.sendLater": "Schedule",
"compose.savedOnDevice": "Saved on this device",
"compose.attachOnDevice": "On this device — uploaded when you're back online",
"compose.onDevice": "On this device",
"nav.scheduled": "Scheduled",
"scheduled.help": "Sent automatically when you're back online.",
"scheduled.empty": "Nothing scheduled.",
"scheduled.waiting": "Waiting",
"scheduled.sending": "Sending…",
"scheduled.failed": "Not sent",
"offline.searchPlaceholder": "Search (offline)",
"offline.cantReach": "Can't reach the server.",
"offline.settingTitle": "Offline access",