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

bookmarks onboarding #1420

Merged
merged 37 commits into from
Aug 3, 2023
Merged

bookmarks onboarding #1420

merged 37 commits into from
Aug 3, 2023

Conversation

brindy
Copy link
Contributor

@brindy brindy commented Aug 1, 2023

Task/Issue URL: https://app.asana.com/0/72649045549333/1204685656797210/f
Tech Design URL:
CC:

Description:

Adds bookmarks bar onboarding.

Useful commands:

  • defaults read com.duckduckgo.macos.browser.debug and look for defaults starting with pixel.experiment
  • defaults write com.duckduckgo.macos.browser.debug bookmarks.bar.prompt.shown -bool false to reset the prompt
  • defaults write com.duckduckgo.macos.browser.debug pixel.experiment.cohort "variant1" to set the cohort to the testing variant
  • defaults write com.duckduckgo.macos.browser.debug pixel.experiment.enrollment.date -date "2023-07-23 13:46:46 +0000" to set the enrolment date

Steps to test this PR:

Triggering the prompt

  1. Before checking out this branch run the debug build and get through onboarding
  2. Checkout the code and run it. Add a bookmark. You should not be allocated to an experiment cohort. Use the command above to check.
  3. With clean build (./clean-app.sh debug) run the app. Get through onboarding. Check the defaults and you should see pixel.experiment.installed set to 1
  4. Add a bookmark. At this point you will be allocated to a cohort. If you don't see the popover check the defaults and look for pixel.experiment.cohort and it should be set to control.
  5. If you see the popover, check that it works as expected: "not now" hides the bookmarks bar, "show" turns on the bookmarks bar. You can check this in Settings > Appearance > Bookmarks Bar.
  6. If you didn't see the prompt use the command above to set the cohort to variant1 and then add a new bookmark. This should trigger the prompt.
  7. Use the reset prompt command above and then import some bookmarks. This should trigger the prompt.

Closing the prompt

  1. Clicking "not now" or clicking outside of the prompt should dismiss the prompt without turning the bookmarks bar on.
  2. Clicking "show" will dismiss the prompt and turn on bookmarks bar (note that if you had a previous value for "Always" or "Only on New Tab" this is retained. New users will get "Always".

Pixels

  1. When enrolled you should see the enrolment pixel m_mac_bookmarksbarexperiment_enrollment
  2. When first interacting with the bookmarks bar, e.g. click a bookmark you should see the first interaction pixel m_mac_bookmarksbarexperiment_firstinteraction
  3. Change the date using the above command to a date 2-8 days ago
  4. Interact with the bookmarks bar, you should see the day 2 to 8 pixel m_mac_bookmarksbarexperiment_interaction2to8days
  5. Change the date using the above command to a date 4-8 days ago.
  6. Do a search, you should see the related search pixel m_mac_bookmarksbarexperiment_searched4to8days

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@github-actions
Copy link

github-actions bot commented Aug 1, 2023

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

Generated by 🚫 dangerJS against 129287a

@brindy brindy self-assigned this Aug 1, 2023
@brindy brindy requested review from a team and SabrinaTardio and removed request for a team August 1, 2023 22:37
@brindy brindy marked this pull request as ready for review August 1, 2023 22:37
@brindy brindy assigned SabrinaTardio and unassigned brindy Aug 1, 2023
@brindy
Copy link
Contributor Author

brindy commented Aug 2, 2023

@SabrinaTardio I added a test section for closing the prompt. Duplicates some of the earlier testing steps a little, but is more explicit about what happens if you click outwith the prompt.

Copy link
Collaborator

@SabrinaTardio SabrinaTardio left a comment

Choose a reason for hiding this comment

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

Looks good! I left a couple of comments. The main thing I think you forgot to re add the code to randomise the cohort!


extension BookmarksBarPromptViewController: BookmarksBarPromptDelegate {

func rejectBookmarksBar() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any reason the view controller need know this actions? Can’t be handled directly by the model so that it can take complete ownership of the logic?

Copy link
Contributor Author

@brindy brindy Aug 2, 2023

Choose a reason for hiding this comment

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

Yeah, the dismiss() function is a controller extension. I guess the model could just know about the view controller, but that seems nasty. This feels like controller work rather than view model work to me really.

Copy link
Collaborator

Choose a reason for hiding this comment

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

in that case I would have just the dismiss action as a separate func on the view controller and the actual action on the view model. And the view model can call dismiss on the view controller through the delegate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There you go, is that what you mean?

DuckDuckGo/Statistics/Experiment/PixelExperiment.swift Outdated Show resolved Hide resolved
Copy link
Collaborator

@SabrinaTardio SabrinaTardio left a comment

Choose a reason for hiding this comment

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

LGTM!

@SabrinaTardio SabrinaTardio assigned brindy and unassigned SabrinaTardio Aug 3, 2023
@brindy brindy merged commit ebe7b19 into develop Aug 3, 2023
10 checks passed
@brindy brindy deleted the brindy/bookmarks-bar-prompt-part-2 branch August 3, 2023 16:45
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