Skip to content

Email for professionals and teams

Fix recipient-display test bundling and contain email paint in reader

Hieu Nguyen (Jack)b5bd28280bdd
diff --git a/src/components/messages/email-html-renderer.tsx b/src/components/messages/email-html-renderer.tsx
index a30d652..ea0ef4a 100644
--- a/src/components/messages/email-html-renderer.tsx
+++ b/src/components/messages/email-html-renderer.tsx
@@ -5,7 +5,7 @@ import { prepareEmailHtml } from "@/lib/email/html";
import { collapseQuotedEmailHtml } from "@/app/(dashboard)/inbox/[messageId]/quote-collapse-utils";
const BASE_STYLE = `
-:host { display:block; min-width:0; isolation:isolate; }
+:host { display:block; min-width:0; isolation:isolate; contain:paint; }
.email-quote-toggle { margin-top:1.4em; }
.email-quote-toggle > summary { cursor:pointer; list-style:none; width:26px; border-radius:20px; background:#ececec; text-align:center; }
.email-quote-toggle > summary::-webkit-details-marker { display:none; }
diff --git a/tests/recipient-display.test.mjs b/tests/recipient-display.test.mjs
index c78da9e..727ee85 100644
--- a/tests/recipient-display.test.mjs
+++ b/tests/recipient-display.test.mjs
@@ -21,7 +21,8 @@ async function bundle(entry, outfile) {
format: "esm",
target: "node22",
logLevel: "silent",
- alias: { "@": join(root, "src") },
+ // The DOM-only HTML pipeline is not needed here and its parser deps do not bundle for node.
+ alias: { "@/lib/email/html": join(root, "tests/stubs/email-html.mjs"), "@": join(root, "src") },
external: ["react", "react-dom", "next", "next/*"],
});
return import(pathToFileURL(join(outDir, outfile)).href);
diff --git a/tests/stubs/email-html.mjs b/tests/stubs/email-html.mjs
new file mode 100644
index 0000000..a4488d1
--- /dev/null
+++ b/tests/stubs/email-html.mjs
@@ -0,0 +1 @@
+export const resolveEmailCidUrls = (html) => html;