Skip to content
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

Quick Start for Existing Users V2 - Refactor code to support different quick start types #16500

Merged
merged 31 commits into from
May 11, 2022

Conversation

ashiagr
Copy link
Contributor

@ashiagr ashiagr commented May 9, 2022

Parent #16350

Corresponding FluxC PR: wordpress-mobile/WordPress-FluxC-Android#2384

This PR refactors quick start logic to consider tasks and task types based on quick start type.
Note 1: No new functionality is added in this PR. It needs a careful code review and regression testing.
Note 2: I've tried to split changes into several commits and provided an overview of the changes in our sync call but let me know if I can help in reviewing the PR.


Details

Changes can be grouped under the following heads:

QuickStartRepository.quickStartType

Currently, the same set of tasks is shown irrespective of whether the user creates a new site or chooses an existing site. These tasks are currently part of NewSiteQuickStartType which is set as qs type in the qs repo in a73828b.

Trackers and Illustrations

Updated to compare task strings in trackers and task illustrations as a common task like check_stats needs the same tracking, and illustrations irrespective of quick start type.

Class Functions Commits
QuickStartItemBuilder getIllustrations b51b007
QuickStartUtils getQuickStartListTappedTracker, getQuickStartListSkippedTracker, getTaskCompletedTracker c695d3b

QuickStartMySitePrompts, QuickStartNoticeDetails, QuickStartTaskDetails

Updated to get the corresponding enum by comparing task strings.

As a common task like check_stats needs the same prompt, notice details, task details, and illustrations irrespective of quick start type, there was no need to split them based on quick start type.

Class Commits
QuickStartMySitePrompts 5b3bbc9
QuickStartNoticeDetails 001da95..230e50b
QuickStartTaskDetails 32b78aa..2f8a124

Quick Start Functions

Class Functions   Commits
QuickStartUtilsWrapper startQuickStart   161d11a
  completeTaskAndRemindNextOne   370ee21
QuickStartUtils isQuickStartInProgress   77d9aba
  getNextUncompletedQuickStartTask Replaced use of all  task types with task types for quick start type 82abd92
  isEveryQuickStartTaskDone Replaced use of all tasks with  list of quick start type tasks c61db46
  getNextUncompletedQuickStartTaskForReminderNotification Replaced use of all  task types with task types for quick start type c265b94
AppPrefs getLastSkippedQuickStartTask Get last skipped task from list of quick start type tasks 62fd05e
QuickStartRepository getQuickStartTaskTypes Replaced hardcoded task types with task types for quick start type f7c1584
QuickStartReminderReceiver   Updated fail safe conditions 3c83c96

Quick Start Card

Class Notes Commit
QuickStartCardViewHolder Updated get to know app task item type 8c05d84

To Test

Test.1 Regression test Quick Start

  1. Launch the app.
  2. Logout/login and select "Show me around" when the quick start prompt is shown.
  3. Run tests in wpandroid-quick-start-testing-instructions.txt.

Test.2 Dynamic Cards

  1. Launch the app.
  2. Go to My Site -> Me -> App Settings -> Debug settings.
  3. Turn on the QuickStartDynamicCardsFeatureConfig flag under the Features in development section.
  4. Restart the app.
  5. Logout/login and select "Show me around" when the quick start prompt is shown
  6. Notice that quick start dynamic cards are shown in My Site tab
  7. Make sure that dynamic card interactions are the same as before.

PS: Test 5 - Quick Start Cards disappear in wpandroid-quick-start-testing-instructions.txt will not work as Plans were removed (internal ref: p1651587009445519-slack-C011BKNU1V5) but the corresponding Quick Start task remains which will not mark the card as complete.

Test.3 (optional) To test that qs functions consider tasks and task types based on quick start type.

