Skip to content

Scan history UI state#13842

Merged
zwarm merged 25 commits intodevelopfrom
issue/13326-scan-history-ui-state
Jan 22, 2021
Merged

Scan history UI state#13842
zwarm merged 25 commits intodevelopfrom
issue/13326-scan-history-ui-state

Conversation

@malinajirka
Copy link
Copy Markdown
Contributor

Parent issue #13326

This PR adds Error and Loading states to ScanHistoryFragment (contains viewpager and fullscreen error view) and ScanHistoryListFragment (contains RecyclerView).

Overview of the Scan History screen structure

  1. ScanHistory (parent) - takes care of fetching the data from the server and showing an error when the request fails. It provides LiveData with a list of all threats.
  2. ScanHistoryList (child, one per tab) - observes threats provided by ScanHistoryViewModel, filters them by ThreatStatus depending on the corresponding tab, and maps them to UiState. Takes care of showing list of skeleton items (loading), list of threats or empty screen when the list of threats is empty.

To test:

  1. Make sure Scan feature flag is enabled
  2. Open Scan
  3. Click on History action in the toolbar (notice loading skeletons)
  4. Turn on airplane mode before the request finishes
  5. Notice a RequestFailed error is shown
  6. Click on Retry
  7. Notice NoConnection error is shown
  8. Turn the airplane mode off
  9. Click on retry
  10. Notice threat items are shown when the request finishes (it might take 30s)

Switch to a site which doesn't have any threats in history

  1. Open Scan
  2. Click on History action in the toolbar
  3. Notice empty screen is shown when the request finishes (it might take 30s)

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@malinajirka malinajirka added this to the 16.7 milestone Jan 21, 2021
@malinajirka malinajirka requested a review from a team January 21, 2021 19:27
@malinajirka malinajirka self-assigned this Jan 21, 2021
@malinajirka malinajirka requested review from zwarm and removed request for a team January 21, 2021 19:27
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Jan 21, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@malinajirka malinajirka mentioned this pull request Jan 21, 2021
67 tasks
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Jan 21, 2021

You can test the changes on this Pull Request by downloading the APK here.

@zwarm zwarm self-assigned this Jan 22, 2021
Copy link
Copy Markdown
Contributor

@zwarm zwarm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malinajirka - all looks good, nicely done. Shimmer effect is neat. I left one question, but it's not a blocker and can be ignored. 👍

@zwarm zwarm merged commit 1a6bd47 into develop Jan 22, 2021
@zwarm zwarm deleted the issue/13326-scan-history-ui-state branch January 22, 2021 21:09
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