== Background
more details in {T210653}, **please read** before starting this task. Note that the acceptance criteria in this task does not reflect the final version of the feature.
== Acceptance criteria
[] Toggle is on the mobile settings page for logged in users
[] For anonymous users, no toggle appears
[] The feature is available as a separate setting (not a part of beta)
[] When opting into the new mode using the toggle switch, there's no product need to reload the page (as currently the UI doesn't change in any visible way) but we may want to reload it given in future changes may happen. Developer should decide what makes the most sense here.
= Open questions
[] FeaturesManager::isFeatureAvailableInContext will need to be updated to take a $user object and check the stored value of AMC. It's unclear if that needs to be part of this change or separated into a new task or the talk task (T212216)
[
== Mockup
{F27322644}
== Prototype & workflow
https://wikimedia.invisionapp.com/share/RNO2HHBPK7M#/screens/331909359_Enabling-Disabling
= Developer notes
Note: that the form currently works with and WITHOUT JavaScript
{F27637937}
The form is a standard POST form with the post handled in SpecialMobileOptions::submitSettingsForm
This will need to set a user preference when the user is logged in.
Ideally that user preference should only be set if the value has changed from the default (otherwise every save to this form is going to set a value unnecessarily)
The new field will need to be added if the user is logged in.
Note, in the case of opting into beta mode when logged in, the setting of the mode is handled in [[ https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/includes/MobileContext.php#L272 | setMobileMode ]]. This code might be useful to look at.
The JS mode will be a little trickier.
That will need to inject a toggle box and HIDE the checkbox (see https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/resources/mobile.special.mobileoptions.scripts/mobileoptions.js#L128 and implementation of beta toggle)
Make sure it's possible to tab between the controls as a proxy to check that the form is accessible.
Note: we wil NOT brand the experience like we do with the beta symbol (see screenshot).
{F27638009}
This was added to beta as we got lots of bug reports (screenshots) and didn't know what configuration the user was using so how to replicate, but will not be used in AMC as we are expected the UI changes to be much more obvious.