Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split paste into address fields by commas #252

Merged
merged 1 commit into from
Nov 24, 2024
Merged

Conversation

mattfbacon
Copy link
Contributor

@mattfbacon mattfbacon commented Nov 23, 2024

If the user has a list of addresses in the clipboard and pastes it in, split the input to have one field for each comma-separated entry. This is more user-friendly.

I don't know if there are cases where a comma in the field is necessary, but if so we could possibly add a workaround by holding a key, e.g. Ctrl+Shift+V for "raw paste" without the splitting behaviour.

@mattfbacon
Copy link
Contributor Author

PS we could also make it so in general if you type "," (or ", ") in the address field it creates a new one for you.

@mjl- mjl- merged commit 501f594 into mjl-:main Nov 24, 2024
2 checks passed
@mjl-
Copy link
Owner

mjl- commented Nov 24, 2024

This is great, thanks!
I needed this a few days ago to send to a longish list of addresses, but because it wasn't easy enough to do with the webmail, I sent with Thunderbird.

Comma-handling could indeed be better. Some people use "Lastname, Firstname" as their display name. You could end up pasting "Lastname, Firstname" <[email protected]>, which would now get split up unintentionally. It would be good to fix that, but pasting multiple comma-separated addresses will be more common, so I consider the new behaviour more helpful. To display names and addresses more completely, we could perhaps add an API method that uses existing Go code for parsing message headers containing addresses. I think it will recognize display names with double quotes and so on, and return a parsed list of addresses.

I'm also liking the idea of ',' to add another field. I don't think there's a need to ever write a literal comma in that field. Thunderbird also handles ',' to finish the address and start a new one.

@mattfbacon
Copy link
Contributor Author

mattfbacon commented Nov 24, 2024

Glad you like it. To be clear, are you planning to now work on what you described?

Btw those rules for email parsing are fairly easy to implement in JS I think. I would be concerned about latency and other issues because I already have the server connection drop out relatively regularly while I'm composing a message.

@mattfbacon
Copy link
Contributor Author

Could also be done as paste, send entire pasted string to API for security bar info, API sends info for all addresses back nicely split for us, and we modify the UI accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants