Skip to content

Conversation

@subsymbolic
Copy link
Contributor

@subsymbolic subsymbolic commented May 4, 2020

Task/Issue URL: https://app.asana.com/0/72649045549333/559623300949085

Steps to test this PR:

TEST 1: Test new toggle text and behavior

  1. Navigate to a page e.g cnn.com
  2. Open the privacy dashboard and ensure that the toggle text is "Site Privacy Protection"
  3. Switch privacy protection off and press back
  4. Ensure page reloads
  5. Ensure page is now in whitelist
  6. Ensure that mp_wla pixel is fired
  7. Navigate to another page e.g facebook.com
  8. Check that privacy toggle is on
  9. Navigate back cnn.com and ensure that the privacy/site protection toggle is back off
  10. Switch the toggle back on
  11. Ensure that mp_wlr pixel is fired
  12. Ensure page is no longer in whitelist

TEST 2: Test new buttons

  1. Navigate to a page and open the privacy Dashboard
  2. Tap the Manage Whitelist button and ensure whitelist page is launched
  3. Ensure the "mp_mw" pixel fires
  4. Go back
  5. Tap the Report Broken Site button and ensure that the broken site button in launched
  6. Ensure the "mp_rb" pixel fires

TEST 3: Test new pixels browsing pixels

  1. Browse to a site
  2. From the browsing menu, add it to the whitelist and ensure that "mb_wla" fires
  3. From the browsing menu, remove it from the whitelist and ensure that "mb_wlr" fires

TEST 4: Test new whitelist settings pixel

  1. Open Settings
  2. Tap Privacy Protection Whitelist
  3. Ensure "ms_mw" fires

