Readers Web will be A/B testing the existing treatment of the language switcher and a new treatment being worked on as part of Desktop Improvements (Vector 2022). The initial cohort will be all users (not just logged-in users).
AC
- When I visit a wiki with the A/B test enabled, I receive either the existing treatment or the new one
- When I visit a wiki with the A/B test enabled and I have the magic query string parameter set then it should have the following effects:
Value | Effect |
---|---|
undefined | I'm entered into the A/B test and bucketed as usual |
control | I see the existing treatment |
A | I see the new treatment |
Developer Notes
We can't bucket logged-out users on the server, which complicates things:
We'll have to deliver the page in an "undefined" state until we can make a determination, i.e. we'll have to ship both features in a working state and then reveal one of them to the user. It's worth noting again that, since all JavaScript is loaded asynchronously, there's a small risk that a user who has previously expanded the sidebar, might see a list of 300+ languages suddenly appearing.
Further, we'll have to ensure that users with JavaScript disabled will receive an experience, e.g.
.client-js.vector-language-ab-test { .mw-portlet-lang, .vector-language-switcher { /* Initial state for all users in the A/B test. */ display: none; } }
Finally, the ULS will have to be changed to handle the UI element not being present when it loads. At the time of writing, the ULS binds click event handlers to specific UI elements. If we made the ULS rely on those click events bubbling to the body element, then it would be agnostic of when the UI element was added to the page, i.e.
// L382 $( document.body ).on( 'click', '.uls-trigger', clickHandler // Defined further up in initInterface() );