wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.92k stars 1.3k forks source link

Pinned sites #20521

Closed jarvislin closed 2 weeks ago

jarvislin commented 1 month ago

See: p1710242775754929-slack-C3EA6SMFH

This is a Hack Week project. We redesign the site picker, add a new feature Edit pinned sites, and deprecate the Show/hide sites feature.

Before After
Screenshot_20240325-160220 Screenshot_20240401-114650

To Test:

Choose a site

  1. Sign in JP app
  2. Click on the arrow icon at the top-right corner.
  3. It should enter the screen of re-designed site picker (ChooseSiteActivity)
  4. Choose a site
  5. It should back to the main screen with the site you chose

Search

  1. Click on the arrow icon at the top-right corner.
  2. Click on the search icon
  3. Type some characters
  4. It should return the matched results
  5. Click on the dismiss icon X at the top-right corner
  6. It should clear your keyword for search
  7. Click on the back arrow icon <-
  8. It should leave the search mode.

Pin sites

  1. Click on the arrow icon at the top-right corner.
  2. Click on the Pin icon at the top-right corner.
  3. Each row should display the pin icon.
  4. Click on the pin icon to pin a site
  5. It should move the site you pinned to the Pinned Sites section
  6. Click on the pin icon to unpin the site you just pinned
  7. It should move the site to All Sites section

Reblog

  1. Go to the tab of Reader
  2. Click Reblog on the reader list
  3. It should enter the screen of re-designed site picker (ChooseSiteActivity) if you have multiple sites.
  4. It should hide the pin icon and Add a site button
  5. Choose a site
  6. It should enter the screen of Editor with the post you reblogged.
  7. Back to the reader list
  8. Click on a post to the details view
  9. Click Reblog button in the details view
  10. It should enter the screen of re-designed site picker (ChooseSiteActivity) if you have multiple sites.
  11. It should hide the pin icon and Add a site button
  12. Choose a site
  13. It should enter the screen of Editor with the post you reblogged.

Regression Notes

  1. Potential unintended areas of impact

    • Reader (reblogging-related)
    • Auth failure (caused by the invalid token with a self-hosted site or a jetpack-connected site)
    • Site picker
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Manual
  3. What automated tests I added (or what prevented me from doing so)

    • I add some unit tests for the view model

PR Submission Checklist:


Testing Checklist (strike-out the not-applying and unnecessary ones):

dangermattic commented 1 month ago
4 Warnings
:warning: strings.xml files should only be updated on release branches, when the translations are downloaded by our automation.
:warning: This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
:warning: Class ActionMode is missing tests, but unit-tests-exemption label was set to ignore this.
:warning: This PR is assigned to the milestone 24.7. This milestone is due in less than 4 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by :no_entry_sign: Danger

wpmobilebot commented 1 month ago
WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20521-6b252f9
Commit6b252f97504b0e992d5ae1127d639559846093fa
Direct Downloadwordpress-prototype-build-pr20521-6b252f9.apk
Note: Google Login is not supported on these builds.
wpmobilebot commented 1 month ago
Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20521-6b252f9
Commit6b252f97504b0e992d5ae1127d639559846093fa
Direct Downloadjetpack-prototype-build-pr20521-6b252f9.apk
Note: Google Login is not supported on these builds.
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 40.86957% with 68 lines in your changes are missing coverage. Please review.

Project coverage is 40.32%. Comparing base (90a8f60) to head (e52f0b8).

:exclamation: Current head e52f0b8 differs from pull request most recent head cd859c3. Consider uploading reports for the commit cd859c3 to get more accurate results

Files Patch % Lines
.../wordpress/android/ui/main/utils/SiteRecordUtil.kt 0.00% 25 Missing :warning:
...va/org/wordpress/android/ui/main/AddSiteHandler.kt 0.00% 9 Missing :warning:
...org/wordpress/android/ui/main/ChooseSiteAdapter.kt 0.00% 7 Missing :warning:
...n/java/org/wordpress/android/ui/main/SiteRecord.kt 66.66% 6 Missing and 1 partial :warning:
...ava/org/wordpress/android/ui/main/SiteViewModel.kt 82.85% 5 Missing and 1 partial :warning:
...ava/org/wordpress/android/ui/ActivityLauncher.java 0.00% 4 Missing :warning:
.../org/wordpress/android/ui/prefs/AppPrefsWrapper.kt 0.00% 4 Missing :warning:
...rg/wordpress/android/ui/main/SitePickerContract.kt 0.00% 3 Missing :warning:
.../java/org/wordpress/android/ui/prefs/AppPrefs.java 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #20521 +/- ## ========================================== - Coverage 40.50% 40.32% -0.18% ========================================== Files 1474 1478 +4 Lines 67967 67944 -23 Branches 11235 11239 +4 ========================================== - Hits 27529 27398 -131 - Misses 37955 38082 +127 + Partials 2483 2464 -19 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

osullivanchris commented 1 month ago

Current site is not at the top. With the old implementation the current site was always separated at the top but now you may have to scroll to find it in bold. I don't think this is necessarily an issue since it does not affect the functionality but wanted to highlight it since it surprised me at first thinking that the current selection is missing. Looping in @osullivanchris for any design feedback 🙇

Thanks @antonis . We've been continuing to discuss this. We'll have 'all sites' ordered by most recent rather than alphabetical. So you're currently selected site should be near the top either as most recent or pinned.

jarvislin commented 1 month ago

@antonis Thanks for reviewing this PR and reporting those issues, I'm gonna correct them and let you know once those issues have been fixed.

jarvislin commented 3 weeks ago

Hi @antonis The issues you reported have been resolved. Could you check again? Thanks! @osullivanchris Please take a look at the new changes. Let me know if your found anything needs to be corrected.

antonis commented 3 weeks ago

I'd also like to share some notes/enhancement ideas that can be considered on follow up PRs:

jarvislin commented 3 weeks ago

@antonis Thank you so much for the helpful review/reply.

The idea of analytics really makes sense to me. I'll add/update events.

I noticed that the old "show/hide" functionality persisted the sites after a log out. It would be nice to have the same for the pinned site so that the users won't have to reorganise their sites after a logout on the same device.

"Show/Hide" functionality is also implemented on backend, we fetch the visibility of each site from API so it can restore the state after logging out. Currently, "pin sites" is a client-only feature, I think there's still the possibility of making the sites be restored, but it'd be better if we can store the info via API.

jarvislin commented 3 weeks ago

Hi @wordpress-mobile/mobile-ui-testing-squad, I adjusted the UI test because the UI has been redesigned. Could you take a look at the tests? Thanks

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud