feat(thread): WhatsApp-style reply rendering — new text only, with quoted preview of the original#44
Open
Aravinda-HWK wants to merge 1 commit into
Open
Conversation
…nGovMail#43) Replies in a conversation now read like chat instead of classic email: - Reply bubbles show only the newly written content. Plain text was already stripped via stripQuotedText; rich-HTML replies now go through a new stripQuotedHtml helper that removes only known reply-quote containers (Gmail gmail_quote, Apple Mail blockquote[type=cite], Outlook divRplyFwdMsg and everything after it, and this app's own attribution + blockquote). Unrecognised formats are left untouched and a quote-only reply is never blanked. Forwards carry no In-Reply-To, so their quoted content — which is the message — stays intact - Richness is judged on the stripped body, so a short reply quoting a newsletter renders as a chat bubble instead of a full-width document card - The replied-to message appears as a quoted preview chip at the top of the bubble (accent bar, original sender's name, two-line snippet), resolved by matching In-Reply-To against the thread's Message-IDs with bracket normalisation. Clicking it (keyboard accessible) smooth-scrolls to the original message and pulses a highlight; no chip when the original isn't in the loaded conversation - ThreadMessage carries inReplyTo from the existing Message DTO; optimistic local replies are tagged with it so the chip appears immediately on send Server fix uncovered while testing: outgoing In-Reply-To/References headers were written with the bare message-id the client sends (the IMAP fetch path strips angle brackets). A bracket-less header is malformed per RFC 5322 and strict parsers — including our own read path — drop it, so replies sent from this app never resolved their parent. sender.go now wraps outgoing ids in the required angle brackets (ensureMsgID).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #43
Summary
Replies in a conversation now read like chat: the bubble shows only the newly written text, and the message being replied to appears as a compact WhatsApp-style quoted preview at the top of the bubble — click it to jump to the original.
Also includes a server-side threading fix discovered while testing (see below) — replies sent from this app were producing malformed
In-Reply-Toheaders.What changed
Reply bodies show only the new content
stripQuotedText); rich-HTML replies now go through a newstripQuotedHtmlhelper (src/nonview/email/quotedHtml.ts) that removes only known reply-quote containers: Gmail'sgmail_quote, Apple Mail'sblockquote[type=cite], Outlook'sdivRplyFwdMsgblock (plus everything after it), and this app's own attribution-paragraph + blockquoteIn-Reply-To, and the forwarded body is the messageisRichHtml) is now judged on the stripped body, so a two-line reply quoting a newsletter renders as a chat bubble instead of a full-width document cardQuoted preview chip
In-Reply-Toagainst the thread's Message-IDs (angle-bracket differences normalised);ThreadMessagenow carriesinReplyTofrom the existingMessageDTO — no API changes neededdata-message-key)inReplyTo, so the chip appears the moment you hit sendServer fix: malformed outgoing threading headers
The client sends the parent's Message-ID without angle brackets (the IMAP fetch path strips them), and
smtp/sender.gowrote that raw value intoIn-Reply-To/References. That's malformed per RFC 5322 — strict parsers (including our own read path viaMsgIDList) drop the header entirely, which is why replies sent from this app never resolved their parent while Gmail-composed replies did.ensureMsgIDnow wraps outgoing ids in the required<…>brackets.Testing
pnpm typecheck/pnpm build✅go build ./.../go vet ./.../go test ./...✅