(I added this test to share the patch I used to find out qs functions we needed to update based on quick start type but it can be skipped to a future PR when we actually add the tasks)

  1. Apply patch that sets ExistingSiteQuickStartType in qs repo and adds common tasks check_stats, view_site temporarily in QuickStartStore. Enable local fluxc in local-build.gradle.
  2. Reinstall app.
  3. Logout/login and select "Show me around" when the quick start prompt is shown.
  4. Run tests in wpandroid-quick-start-testing-instructions.txt.

Merge Instructions

  • Wait for the corresponding FluxC PR to be merged
  • Update FluxC version in builds.gradle
  • Remove Not Ready for Merge label
  • Merge the PR

Regression Notes

  1. Potential unintended areas of impact
    Quick Start functionality does not work as expected

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    See To Test section

  3. What automated tests I added (or what prevented me from doing so)
    Updated existing tests for the code to compile after refactor (no changes to existing functionality in this PR).

PR submission checklist:

  • I have completed the Regression Notes.
  • 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.

ashiagr added 23 commits May 9, 2022 06:51
QuickStartTask is now an interface and currently tasks exists only for QuickStartNewSiteTask. All occurrences of new site tasks in the code should now reference QuickStartNewSiteTask for the code to compile.
Fixes error as per suggestion:
Type is not directly supported by Parcelize
Annotate the parameter with @rawvalue if you want it to be serialized via
writeValue()
Currently same set of tasks are shown irrespective of whether user creates a new site or chooses an existing site. These tasks are currently part of NewSiteQuickStartType which is set quick start type in qs repo.
…-wpandroid

# Conflicts:
#	WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 9, 2022

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

Since we do not save quick start type in db, it makes more sense to keep it in WPAndroid.
@ashiagr ashiagr added Tooling and removed Tooling labels May 10, 2022
@AjeshRPai AjeshRPai moved this from In progress to Review in progress in [Android] Quick Start for Existing Users v2 May 10, 2022
@ashiagr ashiagr requested a review from jostnes May 10, 2022 12:02
@jostnes
Copy link
Contributor

jostnes commented May 11, 2022

Hey @ashiagr, thanks for the details PR description and testing notes, those are very helpful! Some notes from testing:

  1. I noticed one thing after logging in, there seems to be a slight delay when displaying the Quick Start prompt. Notice that the Home screen is displayed briefly before the prompt:
delay.quick.start.prompt.mp4

Note: Spoke to @ashiagr offline about this, this is from this PR. I also checked the current beta build and the same is reproducible there, so isn't related to the PR.

  1. As mentioned in the description, Plans task on Quick Start can't be completed due to this issue so Quick Start completed flow is excluded from testing
  2. Tested these 4 combinations and overall works as expected (observations on the next point):
  • From Home tab with QuickStartDynamicCardsFeatureConfig turned off
  • From Home tab with QuickStartDynamicCardsFeatureConfig turned on
  • From Menu tab with QuickStartDynamicCardsFeatureConfig turned off
  • From Menu tab with QuickStartDynamicCardsFeatureConfig turned on
  1. Some observations from testing:
  • Noticed that user is still not guided to the correct tab (from Menu to Home) in this build. The issue looks to be fixed in this PR. Was wondering if the fixed is included in the PR or if this is a regression?
  • Noticed that there is no quick start prompt when the QuickStartDynamicCardsFeatureConfig flag is turned on (it will automatically show on the selected site), this could be a regression:
dynamic.card.no.qs.prompt.mp4
  • Noticed when QuickStartDynamicCardsFeatureConfig flag is turned on if a card is pinned it is still removed once the task is completed. Is that intended behavior?:
pinned.card.still.removed.mp4
  • Noticed when QuickStartDynamicCardsFeatureConfig flag is turned on, when a card is pinned, it moves up but the screen does not follow the action so it would look like the card is gone:
pinned.card.jumping.mp4

