== User Story
As an advanced editor, I would like to know when advanced mobile contributions are available
== Design
| person lands on page | drawer appears after short delay, taps "Enable" | advanced mode enabled, toast displays
| {F29605506} | {F29605509} | {F29605512}
Link to svg: https://upload.wikimedia.org/wikipedia/commons/0/07/Advanced_mobile_features_graphic.svg
== Acceptance Criteria
[] Note: Public name for AMC was changed in T225747. Although above mocks still refer to "Advanced contributions mode", the actual copy should instead read as "Advanced mode"
[] Display the modal for all logged in editors with >100 edits on the mobile website who are not in AMC mode
[] The 100 edit threshold should be configurable. It should be possible to show to editors with 0 edits.
[] The modal must be displayed only once
[] Selecting "try it out" should turn on AMC automatically (without requiring the user to go to the settings page
[x] To support T226069 make sure that drawers render above overlays in the display stack (higher z-index) (Per https://phabricator.wikimedia.org/T226068#5385909 the drawer should go under the overlay)
= Developer notes
Things we'll need:
1) The drawer (can use existing CtaDrawer code)
```
drawer = new d( { content: 'text goes here', progressiveButton: { label: 'Enable', progressive: true, events: { 'click': () => alert(5) } }, actionAnchor: { label: 'No thanks' } } ); drawer.$el.appendTo( document.body ); drawer.show()
2) Code to take care of the enabling - the click event above will need to make an API request to Special:Preferences to set
Something like:
```/w/api.php?action=options&format=json&optionname=amc&optionvalue=1```
(note you'll need a token and the correct optionname)
= QA steps (when available on beta cluster, should be ready to test Aug 21)
This is a bit of a pain to test multiple times because the drawer should only show once per browser/device combo. A way to get around this is to use a new incognito mode window in chrome (iOS Safari has their own version of that at https://support.apple.com/en-us/HT203036) every time you want to see the drawer:
1) If you have enabled AMC at https://en.m.wikipedia.beta.wmflabs.org, turn it off
2) Close all previous incognito windows, launch a new incognito window, and login to https://en.m.wikipedia.beta.wmflabs.org
3) You should see the drawer
== When user is logged in with AMC turned off and user declines
[] Follow steps 1 - 3 and assert that you see the drawer.
[] Assert that you cannot scroll when the drawer is visible and the drawer remains visible when attempting to scroll.
[] Dismiss the drawer by tapping the "No thanks" link or by tapping the black part of the overlay.
[] After dismissing the drawer, refresh the page. You should not see the drawer again if you are using the same browser on the same device (unless you launch a new incognito window).
== When user is logged in with AMC turned off and user accepts
[] Follow steps 1 - 3 and assert that you see the drawer.
[] Enable AMC by tapping the "Enable advanced mode" button. Assert that the page refreshes with AMC mode turned on. You should remain on the page that you enabled AMC from (you should NOT see the settings page).
[] After enabling, refresh the page. You should not see the drawer again.
[] Make sure you can disable AMC mode by going to the mobile settings page and toggling AMC mode off. Assert that you do not see the drawer again after turning AMC mode off.
[] Refresh the page and assert that you do not see the drawer again.
== When user is anon
[] Close all previous incognito windows and launch a new incognito window at https://en.m.wikipedia.beta.wmflabs.org
[] Assert that you do not see the drawer (anon users should not see the drawer)
== When user is logged in with AMC turned on
[] Follow steps 1 - 3 and assert that you see the drawer. Now log out.
[] Log back in to https://en.m.wikipedia.beta.wmflabs.org
[] Make sure when you log back in that AMC remains on and you do not see the drawer