From d3ef46f76013571b08b79fad3ffa3d0a70d348d4 Mon Sep 17 00:00:00 2001 From: Matthieu MALVACHE Date: Mon, 23 Mar 2026 15:14:14 +0100 Subject: [PATCH] fix: add copy-to-clipboard feedback and neutralize dark mode background tint Copy source button now shows a checkmark and "Copied" text for 2s after clicking. Dark mode email background blend target changed to perfectly neutral gray (R=G=B) to eliminate perceived color cast on certain displays. --- components/email/email-viewer.tsx | 8 +++++--- lib/color-transform.ts | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/email/email-viewer.tsx b/components/email/email-viewer.tsx index edfd4b6..02505ce 100644 --- a/components/email/email-viewer.tsx +++ b/components/email/email-viewer.tsx @@ -425,13 +425,15 @@ export function EmailViewer({ return source; }; + const [sourceCopied, setSourceCopied] = useState(false); const copySourceToClipboard = async () => { if (!email) return; try { const source = generateEmailSource(email); await navigator.clipboard.writeText(source); - // Could add a toast notification here + setSourceCopied(true); + setTimeout(() => setSourceCopied(false), 2000); } catch { return; } @@ -1753,8 +1755,8 @@ export function EmailViewer({ onClick={copySourceToClipboard} className="flex items-center gap-1.5" > - - {t('copy_source')} + {sourceCopied ? : } + {sourceCopied ? tCommon('copied') : t('copy_source')}