fix(email): sender popover Email action opens in-app composer instead of mailto:
Publish Docker Image / prepare (push) Successful in 1s
Publish Docker Image / build (linux/amd64, ubuntu-latest) (push) Failing after 1m7s
Publish Docker Image / build (linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Publish Docker Image / merge (push) Canceled after 0s

This commit is contained in:
2026-08-23 17:24:29 +02:00
parent 424dba39f7
commit 33ca4bae37
+21 -3
View File
@@ -2,11 +2,14 @@
import { useState, useRef, useEffect } from "react";
import { createPortal } from "react-dom";
import { useRouter } from "next/navigation";
import { Mail, Phone, Building, ExternalLink, Copy, Send, UserPlus } from "lucide-react";
import { Avatar } from "@/components/ui/avatar";
import { cn } from "@/lib/utils";
import { useContactStore, getContactDisplayName } from "@/stores/contact-store";
import { toast } from "@/stores/toast-store";
import { savePendingMailto, notifyPendingMailto } from "@/lib/protocol-handlers/session";
import { formatRecipient } from "@/lib/email-composer-utils";
import type { ContactCard } from "@/lib/jmap/types";
interface RecipientPopoverProps {
@@ -125,6 +128,21 @@ export function RecipientPopover({ name, email, displayLabel, onViewContact, cla
}
};
const router = useRouter();
const handleCompose = () => {
savePendingMailto({
to: [formatRecipient(contactName, email)],
cc: [],
bcc: [],
subject: "",
body: "",
});
notifyPendingMailto();
router.push("/");
handleClose();
};
return (
<>
<button
@@ -210,14 +228,14 @@ export function RecipientPopover({ name, email, displayLabel, onViewContact, cla
<Copy className="w-3.5 h-3.5" />
Copy
</button>
<a
href={`mailto:${email}`}
<button
onClick={handleCompose}
className="flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground px-2 py-1.5 rounded hover:bg-muted transition-colors"
title="Send email"
>
<Send className="w-3.5 h-3.5" />
Email
</a>
</button>
{onViewContact && (
<button
onClick={handleViewContact}