Bug 1387220 - [onboarding]document how to show notification and snippets;r=mossop

MozReview-Commit-ID: 47UIKw4NAQX

--HG--
extra : rebase_source : eb34d2ee4b146754c9337b6b314f3c9ab17643d8
This commit is contained in:
gasolin 2017-08-04 10:52:13 +08:00
parent e530ba4d43
commit d5ec85700b

View File

@ -13,20 +13,31 @@ browser.onboarding.tour-set = "new" // for new user tour, or "update" for update
```
And make sure the value of `browser.onboarding.tourset-verion` and `browser.onboarding.seen-tourset-verion` are the same.
## How to show the onboarding notification
Besides above settings, notification will wait 5 minutes before showing the first notification on a new profile or the updated user profile (to not put too much information to the user at once).
To manually remove the mute duration, set pref `browser.onboarding.notification.mute-duration-on-first-session-ms` to `0` and notification will be shown at the next time you open `about:home` or `about:newtab`.
## How to show the snippets
Snippets (the remote notification that handled by activity stream) will only be shown after onboarding notifications are all done. You can set preference `browser.onboarding.notification.finished` to `true` to disable onboarding notification and accept snippets right away.
## Architecture
Everytime `about:home` or `about:newtab` page is opened, onboarding overlay is injected into that page.
`OnboardingTourType.jsm` will check the onboarding tour type (currently support `new` and `update`). Then in `onboarding.js`, All tours are defined inside of `onboardingTourset` dictionary. `getTourIDList` function will load tours from proper preferences. (Check `How to change the order of tours` section for more detail).
When user clicks the action button in each tour, We use [UITour](http://bedrock.readthedocs.io/en/latest/uitour.html) to highlight the correspondent browser UI element.
When user clicks the action button in each tour, We use [UITour](http://bedrock.readthedocs.io/en/latest/uitour.html) to highlight the correspondent browser UI element. The UITour client is bundled in onboarding addon via `jar.mn`.
## Landing rules
We would apply some rules:
* All styles and ids should be formatted as `onboarding-*` to avoid conflict with the origin page.
* All strings in `locales` should be formatted as `onboarding.*` for consistency.
* To avoid conflict with the origin page, all styles and ids should be formatted as `onboarding-*`.
* For consistency and easier filtering, all strings in `locales` should be formatted as `onboarding.*`.
* For consistency, all related preferences should be formatted as `browser.onboarding.*`.
* For accessibility, images that are for presentation only should have `role="presentation"` attribute.
## How to change the order of tours