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

Add rewards onboarding tour for desktop #7170

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

zenparsing
Copy link
Collaborator

@zenparsing zenparsing commented Nov 17, 2020

Resolves brave/brave-browser#12459

This PR adds a rewards onboarding tour UI for desktop. The rewards tour is displayed on the rewards page, the rewards panel, and the tipping banner. The tour components support both "narrow" and "wide" layouts, with the "wide" layout displayed on the rewards page.

Note that this PR does not include the "initial settings" panel in the rewards tour that allows the user to set AC and ads options.

Other changes

  • Rewards Panel
    • Increase the minimum height by 10px to give more room for the tour modal.
  • Rewards Page
    • Modified OnAdsEnabled observer so that AC status on onboarding status are refreshed when ads are enabled.
    • Onboarding rendering moved from pageWallet.tsx to settingsPage.tsx
    • Added a handler for //rewards/enabled URL which executes rewards opt-in. This is indended for future use by the rewards onboarding button in the welcome UI.
    • Added new rewards onboarding UI to panel. Instead of a modal, onboarding is now rendered as a "card", hiding the rewards settings until the user opts in.
    • Added tour reminder promo for users that aren't shown onboarding, but do not have ads enabled.
    • Modified CSS grid properties for main layout grid.
  • Shared components
    • Migrated BAT icon from brave-ui.
    • Added a generic caret icon.
    • Added close icon to generic modal component.
  • Onboarding components
    • Removed hidden and unused "Add funds" UI.
    • Modified all primary action buttons to use a pointer cursor.

Submitter Checklist:

  • There is a ticket for my issue.
  • Used Github auto-closing keywords in the commit message.
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed).
  • Requested a security/privacy review as needed.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

This PR implements the rewards onboarding tour and changes to the onboarding experience on the Rewards settings page (designs in Figma).

Note that the following design features are not included in this change and will be implemented in future PRs:

  • The ability to set "Ads per day" and the "monthly contribution amount" from the rewards onboarding tour.
  • A screen on the rewards panel indicating when the first payout will occur.
  • A "toast" popup on the rewards panel for users that have previously dismissed the onboarding modal.

Rewards Page

  • After opting in from the welcome UI, the rewards tour should be displayed automatically when the rewards page is opened.
  • The rewards page should display the tour in a "wide" format.
  • The rewards page opt-in should not be a modal. Instead, it should be a box that is displayed in place of the settings options.
  • The "terms of service" and "privacy policy" links on the onboarding box should work correctly.
  • The "Take a quick tour" link on the onboarding box should open the onboarding tour.
  • After clicking the "Start Using Brave Rewards" button on the onboarding box the user should be shown the onboarding tour, settings should be displayed, and Ads and AC should be enabled.
  • If the user has disabled Ads, the onboarding box should not be displayed again.
  • If the user has disabled Ads, a rewards tour promo link should be displayed under the wallet box.
  • Clicking "Take a quick tour" on the rewards tour promo should open the rewards tour.
  • Clicking the "x" on the tour promo should hide the promo.
  • Legacy users that have enabled rewards prior to 1.18 and have disabled Ads should be shown the tour promo.

Rewards Panel

  • A "Take a tour" link should be displayed on the onboarding modal.
  • The onboarding tour should be displayed when "take a tour" is clicked.
  • The onboarding tour should be displayed when "Start using Brave Rewards" is clicked.

Tip Dialog

  • A "Take a tour" link should be displayed on the onboarding screen.
  • The onboarding tour should be displayed when "take a tour" is clicked.
  • The onboarding tour should be displayed when "Start using Brave Rewards" is clicked.
  • Clicking the "X" button while the tour is displayed should close the tip dialog.

Onboarding Tour (General)

  • The navigation bullets should navigate correctly through tour.
  • The continue and back buttons should navigate correctly through the tour.
  • If the user opted in to rewards, the "skip" link should take them to the last panel in the tour. Otherwise, the "skip" link should close the tour.

@zenparsing zenparsing force-pushed the ksmith-rewards-onboarding-tour branch 6 times, most recently from 52ac5b1 to 6975072 Compare November 24, 2020 21:44
@zenparsing zenparsing self-assigned this Nov 24, 2020
@zenparsing zenparsing force-pushed the ksmith-rewards-onboarding-tour branch 8 times, most recently from e75d9ea to cc4303e Compare December 3, 2020 21:57
@zenparsing zenparsing marked this pull request as ready for review December 4, 2020 17:03
@zenparsing zenparsing requested a review from a team as a code owner December 4, 2020 17:08
@zenparsing zenparsing force-pushed the ksmith-rewards-onboarding-tour branch 2 times, most recently from 5a5f486 to cf807b2 Compare December 4, 2020 17:45
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

@zenparsing zenparsing force-pushed the ksmith-rewards-onboarding-tour branch 3 times, most recently from ac85703 to af216c5 Compare December 16, 2020 16:46
@zenparsing zenparsing force-pushed the ksmith-rewards-onboarding-tour branch from af216c5 to a37a81a Compare December 17, 2020 21:24
@zenparsing
Copy link
Collaborator Author

CI notes:

  • ios failed on unrelated test [AdsWrapperTest testPreferencePersistance]
  • post-init failed on known lint issue. Lint passes locally.

@zenparsing zenparsing merged commit aff9b7e into master Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement rewards onboarding tour
2 participants