TEST 5: Test whitelist page

  1. Open Settings
  2. Tap Privacy Protection Whitelist
  3. Add, edit and delete entries and ensure these behave as expected
  4. Go back to settings and switch theme
  5. Now repeat step 3 to ensure UI still works as expected (note dialogs are universally white as per bookmarks UI)
  6. Repeat this test on API 21`

TEST 6: Test database migration

  1. Cleanly install the app from develop and run the app to ensure the db is initialized
  2. No install this branch over the top to ensure
  3. Run the app and ensure the migration succeeds without anything breaking

Internal references:

Software Engineering Expectations
Technical Design Template

# Conflicts:
#	app/schemas/com.duckduckgo.app.global.db.AppDatabase/19.json
#	app/src/androidTest/java/com/duckduckgo/app/browser/BrowserTabViewModelTest.kt
#	app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
#	app/src/main/java/com/duckduckgo/app/cta/ui/CtaViewModel.kt
#	app/src/main/java/com/duckduckgo/app/global/db/AppDatabase.kt
#	app/src/main/java/com/duckduckgo/app/privacy/ui/PrivacyDashboardActivity.kt
#	app/src/main/java/com/duckduckgo/app/settings/SettingsActivity.kt
#	app/src/main/res/values/string-untranslated.xml
# Conflicts:
#	app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
@subsymbolic subsymbolic marked this pull request as ready for review May 4, 2020 20:19
@cmonfortep cmonfortep self-assigned this May 5, 2020
# Conflicts:
#	app/src/main/res/layout/view_bookmark_entry.xml
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

Only tested the feature (not reviewed the code), I found some small things:

  • Testing on 21-23 API: overflow icon color in whitelist page is rendered with pink color, we should tint the imageview.

  • Testing with destroy activities enabled: Having a whitelisted site, every time I visit "whitelist page" or "report broken site" or "trackers found" from the privacy dashboard and then I going back to privacy dashboard screen, mp_wla is sent without any interaction.

  • Every time I visit privacy dashboard from a whitelisted site, I see the toggle moving from enabled to disabled, I guess it's related with some async query. But the top card image is rendered correctly from the beginning, so wondering if we can avoid that UI distraction.

Open questions:

  • Minor thing, but if I go to privacy dashboard and I switch the toggle twice (interacting but keeping the original state), and going back to the browser, page will reload. is that expected?
  • If I visit a website -> then I whitelist that site from settings -> I go back to the browser -> website doesn't reload. Is that something we expect? or should we detect the change and reload the site?
  • When switching the site privacy protection toggle, should we change somehow the privacy grade to the user? I know it's not possible, but maybe as a future feedback. Currently, I feel like I don't receive any feedback on what's happening.
  • Noticed we removed the trackers statistics from the privacy dashboard. I still haven't checked the code, but it's that something related to this feature?

# Conflicts:
#	app/src/main/res/drawable/ic_overflow.xml
#	app/src/main/res/drawable/ic_overflow_24dp.xml
#	app/src/main/res/drawable/ic_overflow_bookmarks_24dp.xml
#	app/src/main/res/layout/layout_browser_bottom_navigation_bar.xml
#	app/src/main/res/layout/layout_tabs_bottom_navigation_bar.xml
#	app/src/main/res/layout/view_bookmark_entry.xml
# Conflicts:
#	app/src/main/java/com/duckduckgo/app/cta/ui/CtaViewModel.kt
@subsymbolic
Copy link
Contributor Author

Overflow icon color in whitelist page is rendered with pink color

Thanks! This was introduced by another PR and has subsequently been fixed globally by #814.

Testing with destroy activities enabled: Having a whitelisted site, every time I visit "whitelist page" or "report broken site" or "trackers found"...mp_wla is sent without any interaction

Good catch! Fixed.

Every time I visit privacy dashboard from a whitelisted site, I see the toggle moving from enabled to disabled

The visible ui update as the user enters the screen is preexisting behavior. We have had no feedback about and as we expect to either completely redesign or even delete this screen we have no plans to fix it.

If I go to privacy dashboard and I switch the toggle twice (interacting but keeping the original state), and going back to the browser, page will reload. is that expected?

Yes. It's it is an easier implementation this way and I don't think users will find it odd that the page reloads after they have interacted with the toggle. I like your idea of being smarter and only reloading when the value has truly changed (on an odd number of toggles) however I don't think it's worth investing in that level of polish when we are soon deprecating this screen. If we receive feedback that this is unacceptable, we can reconsider. Let me know if you feel strongly otherwise.

If I visit a website -> then I whitelist that site from settings -> I go back to the browser -> website doesn't reload. Is that something we expect? or should we detect the change and reload the site?

Yes this is expected. If the user is in the context of a site and they toggle protection either through the dash toggle or the whitelist menu button then we reload. If the go to whitelists screen via settings however and start adding and removing entries, the user is now outside the context of the current page. We could make this fancier but it also adds complexity. Let me know if you feel strongly about this though.

When switching the site privacy protection toggle, should we change somehow the privacy grade to the user

Again this is preexisting behavior and as we expect to be deprecate this screen this isn't something we plan to change right now.

Noticed we removed the trackers statistics from the privacy dashboard

Oh no that shouldn't happen, thanks for catching it. Fixed! Beware though there is another outstanding issue in develop in this area due to a change from percentage to ratio for prevalence in the backend API. To see any results you'll need to update Entiry.kt to have MAJOR_NETWORK_PREVALENCE = 0.7

Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

This is looking good, all are minor comments or suggestions, nothing blocking. There's only one question from my side about GlobalScope that I would like to see what @CDRussell thinks about.

Testing wise: I only found one small issue, already explained in one of the comments.

@subsymbolic subsymbolic requested a review from cmonfortep May 11, 2020 21:40
Copy link
Contributor

@cmonfortep cmonfortep 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 the tidy up and the work you did here. Tested on API 21, 23, 29. All working as described. 🚀

@subsymbolic subsymbolic merged commit 4fc5b1f into develop May 12, 2020
@subsymbolic subsymbolic deleted the feature/mia/toggle branch May 12, 2020 15:37
@subsymbolic
Copy link
Contributor Author

Thanks for the awesome review 🙏

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.

4 participants