Note: T212516 needs to be fixed before turning this on.
Consider a feature branch to speed up development and encourage you to break this work into small progressive easily-reviewable chunks rather than one giant commit. Sync with whoever is working on T212216
Background
more details in T210653: [EPIC] AMC - Opting in, 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 server and client side
- For anonymous users, no toggle appears server or client side
- The feature is available as a separate setting (not a part of beta)
- When opting into the new mode page reloads.
- When a user opts in to (or out of) the AMC mode we need to ensure it is logged and compatible with Schema:PrefUpdate in WikimediaEvents per T212516. Make sure it uses either the WikimediaEventsHooks::onUserSaveOptions hook or the API. Note that if we use and update the hook, we also get T212516 fixed for free!
Mockup
Prototype & workflow
https://wikimedia.invisionapp.com/share/RNO2HHBPK7M#/screens/331909359_Enabling-Disabling
Developer notes
Note: that the form currently works with and WITHOUT JavaScript
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.
This preference is likely needed to be registered in Special:Preferences (although can be added as a hidden preference). See MFEnableMobilePreferences for how we're managing mobile preferences currently.
Note, in the case of opting into beta mode when logged in, the setting of the mode is handled in 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).
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.
Removed from AC:
-
FeaturesManager::isFeatureAvailableInContext will need to be updated to take a $user object and check the stored value of AMC. This is needed for the talk tab task (T212216).
☝️ Declined per T211197#4936296.
Signoff steps
- setup task to turn on amc mode with talk feature in production
- unstall T212516
QA Results
AC | Status | Details |
1 | ✅ Passed | T211197#4946212 |
2 | ✅ Passed | T211197#4946212 |
3 | ✅ Passed | T211197#4946212 |
4 | ✅ Passed | T211197#4946212 |
5 | ✅ Passed | T211197#4951773 |
QA Results : Production
AC | ES | AR | ID | Details |
1 | ✅ | ✅ | ✅ | T211197#5047330 |
2 | ✅ | ✅ | ✅ | T211197#5047330 |
3 | ✅ | ✅ | ✅ | T211197#5047330 |
4 | ✅ | ✅ | ✅ | T211197#5047330 |
5 | ⬜ | ⬜ | ⬜ | Not in scope |