cht-core icon indicating copy to clipboard operation
cht-core copied to clipboard

Bulk delete of reports redesign

Open latin-panda opened this issue 2 years ago • 1 comments

Description Related forum post.

The bulk delete of Reports tab is redesigned to improve the user experience.

Extra considerations:

  • The checkboxes are always visible as long as can_bulk_delete_reports permission is enabled.
  • The Search and filter are hidden when there is at least 1 item selected.
  • All unselected checkboxes have gray border, including the "Select all" checkbox.
  • One telemetry entry is added to count every time a user bulk delete reports.
  • We decided that we would NOT use a feature flag for the bulk delete redesign:
    1. It's not a feature that CHWs use frequently (they rarely even have the reports tab)
    2. The purpose of Feature Flagging these UI changes is to give projects a way to roll out significant changes to large numbers of users over time rather than all at once. This is not likely a feature that falls into this category (see # 1).
    3. While the way we do bulk delete may change over time, we are definitely moving forward with our material design changes so we would not consider reverting back to the old (well, current) way of doing bulk delete.
    4. It adds complexity to the codebase
    5. It gets even trickier since there are other UI feature flags
  • While in mobile view: if a user clicks outside the checkbox, then the reports open. If the user clicks "back", then the selection from before appears.
  • While in desktop view: if a user already has one item selected and then clicks outside the checkbox on a second item, this one will select (it won't open the report). If the user wants to see more details about the report, the user still have the option to expand the selected reports located on the right side.
The new version can be seen here Screen Shot 2022-09-22 at 10 05 14 am Screen Shot 2022-09-22 at 10 04 59 am Screen Shot 2022-09-22 at 10 00 30 am
The old version can be seen here

Screen Shot 2022-09-12 at 4 34 02 pm

Screen Shot 2022-09-12 at 4 34 24 pm

latin-panda avatar Sep 12 '22 09:09 latin-panda

@n-orlowski @michaelkohn @tatilepizs I have updated the ticket's description with some more information. Please feel free to add or edit.

Next is:

  • What are we documenting in cht-docs?
    • For sure the new Telemetry entry.
  • What is the e2e test we want to cover?
    • I found this one that we'll need to fix after the changes are complete. I'm wondering if this is enough or take the opportunity to add another escenario.

latin-panda avatar Sep 22 '22 03:09 latin-panda

I've added 1 clarification item in the description of this ticket, based on our last conversation:

No actions (create, edit, verify reports, etc) allowed when there is at least 1 item selected. User can just bulk delete.

latin-panda avatar Oct 04 '22 03:10 latin-panda

We decided to not fully support responsive UI right now.

Feature behaviour conflict details

Conversation.

If the user is in mobile view, selects some reports, then click on one to view. The user is redirected to the report and it opens the content. Then the user rotate the phone to landscape, the phone might display desktop view if it’s big enough. At this point the behaviour conflicts because the user is still in select mode and in desktop the user shouldn’t navigate to a report to see its content. Because the user was looking at 1 report content, it can be confusing to suddenly not see the report content anymore but a list of selected report’s summary.

In the video, you can observe that after rotating the phone, only 1 report is visible (that one that was open), it’s not showing the summary of the other selected reports. At this point the url is about 1 report that the user was looking at (https://……./reports/fef3a94b-c47f-4005-ba5a-524500bbd0f0)… in desktop the url should be the root (https://……./reports/)

Video: https://user-images.githubusercontent.com/66472237/198192265-c31c2f78-2f5e-46b4-a330-885eceedc67d.mov

We’re okay in android app because the rotation is blocked, the user will always see portrait. If the user is always in mobile or always in desktop, we’re okay…

The problem is when transitioning from mobile to desktop in this scenario

It's considered an edge case and we think it's OK to leave it as is, here's why:

  • We don't think we've ever seen a CHW use their phone in landscape mode (at least while using the CHT... probably they do for YouTube)
  • Even in landscape mode, it will probably show the mobile view (1 pane) anyway, depending on how big the phone is...right? (on my phone, it still just shows 1 pane in landscape)
  • If the user is confused by this behavior, I imagine they would just rotate their phone upright again

Alternatively... we could disable viewing an individual report once you've selected at least one report (in iOS, you can't view an individual row once you've started selecting stuff)... but we're fine leaving the behavior as is based on the points above and observe user behaviour.

cc: @michaelkohn @n-orlowski @tatilepizs

latin-panda avatar Oct 27 '22 04:10 latin-panda

Hey Release Manager from the future, and anyone else looking for screenshots of this feature. You can use these for documentation or release notes:

Screenshots mobile view!!!!

Screen Shot 2022-10-27 at 11 24 15 am Screen Shot 2022-10-27 at 11 24 53 am Screen Shot 2022-10-27 at 11 25 28 am Screen Shot 2022-10-27 at 11 28 27 am Screen Shot 2022-10-27 at 11 28 37 am

Screenshots desktop view!!!!

Screen Shot 2022-10-27 at 11 26 25 am Screen Shot 2022-10-27 at 11 26 46 am Screen Shot 2022-10-27 at 11 27 06 am Screen Shot 2022-10-27 at 11 27 33 am Screen Shot 2022-10-27 at 11 27 46 am

latin-panda avatar Oct 27 '22 04:10 latin-panda

Some additional clarification about this feature behaviour are:

  • When the select all checkbox has a minus, and the user clicks on it
    • it should select all (up to 500 reports).
  • When that checkbox is blue and checked, and the user clicks on it
    • it should deselect all.
  • If the user has too many reports (+500) then select all
    • it will only select up to 500 same as in master,
    • and the select all checkbox is blue and checked, and the "clear selection" is available.
  • If the user scrolls more than +500 in the LHS, and "selects all" and then selects some more (for example 505 selected) then that's okay for now, same as master.

latin-panda avatar Nov 03 '22 02:11 latin-panda

This is ready for AT here. My recommendation is to do an exploratory test, during development I fixed a number of issues that you can see in the PR and in the recordings that I'm going to send in the CT channel.

latin-panda avatar Nov 04 '22 15:11 latin-panda

Testing Details

  • Config: Default
  • Environment: Local with docker helper script 4.0
  • Platform: WebApp
  • Browser: Chrome
  • CHT version: 7778-bulk-delete-redesign

Android 10

  • Phone: Samsung Galaxy A01
  • Android System WebView Version: 107.0.5304.105
  • CHT Android version: 1.0.1

Android 5.1.1

  • Phone: Alcatel 50560
  • Android System WebView Version: 95.0.4638.74
  • CHT Android version: 1.0.1

Tests scenarios

Select and unselect reports - webapp

video

Select and unselect reports - Android 10

video

Select and unselect reports - Android 5

video

Bulk delete reports - webapp

video

Bulk delete reports - Android 10

video

Bulk delete reports - Android 5

video

Bulk delete reports with a filter selected- webapp

video

Bulk delete reports with a filter selected- Android 10

video

Bulk delete reports with a filter selected- Android 5

video

tatilepizs avatar Nov 21 '22 21:11 tatilepizs

Hey @latin-panda, Something really weird is happening, the redesign is looking really good, but in the testing process, I saw that something was happening with the report that was deleted, if I logged in using another device and synced, I still was able to see the report that I deleted using the browser in my laptop.

Steps to reproduce:

  • Using an offline user, login into two or more different devices (laptop and phone for example).
  • Create a report.
  • Sync in both devices to make sure you can see the report.
  • Delete the report using the browser on the laptop.
  • Sync again on the phone. You will still be able to see the deleted report.
Video attached, using branch 7778-bulk-delete-redesign

video

I tried the exact same steps using master, and I don't see that behavior, the report was deleted in all the devices.

Video attached, using master

video

Could you please check?

tatilepizs avatar Nov 23 '22 15:11 tatilepizs

@tatilepizs very good finding and thanks for catching that. I was passing the wrong document that couch needs, I've fixed it in this commit. When you have time, can you please have a look? Pura vida!

I've rebased this branch with latest from master, I didn't find any relevant conflict.

latin-panda avatar Nov 30 '22 13:11 latin-panda

It looks good Jenny, the sync between devices is working perfectly, thank you! 🚢 🚢

tatilepizs avatar Dec 01 '22 21:12 tatilepizs

Thanks @tatilepizs, this has been merged in to our main branch

latin-panda avatar Dec 02 '22 01:12 latin-panda