Bug 1658157 Comment 14 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Jorg K (CEST = GMT+2) from comment #8)
> I think deleting the auto-complete suggestion/selection is not very intuitive and should only be promoted as the last resort. What do Alex and Thomas think?

+1. Afaics Jörg's patch attachment 9169028 [details] [diff] [review] does exactly the right thing, prevent premature autocompletion while preserving the convenience of pill creation with comma.

- We all agree that we want to make entering addresses convenient by allowing comma to finish a pill. Thanks Magnus for keeping that on the agenda.
- Please note the difference between comma for autocompletion and comma for pill creation!
- As Alex and others on this bug have pointed out, we cannot prescribe/control user's input, and `Doe, John <john@asdf.com>` is a perfectly valid recipient input, as is `Alessandro Castellani, TB UX <foo@bar.com>`, `"Miller, Jane, dep. 45, Anytown City Administration" <jm45@anytown.foo.com>`  and `Koizumi, Jun'ichirō <foo@bar.com>` for our friends from the East who prefer Last name first. No doubt, Thunderbird must respect the standards and provide for these *everyday* use cases. This isn't a matter of personal preference.
- It follows, as Alex and others here have all agreed, that **autocompletion on comma is not possible** (like it or not) because it interferes with legitimate everyday input prematurely. We can't expect users to guess in advance that typing comma will suddenly hijack their input, and when it happens, it's too late.
- Also, autocompletion on comma is *not* very intuitive - I am yet to see a single application which does that, so my theory is that **users would not even try to autocomplete with comma**. Everybody knows autocomplete suggestions must be confirmed with enter or tab to apply. Why would anyone try to type a comma when there's a pending autocomplete selection, given that every known application in this world overwrites text selections when you type another character?
- Having to interrupt typing legitimate input *before typing comma*, delete an autocomplete suggestion which you haven't asked for, and then continue typing, is clearly not discoverable, highly interruptive and error-prone, so we don't want to go there.
- That said, nothing stops us to **allow pill creation on comma for user's convenience**. For that, we have to **ensure that isValidAddress() actually checks accurately for variants of valid recipients**, and does not consider an incomplete address complete; which involves considering double quotes around display name: `"Alessandro Castellani, UX-lead@TB.net, Canada" <foo@bar.com>`.
- isValidAddress() is currently *not* really validating anything:
`return address.includes("@", 1) && !address.endsWith("@");`
https://searchfox.org/comm-central/rev/4ea623bcaa0bc74d148ed3560f7e89ffd01de8d9/mail/base/content/mailWidgets.js#1937-1939
- full email validation regex for email addresses without display name is something like 20 lines. We might get away with less if we apply some fuzzy logics/heuristics, but surely it must cover quoted display names which can contain anything, including what looks like a valid email address, but isn't.
(In reply to Jorg K (CEST = GMT+2) from comment #8)
> I think deleting the auto-complete suggestion/selection is not very intuitive and should only be promoted as the last resort. What do Alex and Thomas think?

+1. Afaics Jörg's patch attachment 9169028 [details] [diff] [review] does exactly the right thing, prevent premature autocompletion while preserving the convenience of pill creation with comma.

- We all agree that we want to make entering addresses convenient by allowing comma to finish a pill. Thanks Magnus for keeping that on the agenda.
- Please note the difference between comma for autocompletion and comma for pill creation!
- As Alex and others on this bug have pointed out, we cannot prescribe/control user's input, and `Doe, John <john@asdf.com>` is a perfectly valid recipient input, as is `Alessandro Castellani, TB UX <foo@bar.com>`, `"Miller, Jane, dep. 45, Anytown City Administration" <jm45@anytown.foo.com>`  and `Koizumi, Jun'ichirō <foo@bar.com>` for our friends from the East who prefer Last name first. No doubt, Thunderbird must respect the standards and provide for these *everyday* use cases. This isn't a matter of personal preference.
- It follows, as Alex and others here have all agreed, that **autocompletion on comma is not possible** (like it or not) because it interferes with legitimate everyday input prematurely. We can't expect users to guess in advance that typing comma will suddenly hijack their input, and when it happens, it's too late.
- Also, autocompletion on comma is *not* very intuitive - I am yet to see a single application which does that, so my theory is that **users would not even try to autocomplete with comma**. Everybody knows autocomplete suggestions must be confirmed with enter or tab to apply. Why would anyone try to type a comma when there's a pending autocomplete selection, given that every known application in this world overwrites text selections when you type another character?
- Having to interrupt typing legitimate input *before typing comma*, delete an autocomplete suggestion which you haven't asked for, and then continue typing, is clearly not discoverable, highly interruptive and error-prone, so we don't want to go there.
- That said, nothing stops us to **allow *pill creation* on comma for user's convenience**, which is what Jörg's patch does, combining convenience with standards.

In a followup bug, we'll want to **ensure that isValidAddress() actually checks accurately for variants of valid recipients**, and does not consider an incomplete address complete; which involves considering double quotes around display name: `"Alessandro Castellani, UX-lead@TB.net, Canada" <foo@bar.com>`.
- isValidAddress() is currently *not* really validating anything:
`return address.includes("@", 1) && !address.endsWith("@");`
https://searchfox.org/comm-central/rev/4ea623bcaa0bc74d148ed3560f7e89ffd01de8d9/mail/base/content/mailWidgets.js#1937-1939
- full email validation regex for email addresses without display name is something like 20 lines. We might get away with less if we apply some fuzzy logics/heuristics, but surely it must cover quoted display names which can contain anything, including what looks like a valid email address, but isn't.

Back to Bug 1658157 Comment 14