Composer: smarter suggestions, links over selections, big images attached
ci / node (pull_request) Skipped
ci / version (pull_request) Skipped
ci / docker-build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 3m5s
ci / announce (pull_request) Skipped

Recipient suggestions:
- the words typed match in any order, each one the start of a word in the
  name, a nickname, the organization or the address: "jane smi" finds
  "Smith, Jane", and "globex" finds the people at Globex;
- someone written to lately ranks a little above an equal match;
- an address already in To, Cc or Bcc is no longer offered in the other
  two fields.

Pasting:
- a single web or mailto address pasted over selected words makes those
  words the link, instead of replacing them with the address;
- a pasted or dropped image over 10 MB goes in as an attachment rather
  than inline, where it would swell every reply.

No new strings.
This commit is contained in:
jcoffey-dev committed 2026-10-05 11:52:54 -07:00
1 parent 3434a5ed39
commit b11f3997d4
7 files changed
+275 -15

No files matched your search

+5 -3
View File
@@ -12,9 +12,11 @@ interface Props {
placeholder?: string;
autoFocus?: boolean;
id?: string;
/** Addresses already in the message's other recipient fields, not to be suggested again. */
exclude?: EmailAddress[];
}
export function RecipientInput({ value, onChange, placeholder, autoFocus, id }: Props) {
export function RecipientInput({ value, onChange, placeholder, autoFocus, id, exclude }: Props) {
const [text, setText] = useState("");
const [sugg, setSugg] = useState<Suggestion[]>([]);
const [active, setActive] = useState(0);
@@ -34,7 +36,7 @@ export function RecipientInput({ value, onChange, placeholder, autoFocus, id }:
const t = window.setTimeout(() => {
void suggest(q).then((list) => {
if (id !== reqId.current) return;
const existing = new Set(value.map((v) => v.email.toLowerCase()));
const existing = new Set([...value, ...(exclude ?? [])].map((v) => v.email.toLowerCase()));
const filtered = list.filter((s) => !existing.has(s.email.toLowerCase()));
setSugg(filtered);
setActive(0);
@@ -42,7 +44,7 @@ export function RecipientInput({ value, onChange, placeholder, autoFocus, id }:
});
}, 120);
return () => window.clearTimeout(t);
}, [text, suggest, value]);
}, [text, suggest, value, exclude]);
const commit = (raw?: string) => {
const s = (raw ?? text).trim().replace(/[,;]+$/, "");