-
Notifications
You must be signed in to change notification settings - Fork 1.3k
jetpack: backup download notice banner #14147
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
Conversation
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
Generated by 🚫 dangerJS |
You can test the changes on this Pull Request by downloading the APK here. |
👋 @zwarm ! I have some questions on the second scenario:
|
👋 @zwarm ! I also tested a fifth scenario, given that was on the video you shared, opening the
Everything works as expected, kudos! 🌟 |
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 went through the 4 flows and tested on tablet and dark mode. All looks exactly as expected, nice work 👌 😃
Yes 🤦
I decided to leave it because we are returning from another screen, where as in scenario 1 we are already in the context of the list. I could just as easily remove it here too. We need a tie breaker. |
👋 @zwarm !
Actually, thinking about it more and having you explained it it makes sense, let's leave it as is for now! 🙏 |
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.
👋 @zwarm !
I have reviewed and tested this PR as per the instructions, everything almost works as expected, amazing job dealing with this huge fat task! 🌟 🌟 🌟
I have left some minor (🔍) comments and suggestions (💡) for you to consider. Also, I have left a handful of questions (❓) I would like to discuss with you. Most importantly, I have left some warnings (develop
.
🙏
...rg/wordpress/android/ui/jetpack/backup/download/usecases/PostDismissBackupDownloadUseCase.kt
Show resolved
Hide resolved
...ess/src/main/java/org/wordpress/android/ui/jetpack/backup/download/BackupDownloadFragment.kt
Show resolved
Hide resolved
...ss/src/main/java/org/wordpress/android/ui/jetpack/backup/download/BackupDownloadViewModel.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModel.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/activitylog/ActivityLogViewModel.kt
Show resolved
Hide resolved
tools:text="We successfully created a backup download file from October 21, 2020 at 3:40 AM." | ||
android:text="@string/activity_log_backup_download_notice_description_with_two_params"/> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout |
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.
Question (❓): Couldn't the same result be achieved with only one layer of ConstraintLayout
?
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.
Going to leave this as is for now, if I have time I will revisit
</style> | ||
|
||
<!-- ActivityLog List Backup Download Notice Item --> | ||
<style name="ActivityLogList.Notice.Item.Label" parent="android:Widget.TextView"> |
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.
Suggestion (💡): I usually suggest that the layout_width
and layout_height
to not be part of a style since they are totally dependent on the individual screen and how a specific element is positions in it. Also, I consider the layout_margin
to be included in this category. However, the padding
can be indeed considered part of the style.
PS: I see both approached being used on our styles, as such I am okay with anyway you decide to proceed with that. This was just me sharing my thoughts since I would have done it the way I described it.
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.
Going to leave this as is for this PR, as there are multiple approaches to using styles. We should have a follow up on future direction overall. Thanks
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.
Fixes #14030
This PR adds the Backup Download Banner to the activity log list and backup list.
Notable changes ( It may be easiest to review this PR by commits and I'm available if reviewer wants to pair review)
activity_log_list_notice_item.xml
- New layout file for the notice bannerstyles.xml
&strings.xml
- Added new styles for the banner and a few stringsActivityLogAdapter
,ActivitiyLogDiffCallback
- both updated to support theNotice
list item type and the newNoticeItemViewHolder
, so that the view will actually show in the listComplete
to include url and validUntil andGetBackupDownloadStatusUseCase
to send those values downstreamPostDismissBackupDownloadUseCase
which is post the dismiss request to the server. If there is an error, we log it and move on.JETPACK_BACKUP_DOWNLOAD_FILE_NOTICE_DOWNLOAD_TAPPED -
JETPACK_BACKUP_DOWNLOAD_FILE_NOTICE_DISMISSED_TAPPED,
ACTIVITY_LOG_DOWNLOAD_FILE_NOTICE_DOWNLOAD_TAPPED,
ACTIVITY_LOG_DOWNLOAD_FILE_NOTICE_DISMISSED_TAPPED
ActivityLogTracker
to make the tracks call reusableDownloadBackupFile
, which will forward the user to the web browser for file download. Updated the observer inActivityLogListFragment
to handle the browser launchJetpackBackupDownloadActionState
which will let the calling activity know which state the download is in on return. This was a precursor to showing the correct messaging when returning to the activity log list or backup list. Changes were made toBackupDownloadFragment
andBackupDownloadViewModel
to support this new intent extra.ActivityLogViewModel
, which include:backupDownloadEvent
with a displayNotice field, so whenreloadEvents
executes it uses this property to determine if the notice banner should be shown. Also included downloadId, url, and validUntil.onQueryBackupDownloadStatus
to use the JetpackBackupDownloadActionState to determine which snackbar message to be shown. Note that in the case of returning to the lists, we do want to show the snackbar in addition to the notice banner.handleBackupDownloadStatusForProgress
to no longer check if the progress item is shown, we always kick off a reloadEventshandleBackupDownloadStatusForComplete
to reloadEvents of the progressItem is not shownMerge Instructions:
To test:
Scenario.1 : BackupDownload Flow - Manual Exit
Activity Log
screen,Download backup
to launch theBackup Download
screen,Create downloadable file
button.X
toolbar button or pressing/swiping back).Activity Log
screen and a backup status will be triggered,Activity Log
screenScenario.2 : BackupDownload Flow - Wait for flow to end and then exit
Activity Log
screen,Download backup
to launch theBackup Download
screen,Create downloadable file
button.X
toolbar button or pressing/swiping back)Scenario.3 (Notice banner download)
Scenario.4 (Notice banner dismiss)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.