feat: email a contact or group via the in-app composer

Adds a "Send email to group" action (To / Cc / Bcc) that opens the composer
pre-filled with the group's members in the chosen field, preserving each
member's display name. It is available both in the group context menu (between
"Edit Group" and "Delete") and in the group detail panel's header (shown when
the group has at least one member with an email). The single-contact "Send
email" button in the contact detail panel uses the same path.

Routing is internal, not via mailto:. Contacts is its own route and the composer
lives in the mail route, so the handoff stashes the recipients
(savePendingMailto) and does a client-side router.push("/"); the main route's
existing consumePendingMailto effect opens the composer in the current account.
This avoids the OS mailto handler (which could open a different mail app) and
the protocol round-trip's full-page reload, which dropped the in-memory
per-account JMAP clients of a multi-account session (a logout).

- contacts/page.tsx: openComposeInApp(recipients, field) shared helper;
  handleComposeGroupFromSidebar (deduped "Name <email>" members, empty -> toast)
  and handleComposeContact; wired to the sidebar, group detail, contact detail.
- contact-group-detail.tsx: onComposeGroup(field) prop + To/Cc/Bcc header control
  (shown when the group has emailable members).
- contacts-sidebar.tsx: onComposeGroup(groupId, field) prop + "Send email to
  group" submenu between Edit and Delete.
- contact-detail.tsx: onCompose() prop; the button is no longer a mailto: link.
- mailto.ts: recipient splitter is quote-aware (reuses the composer's
  splitRecipients) so a comma in a display name survives — still useful for real
  OS mailto: links.
- i18n: contacts.groups.send_email{,_to,_cc,_bcc} and no_member_emails across all
  locales.

Display names round-trip via formatRecipient -> parseRecipientList.
This commit is contained in:
Stefan Hildebrandt
2026-06-19 12:29:43 +02:00
committed by Linus Rath
parent c9eae3b3a1
commit ab3e0e717a
25 changed files with 324 additions and 32 deletions
+6 -1
View File
@@ -2359,7 +2359,12 @@
"members_label": "成员",
"search_members": "搜索联系人以添加...",
"no_members": "该群组中没有成员",
"member_count": "{count, plural, =0 {无成员} one {1 位成员} other {# 位成员}}"
"member_count": "{count, plural, =0 {无成员} one {1 位成员} other {# 位成员}}",
"send_email": "Send email to group",
"send_email_to": "To",
"send_email_cc": "Cc",
"send_email_bcc": "Bcc",
"no_member_emails": "This group has no members with an email address."
},
"import": {
"title": "导入联系人",