Skip to content

feat(mail): suggest recipients from contacts - #3859

Open
tammi-23 wants to merge 2 commits into
mainfrom
feat/mail-recipient-suggestions
Open

tammi-23 wants to merge 2 commits into
mainfrom
feat/mail-recipient-suggestions

Conversation

@tammi-23

Copy link
Copy Markdown
Contributor

Description

Suggests recipients from the contacts while composing an email:

  • Typing at least two characters in To, CC or BCC shows matching contacts (name and email) of the account of the selected sender. Contacts with several email addresses offer each address.
  • Matching is done on the beginning of the name, the email address or one of their words (e.g. "love" finds Ada Lovelace, "navy" finds grace.hopper@navy.example).
  • Suggestions can be picked with the mouse or the keyboard (↑ / ↓, Enter, Escape) and replace the recipient currently being typed; the recipients stay a comma separated list, so free input of any address still works.
  • The input follows the ARIA combobox pattern (role="combobox", aria-expanded, aria-activedescendant, listbox with options).

New: MailRecipientInput.vue (used for To / CC / BCC) and useRecipientSuggestions.

Deviation from the issue: the issue asks for debounced search requests. The mail server's contact filters (name, email) only match whole words, though: "ad" finds nothing, "ada" finds Ada. That doesn't work for suggestions while typing. Instead, the contacts of the account are loaded once (up to 1000, cached for 5 minutes per account) and filtered locally, so typing doesn't send any requests. Loading is cancelled when a newer search starts. Once the backend supports prefix search (or a directory search, see #3844), this can switch to server-side search.

This PR only touches the mail app and is independent of the other contacts PRs.

Related Issue

How Has This Been Tested?

  • test environment: local docker dev stack, OpenCloud built from groupware (with the local patches listed in Contacts MVP #3844), Stalwart 0.16.12, Chrome
  • test case 1: New message → type "ka" in To → both addresses of Katherine Johnson are suggested
  • test case 2: ↓ + Enter → the second address is inserted, followed by ", "; typing "gr" → Grace Hopper is suggested; Enter → k.johnson@nasa.example, grace@example.org,
  • test case 3: Escape closes the suggestions; typing one character doesn't show suggestions
  • test case 4: Only one request per account while typing several terms (network log)
  • test case 5: unit tests for building and filtering the suggestions, loading / caching and the input component (search term, listbox, mouse and keyboard selection, escape)
  • test case 6: pnpm check:types, pnpm lint, pnpm format:check

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@tammi-23 tammi-23 self-assigned this Oct 17, 2026
@tammi-23 tammi-23 mentioned this pull request Oct 17, 2026
2 of 20 tasks
Typing in To, CC or BCC suggests matching contacts of the selected account. Suggestions can be picked with mouse or keyboard and replace the recipient being typed.
@tammi-23
tammi-23 force-pushed the feat/mail-recipient-suggestions branch from 1e63c9d to 358a30b Compare October 23, 2026 14:18
@tammi-23 tammi-23 mentioned this pull request Oct 23, 2026
2 of 20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recipient suggestions from contacts in the mail app

1 participant