thread fix

This commit is contained in:
debu-2 2026-10-06 05:03:33 +05:30
parent a58ba11566
commit d0fee5c8f7
6 changed files with 262 additions and 34 deletions

View file

@ -44,6 +44,7 @@ import {
labelCounts,
matchesLens,
} from "../utils/inboxSignals";
import { buildReplyBodyHtml } from "../utils/emailReply";
const PAGE_SIZE = 25;
const CATEGORY_TABS = [
@ -86,15 +87,12 @@ function buildReplyContext(message, replyAll = false) {
const sender = message?.sender || { name: "", address: "" };
const subject = (message?.subject || "").trim();
const replySubject = /^re:/i.test(subject) ? subject : `Re: ${subject || "(No subject)"}`;
const quote = (message?.new_reply_content || message?.body_text || message?.snippet || "").trim();
return {
replyToMessageId: message.id,
replyAll,
to: replyAll ? [] : [{ email: sender.address, name: sender.name }],
subject: replySubject,
bodyHtml: quote
? `<p><br></p><blockquote>${quote.replace(/\n/g, "<br>")}</blockquote>`
: "<p><br></p>",
bodyHtml: buildReplyBodyHtml(message),
};
}
@ -781,7 +779,7 @@ export default function MailboxView({
const target = threadDetail?.messages?.[threadDetail.messages.length - 1] || detail;
onCompose?.({
subject: `Fwd: ${target?.subject || ""}`,
bodyHtml: `<p><br></p><blockquote>${(target?.new_reply_content || target?.body_text || target?.snippet || "").replace(/\n/g, "<br>")}</blockquote>`,
bodyHtml: buildReplyBodyHtml(target),
});
}}
onExtractActions={() => detail && extractActions(detail)}