Readable white-on-white mail; forwards carry the original's header

A message written in a dark-mode mail app (or pasted from a dark page) can
set all its text white with no background — invisible on the reading pane's
white page. After a message renders, text whose colour is practically the
colour behind it gets the pane's normal text colour, when a good part of the
message (30% of its text) is invisible. Text hidden on purpose — a help
desk's white ticket reference, a newsletter's hidden preview line — stays
hidden; white on dark, coloured or pictured backgrounds is left as designed
(lib/readability.ts, with tests). The check runs before the quote is folded.

A forward quoted the original under the reply's one line ("On …, Name
wrote:"), without the sender's address. It now opens with the usual block:
Forwarded message, From (name and address), Date, Subject, To, Cc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 21:36:47 +02:00
co-authored by Claude Opus 5.5
parent 5bf8fc81f6
commit f44c7b9e7c
5 changed files with 155 additions and 3 deletions
+4 -2
View File
@@ -37,7 +37,8 @@ export interface ComposerInit {
html?: string; // initial body when reopening an existing draft
draftId?: string; // when reopening an existing draft
attachmentIds?: string[]; // compose-attachment ids when reopening a draft
// A reply/forward quotes the original: this attribution line sits above the
// A reply/forward quotes the original: this attribution (a forward: its header
// block, one line each) sits above the
// quoted message body (fetched from the original message's sanitized HTML).
quote?: { attribution: string; messageId: string };
// A forward: the message whose attachments go along with it.
@@ -472,7 +473,8 @@ export function Composer({
return (
`<div><br></div>` +
`<div class="wmc-quoted">` +
`<div>${escapeHtml(init.quote.attribution)}</div>` +
// One line for a reply; the header block of a forward is several.
`<div>${escapeHtml(init.quote.attribution).replace(/\n/g, "<br>")}</div>` +
`<blockquote>${quoteHtml}</blockquote></div>`
);
}