I have not checked the dynamic cards observations against a production build (I'm not sure how to turn this on for production since the debug option is not there...) so thought I'd share them here so you can have a look first.

Copy link
Contributor

@AjeshRPai AjeshRPai left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this task @ashiagr . Awesome job. I have reviewed the code changes and I have done regression testing on quick start. I have also tested with dynamic cards as well. Everything looks good. 👍🏼 . I have done the review for the Corresponding fluxC PR and everything looks good there as well.

I have left two nitpicks for you to consider. As those are non blocking, I am approving the PR. Please feel free to merge if you think those are not needed.

[Android] Quick Start for Existing Users v2 automation moved this from Review in progress to Reviewer approved May 11, 2022
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 11, 2022

Warnings
⚠️ PR has more than 300 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@wpmobilebot
Copy link
Contributor

Found 1 violations:

The PR caused the following dependency changes:

-+--- org.wordpress:fluxc:{strictly trunk-1ee442f447044438c9b17068cb224cc162cd5912} -> trunk-1ee442f447044438c9b17068cb224cc162cd5912
-|    +--- org.wordpress:wellsql:1.7.0
-|    |    \--- org.wordpress.wellsql:wellsql-annotations:1.7.0
-|    +--- org.wordpress.fluxc:fluxc-annotations:trunk-1ee442f447044438c9b17068cb224cc162cd5912
-|    +--- org.greenrobot:eventbus:3.3.1 (*)
-|    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.9.2 (*)
-|    +--- com.android.volley:volley:1.1.1 -> 1.2.0
-|    +--- androidx.paging:paging-runtime:2.1.2
-|    |    +--- androidx.paging:paging-common:2.1.2
-|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.2.0
-|    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
-|    |    +--- androidx.arch.core:core-runtime:2.0.0 -> 2.1.0 (*)
-|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.3.1 (*)
-|    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.2.0 (*)
-|    |    \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
-|    +--- com.goterl:lazysodium-android:5.0.2
-|    +--- net.java.dev.jna:jna:5.5.0
-|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 (*)
-|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.10 (*)
-|    +--- androidx.appcompat:appcompat:1.0.2 -> 1.3.1 (*)
-|    +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
-|    +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.1.0-beta01 (*)
-|    +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2
-|    |    +--- com.squareup.okhttp3:okhttp:4.9.2 (*)
-|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.6.10 (*)
-|    +--- com.google.code.gson:gson:2.8.5
-|    +--- org.apache.commons:commons-text:1.1 (*)
-|    +--- androidx.room:room-runtime:2.4.2 (*)
-|    +--- androidx.room:room-ktx:2.4.2
-|    |    +--- androidx.room:room-common:2.4.2 (*)
-|    |    +--- androidx.room:room-runtime:2.4.2 (*)
-|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 (*)
-|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
-|    +--- com.google.dagger:dagger:2.29.1 -> 2.41 (*)
-|    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.5.2 (*)
-|    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.5.2 (*)
++--- org.wordpress:fluxc:{strictly trunk-6fcf6007126537fa66dbe6aacc439ab0f3aa30db} -> trunk-6fcf6007126537fa66dbe6aacc439ab0f3aa30db
+|    +--- org.wordpress:wellsql:1.7.0
+|    |    \--- org.wordpress.wellsql:wellsql-annotations:1.7.0
+|    +--- org.wordpress.fluxc:fluxc-annotations:trunk-6fcf6007126537fa66dbe6aacc439ab0f3aa30db
+|    +--- org.greenrobot:eventbus:3.3.1 (*)
+|    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.9.2 (*)
+|    +--- com.android.volley:volley:1.1.1 -> 1.2.0
+|    +--- androidx.paging:paging-runtime:2.1.2
+|    |    +--- androidx.paging:paging-common:2.1.2
+|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.2.0
+|    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.1.0 (*)
+|    |    +--- androidx.arch.core:core-runtime:2.0.0 -> 2.1.0 (*)
+|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.3.1 (*)
+|    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.2.0 (*)
+|    |    \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
+|    +--- com.goterl:lazysodium-android:5.0.2
+|    +--- net.java.dev.jna:jna:5.5.0
+|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 (*)
+|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.10 (*)
+|    +--- androidx.appcompat:appcompat:1.0.2 -> 1.3.1 (*)
+|    +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
+|    +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.1.0-beta01 (*)
+|    +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0 -> 4.9.2
+|    |    +--- com.squareup.okhttp3:okhttp:4.9.2 (*)
+|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.6.10 (*)
+|    +--- com.google.code.gson:gson:2.8.5
+|    +--- org.apache.commons:commons-text:1.1 (*)
+|    +--- androidx.room:room-runtime:2.4.2 (*)
+|    +--- androidx.room:room-ktx:2.4.2
+|    |    +--- androidx.room:room-common:2.4.2 (*)
+|    |    +--- androidx.room:room-runtime:2.4.2 (*)
+|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10 (*)
+|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2 (*)
+|    +--- com.google.dagger:dagger:2.29.1 -> 2.41 (*)
+|    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.5.2 (*)
+|    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.5.2 (*)
 \--- org.wordpress:login:0.14.0
-     \--- org.wordpress:fluxc:trunk-1436f46fc296ede0e65e117bbfced38fa34cec6d -> trunk-1ee442f447044438c9b17068cb224cc162cd5912 (*)
+     \--- org.wordpress:fluxc:trunk-1436f46fc296ede0e65e117bbfced38fa34cec6d -> trunk-6fcf6007126537fa66dbe6aacc439ab0f3aa30db (*)

Please review and act accordingly

@ashiagr
Copy link
Contributor Author

ashiagr commented May 11, 2022

Thanks, @jostnes for a detailed review! Really appreciate it.

Please find my answers below:

Some observations from testing:

Noticed that user is still not guided to the correct tab (from Menu to Home) in this build. The issue looks to be fixed in #16462. Was wondering if the fixed is included in the PR or if this is a regression?

That's correct. The PR is not yet merged to the trunk branch. The issue should be resolved once it gets merged.

Noticed that there is no quick start prompt when the QuickStartDynamicCardsFeatureConfig flag is turned on (it will automatically show on the selected site), this could be a regression:

Quick Start Dynamic Cards are not enabled in production. I tested and found the same behavior in the existing code in trunk branch.

dynamic.card.no.qs.prompt.trunk.mp4

Noticed when QuickStartDynamicCardsFeatureConfig flag is turned on if a card is pinned it is still removed once the task is completed. Is that intended behavior?:

I think this is expected behavior. I tested in the existing trunk branch and noticed the same behaviour.

pinned.card.still.removed.trunk.mp4

Noticed when QuickStartDynamicCardsFeatureConfig flag is turned on, when a card is pinned, it moves up but the screen does not follow the action so it would look like the card is gone:

This one looks like a potential bug. I'll create an issue and link it here. Since dynamic cards are not enabled in production, I'll assign a low priority to it.

I have not checked the dynamic cards observations against a production build (I'm not sure how to turn this on for production since the debug option is not there...) so thought I'd share them here so you can have a look first.

Thank you so much for the detailed notes. I've attached videos from the trunk branch. You can also try the APK from the previous PR: #16473 (comment) which will allow you to enable the flag in case you want to be sure. 🙂

…-wpandroid

# Conflicts:
#	WordPress/src/test/java/org/wordpress/android/ui/mysite/MySiteViewModelTest.kt
@ashiagr ashiagr added Tooling and removed Tooling labels May 11, 2022
@ashiagr
Copy link
Contributor Author

ashiagr commented May 11, 2022

@jostnes

I'll go ahead and merge the PR as the issues reported are non-blocking and mostly related to QS dynamic cards which are not enabled in production and not related to changes in this PR.

Thanks once again for your inputs. 🙇‍♀️ 🙌

@ashiagr ashiagr merged commit 11fea18 into trunk May 11, 2022
[Android] Quick Start for Existing Users v2 automation moved this from Reviewer approved to Done May 11, 2022
@ashiagr ashiagr deleted the issue/16350-refactor-for-different-qs-types-wpandroid branch May 11, 2022 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants