Add "Move to To/Cc/Bcc" to recipient pill context menu
Categories
(Thunderbird :: Message Compose Window, enhancement, P1)
Tracking
(Not tracked)
People
(Reporter: jorgk-bmo, Assigned: aleca)
References
Details
(Keywords: ux-efficiency, ux-minimalism)
Attachments
(1 file, 5 obsolete files)
(deleted),
patch
|
aleca
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #440377 +++
As per bug 440377 comment #216 and before and after.
Assignee | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Alexandro,
Would the same feature be available for a selection of pills? e.g via selection context menu?
To allow move of multiple pills selected (from various fields) at once?
May be nice to have as well perhaps...
Regards,
Assignee | ||
Comment 2•5 years ago
|
||
(In reply to Richard Leger from comment #1)
Would the same feature be available for a selection of pills? e.g via selection context menu?
Yes, absolutely.
Assignee | ||
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Thomas:
1609647-recipient-context.diff → 1609647-recipient-context.patch
Why?
diff
and patch
are handled in the same way by bugzilla, mercurial, and treeherder.
diff
is technically the correct extension that should be used since it works in Phabricator, which we will probably start using sooner or later.
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
Here's a try run to test this: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=a8cd9098d0250ebffb4c91fe952b2d534430378a
Comment 7•5 years ago
|
||
Comment 8•5 years ago
|
||
(In reply to Thomas D. from comment #7)
Auto-focusing rowInput is very irritating, because now it's hard to visually
see the success of moving pills, and also to recover from errors like
accidentally moving them to the wrong field.
Would CTRL+Z allow to quickly cancel selected pills move in case of error... returning pills to original location in selected state... as it was just before triggering move?
Would Undo action also be made available in context menu of pills selection still focus after move?
This might be handy for fast recovery in case of major end-user error spotted immediately :-)
Comment 9•5 years ago
|
||
Comment 10•5 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #9)
Comment on attachment 9126536 [details] [diff] [review]
::: mail/locales/en-US/messenger/messengercompose/messengercompose.ftl
@@ +19,5 @@
(...)+pill-action-move-to =
- .label = Move to To:
Maybe these should be in the form "Move to the To field"
From an end-user point of view, I would suggest to keep "Move to To:" because if make sufficient sense and is easier to read (also take less space)...
It would be read along other possible actions anyway... so unlikely to cause any confusion...
(...)
Move to To:
Move to Cc:
Move to Bcc:
(...)
You could eventually even ditch the trailing colon ':' ...
(...)
Move to To
Move to Cc
Move to Bcc
Move to Reply-To
(...)
You could also separate and regroup some of the actions within horizontal lines in the context menu to make it easier to read/reach when a long list of options possible... I don't know if that is already in place or in the pipeline...
Edit Address
Edit Contact
Move to To
Move to Cc
Move to Bcc
Move to Reply-To
Delete
Assignee | ||
Comment 11•5 years ago
|
||
Uh, so many comments, I'll try to answer everyone while I update the patch.
Thomas
Moved pills should stay selected after moving for a visual success feedback and potential recovery from wrong moves.
Good point, I'll do that.
Cross-field selections
I'll handle this with these options:
- Disable all if a newsgroups or followups pill is currently selected.
- Disable the current one if all the selected pills are part of the same addressing row (all pills from To).
- Don't disable anything if there's cross selection as it makes things easier for us and it doesn't block any action.
Varibale name: Pls use
let selectedPills = []
(Not all, selected only, and it's pill elements.)
We're not selecting pills here but pulling the address string out. I'll rename it to selectedAddresses
.
Can we please rename this method to "deleteSelectedPills(...)"?
Sure.
Auto-focusing rowInput is very irritating...
As you suggested before, we'll keep the focus on the moved pills.
I think here we want "Edit address"
Sure.
Richard
Would CTRL+Z allow to quickly cancel selected pills move in case of error...
I'm not sure about that as we would need to store every single user action and keep a history of what they're doing in order to enable undos.
I think by keeping the moved pills selected, users will immediately see if the action was successful, and having those elements still selected will allow him to put them back where they were.
You could also separate and regroup some of the actions within horizontal lines in the context menu...
Already did that :)
Magnus
Maybe these should be in the form "Move to the To field"
I think we should keep it as "Move to To", etc, as it's short and easy to read. Also, it matches the format we're currently using in the Address Book sidebar (Add to To, Add to Cc, etc).
Comment 12•5 years ago
|
||
(In reply to Alessandro Castellani (:aleca) from comment #11)
Would CTRL+Z allow to quickly cancel selected pills move in case of error...
I'm not sure about that as we would need to store every single user action and keep a history of what they're doing in order to enable undos.
At least the last action if not all...
I think by keeping the moved pills selected, users will immediately see if the action was successful, and having those elements still selected will allow him to put them back where they were.
Your suggestion is not possible if pills were selected from various fields and moved at once...
CTRL+Z would be a must to have not urgent and be implemented last in a follow-up bug...
In Mail tab if I move a message into a sub-folder I can press CTRL+Z to put it back were it was... CTRL+Z may not be easy to implement put should be possible as last feature implemented...
It would be awckward not to allow Undo for selected pills moved in Mail Compose Window...
Assignee | ||
Comment 13•5 years ago
|
||
Mh, yeah, if we limit the Undo to only the most recent pill movement, I think it could be implemented.
I'll see if it's doable in this patch, otherwise I'll do a follow up.
Comment 14•5 years ago
|
||
(In reply to Alessandro Castellani (:aleca) from comment #11)
Awesome! Looking forward to next iteration.
Assignee | ||
Comment 15•5 years ago
|
||
Patch updated.
This is a quick recap of the context menu when pills are selected:
- Disable all items if a newsgroups or followup pill is currently selected.
- Disable the current item target if all the currently selected pills are part of the same addressing row (eg. all pills are from the
To
field). - Don't disable anything if there's cross selection (various pills are selected from multiple addressing rows) as it makes things easier for us and it doesn't block any action for the user.
I tried to shrink the code as much as possible by using map()
and filter()
but without success.
I don't why but I couldn't properly filter that array and ended up using a simple for()
loop.
Assignee | ||
Comment 16•5 years ago
|
||
A little update to move the focus to the last selected pill.
Sorry for the noise.
Comment 17•5 years ago
|
||
Comment 18•5 years ago
|
||
Assignee | ||
Comment 19•5 years ago
|
||
Thanks both for the feedback and review. While I'm updating everything accordingly, here's some comments:
I'm failing to understand the explanation, and I think this is wrong.
I did that as a workaround to avoid the issue of not having the pill selected when the right click happens.
Unfortunately, the context menu gets triggered before the pill gets selected if clicking with the right mouse button on an unselected pill.
I solved this issue by triggering the update of the context menu only on specific occasions, and avoided this "hack".
Micro-performance: You are iterating all selected pills (which might be hundreds, even hundreds of the same type) just to find out if one of each type exists.
Good point, I changed it.
Shouldn't such functions live in mailWidgets.js? I'm failing to see the structural difference between removeSelectedPills() and moveSelectedPills() that would force us to keep them in different files.
Yes, I think some of those methods can be moved inside the CE.
I think this is mostly a leftover from the old code, where we had all the addressing functions inside the addressingWidgetOverlay.
I think I'll move the moveSelectedPills()
method inside the CE, but for a more targeted code clean up we can maybe deal with it in a dedicated bug.
let selectedAddresses = [...document.getElementById("recipientsContainer").getAllSelectedPills()].map(pill => pill.fullAddress);
This is good, thanks.
Assignee | ||
Comment 20•5 years ago
|
||
Comment 21•5 years ago
|
||
Assignee | ||
Comment 22•5 years ago
|
||
Patch updated and try run launched: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=e3144aee87d6a4764b73ae13713a441fecbff2f1
which is deprecated. can you switch to key? I'm not sure what 3 means
event.key
doesn't carry which button is pressed on the mouse as I need to listen to the right click.
I've updated it with event.button
.
Assignee | ||
Comment 23•5 years ago
|
||
Fixed a tiny eslint error spotted from the try run.
Assignee | ||
Updated•5 years ago
|
Comment 24•5 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/1355f132539c
Add 'Move to To/Cc/Bcc' to recipient pill context menu. r=mkmelin
Comment 25•5 years ago
|
||
Assignee | ||
Comment 26•5 years ago
|
||
(In reply to Thomas D. from comment #25)
Please, avoid giving an r- on a bug that was approved by the technical director.
It's confusing and doesn't bring any benefit.
You can add a follow-up patch to clean up what just landed.
You have an almost identical condition running
emailAddressPillOnPopupShown() again below, isn't there something
Nothing wrong there as the first condition is necessary to interrupt the toggle of the selected attribute in case this is already selected, and we need to trigger the visual update of the context menu.
The second condition is in case the code went through and only the detection of which button was clicked needs to be verified.
That's still checking for unlimited numbers of matching elements just to
find if there is one.
We're done if we find just one which is selected
Sure, we can update it if we want, but the newsgroups and newsletters will always have a limited amount of pills.
I don't see anyone sending the same email to 100+ newsletters.
Also, I think we shouldn't use backticks.
We're following the Prettier code formatting which requires backticks.
use .forEach as above
Nope, forEach
is slower than for
.
We should really stop hardcoding this ID, and have those functions inside
the CE.
Some of these functions will only be used in this location, since the addressingWidgetOverlay.js file is only for the messenger compose window.
Is not a mistake per se retrieving the container via its ID, but as I said, you can do a follow up to clean up the code.
::: mail/themes/shared/mail/messengercompose.css
@@ +530,1 @@padding-block: 4px;
Is this causing the pill input border to expand on editing, which in turn
causes the entire row to expand vertically? Can we try to avoid such shaking
of the UI?
This is actually fixing the issue as we're styling only the first child of the address-container, as you can see from the CSS diff.
Assignee | ||
Updated•5 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Description
•