-
Notifications
You must be signed in to change notification settings - Fork 42
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
Refactor DeleteSourceDialog so it accepts Set[Source] #2188
Conversation
(realized I want to add one more test before ready for review :) ) |
a3db926
to
9c1dc39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. It generally makes sense. It took me some extra time to review due to the need to familiarize myself with the client code and find out was to test the code.
The code and the tests look fine to me in general. I only found that source names are not displayed.
I do have some more conceptual questions about how deletion could take place, but your approach is clearly simpler. It's just the kind of stuff where UX help would be nice to have 🙃 )
Alternative approach suggestionWhile reviewing the PR, I though of another alternative approach. Since this is such a destructive action I wonder, if source deletion should be done one by one. As in, one delete dialog per source (kind of like how deleting multiple qubes asks you for each). Another idea which could be done on top of that would be for each source deletion dialog, the source view would be changed to the source about to be deleted, such that in the background the user can be reminded of the last interactions with the source. This would be source of a visual reminder of what they're about to delete. This is one of those situations where some UX help would be great 🙂 |
a0e9d56
to
155bdef
Compare
Hey, thanks for your thoughtful comment. I do agree that ux help would be beneficial. Here're my initial thoughts; I'm open to discussion. There are a few known UX patterns we can fall back on, specifically "Confirmation Modal for Destructive Operation", "Bulk Action best practices", and "Actions/affordances in a table like/scrolling list view". (These might not be exact names but give a decent idea of what to search for. Links are below.) Confirmation modal for destructive operations, best practices:
Bulk action best practices:
Destructive action best practices:
IMO repeated confirmation dialogs would not be better than the current DeleteSource implementation; the goal of batch operations is to save the user clicks. (This is also why I am advocating for a sidebar and not a dropdown menu for the Batch delete action). I would also worry about encouraging users to click through Destructive dialogs quickly in order to complete a task, and this feature is requested in the context of spam removal, which is a repetitive task. So I personally am in favour of one dialog for a batch operation, which I believe to be in line with batch operations ux practices generally, but I am open to other opinions. The areas where I do feel we are departing from UX norms and should maybe discuss are:
(Links - based on a lot from nngroup, who are longstanding/practitioners in/creators of the ux field, see eg from them and others: |
Thanks a lot for all the reasoning. After reading it, I'm with you that it makes more sense to only make one dialog. But looking at this NNGroup post (point 7. in particular) gave me another idea... This is mostly a spam mitigation mechanism. With spam, it means that you probably have not even replied. What if in case any source has had replies from a journalist, we highlight that fact. For example:
Or in general any criteria / way to warn users that they may have clicked on the wrong source. This would add to the point of ☑️ Dangerous option should explain precisely what's happening. Or maybe just a table with the sources, number of replies and number of shared files. What do you think? Maybe I'm complicating this feature too much. |
I think this is a great idea in terms of differentiating what might be spam, and from an implementation perspective, it would not be very complex, but I think we should discuss if it's a must-do at this stage, or an enhancement. It also introduces a new UX condition (so would it be present for all deletion operations including single-source deletion, or just multi-source deletion?). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an opinion on the UX question right now, I do think that if we're stuck or uncertain, sticking close to what the Guardian did is fine/what I'd recommend and then working on improvements afterwards.
(And a quick skim of the PR)
On Thu, Sep 05, 2024 at 09:27:31AM -0700, Kunal Mehta wrote:
I don't have an opinion on the UX question right now, I do think that
if we're stuck or uncertain, sticking close to what the Guardian did
is fine/what I'd recommend and then working on improvements
afterwards.
I second this.
|
@cfm wrote:
Given the opinions, it feels like we should merge this PR right away and discuss improvements afterwards. |
155bdef
to
85d5627
Compare
f8f22a8
to
16e48a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the word wrapping issue. However, I couldn't get the test to work for me.
16e48a8
to
b128e48
Compare
Marking again as ready for review.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM. I did a full review since deeplow's last review. The comments are just personal preference things in tests and, if desired, can be addressed in follow-ups.
…stead of a single source, and display an error message if the empty set iis provided. Add parameterized unit tests to test empty, n=1, and n>1 conditions.
b128e48
to
1e541a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the test-only change in https://github.com/freedomofpress/securedrop-client/compare/b128e48cc04d7daa487b6c5890e38644872852cc..1e541a6694678839c20305ff9084bd3f7e0f7cf6 after the full review in #2188 (review).
Status
Ready for review
Description
Refactor DeleteSourceDialog so it takes a set of sources instead of a single source. Display a user-friendly error message if the empty set is provided. Add parameterized unit tests to test empty, n=1, and n>1 conditions. This does not include any actual batch delete functionality, but it is in preparation for that change.
I was tempted to also refactor the DeleteSource and DeleteConversation dialogs into one dialog element, since there's no reason not to and is in line with what we did on the Print, Print Conversation, and Print Transcript dialogs, but I think it's too much scope creep. But it would be a straightforward refactor PR later on if anyone wants to take it on.
This PR makes minor string changes that will need il8n.
Towards #2160
Test Plan
Checklist
If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:
If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable:
If these changes modify the database schema, you should include a database migration. Please check as applicable:
main
and confirmed that the migration is self-contained and applies cleanlymain
and would like the reviewer to do so