"Mark all messages of an account read" feature needs confirmation, or undo option to reverse dataloss
Categories
(Thunderbird :: Mail Window Front End, enhancement)
Tracking
(Not tracked)
People
(Reporter: mkmelin, Assigned: aleca)
References
Details
Attachments
(1 file, 3 obsolete files)
1.79 KB,
patch
|
jorgk-bmo
:
review+
|
Details | Diff | Splinter Review |
Comment 1•7 years ago
|
||
Undo may have horrible performance implications, so I suspect that won't be a viable option.
I'm suprised Richard gave UI approval in Bug #317301 on such a dangerous, horrible undoable action - IIRC we have required such confirmations for other potentially dangerous functions - and left confirmation to a follow up. Good thing the action is only available on the account name. I rarely click on account name, so I hope most users are the same.
Reporter | ||
Comment 2•7 years ago
|
||
Alex, maybe you can take this as as one of the things to get familiar with the code base.
Assignee | ||
Comment 3•7 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #2)
Alex, maybe you can take this as as one of the things to get familiar with the code base.
Aye aye captain!
Any guidelines or behaviors to follow in terms of dealing with a confirmation dialog?
Is there any styled component already built or something similar I should leverage instead of building something from scratch?
Assignee | ||
Updated•7 years ago
|
Reporter | ||
Comment 4•7 years ago
|
||
You should just use a standard dialog for the confirmation. There are variants and it's possible to change standard buttons just by setting flags.
Something like https://searchfox.org/comm-central/rev/8a64171478a67b80775e23c37992cdf1dbd99e54/mail/extensions/mailviews/content/mailViewList.js#49
Assignee | ||
Comment 5•7 years ago
|
||
Here's the patch with the confirmation message.
A couple of questions related to what I did:
In the example code you shared, a variable is created through the Services class in order to tap the translatable string:
var bundle = Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
I noticed that in the mailWindowOverlay.js
file, the strings are already available in the document and selectable with a:
var bundle = document.getElementById("bundle_messenger");
I opted for the query selector, but of course let me know if we should follow one approach and which one is better.
Also, I added the translatable strings in the messenger.properties
files. Do I have to do anything else? How can I test and confirm those new strings are translatable?
Cheers
Reporter | ||
Comment 6•7 years ago
|
||
![]() |
||
Comment 7•7 years ago
|
||
Please make it =mkmelin
straight way. I'm the poor guy who has to fix all the commit messages. Surely the patch won't land without review.
Assignee | ||
Comment 8•7 years ago
|
||
Reporter | ||
Comment 9•7 years ago
|
||
Assignee | ||
Comment 10•7 years ago
|
||
Assignee | ||
Comment 11•7 years ago
|
||
if (!Services.prompt.confirm(window,
bundle.getString("confirmMarkAllFoldersReadTitle"),
bundle.getString("confirmMarkAllFoldersReadMessage"))) {
return;
}
Due to the 2 spaces indentation style, the bundle
doesn't align with window
.
How do you want to approach this?
Do you prefer to always keep the 2 spaces indentation no matter what,
or is it OK to have 1 space for the sake of the alignment?
![]() |
||
Comment 12•7 years ago
|
||
We align, check some existing code. Multiples of 2 spaces only to the beginning of the line itself, so the if
or return
.
Assignee | ||
Comment 13•7 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #12)
We align, check some existing code. Multiples of 2 spaces only to the beginning of the line itself, so the
if
orreturn
.
Thanks for the info.
Assignee | ||
Comment 14•7 years ago
|
||
Properly aligned attributes of the confirm()
method.
![]() |
||
Comment 15•7 years ago
|
||
![]() |
||
Updated•7 years ago
|
Assignee | ||
Comment 16•7 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #15)
This already had r+. You can just re-apply r+ yourself if you addressed all
the issues.
Good to know, thanks.
First patch, hey?
Yay!
Comment 17•7 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/a8263af5473c
add confirmation for marking all folders as read. r=mkmelin
Updated•7 years ago
|
Description
•