Page MenuHomePhabricator

Investigate how to modify the Special:CreateAccount page and form fields for an experiment
Closed, ResolvedPublic

Description

In the parent task, T415659, we want to modify the Special:CreateAccount page for logged-out users to see if a less overloaded experience leads to a higher completion rate for that form.

However, that page is constructed only to a small part in \MediaWiki\Specials\SpecialCreateAccount and mainly in \MediaWiki\SpecialPage\LoginSignupSpecialPage.

So, before actually committing to pick up the experiment in the parent task in a sprint, we should run a brief investigation to figure out how we can modify these forms in a clean way, gated by a feature flag, and so that we can toggle it with a Test Kitchen A/B test.

Event Timeline

KStoller-WMF moved this task from Product Backlog to Needs Estimation on the Growth-Team board.
KStoller-WMF subscribed.

The form itself is created in \MediaWiki\SpecialPage\LoginSignupSpecialPage::getFieldDefinitions. I started refactoring this to be more amendable to targeted modification in tests(SpecialCreateAccount): harden type-checking and following changes. More work needed, both conceptually and for the existing changes.

The benefits block is added in \MediaWiki\SpecialPage\LoginSignupSpecialPage::getPageHtml or rather \MediaWiki\SpecialPage\LoginSignupSpecialPage::getBenefitsContainerHtml.
That could probably use more refactoring, I'll need to take another look with fresh eyes.

The logo is being added in \MobileFrontendHooks::onAuthChangeFormFields

The notice message is added in \MediaWiki\Minerva\Hooks::onSpecialPageBeforeExecute. There is also some code in GE about it that removed it when showing campaign benefits: \GrowthExperiments\VariantHooks::onSpecialPageBeforeExecute.

Change #1239103 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/core@master] tests(LoginSignupSpecialPage): add tests covering the form fields

https://gerrit.wikimedia.org/r/1239103

Change #1239203 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/core@master] refactor(LoginSignup): extract field definitions into subclasses

https://gerrit.wikimedia.org/r/1239203

Change #1240774 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] {PoC}: How to hide the benefits block at signup

https://gerrit.wikimedia.org/r/1240774

Change #1242356 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/core@master] HTMLForm: add optional (optional) flag for codex fields

https://gerrit.wikimedia.org/r/1242356

Looking into this further, I noticed that we are already modifying the fields on Special:CreateAccount in substantial ways in GrowthExperiments. In particular, \GrowthExperiments\ConfirmEmailHooks::onAuthChangeFormFields is exactly messing with one of the things that we want to change for this experiment. So, our way forward would be to adjust/generalize that code for varying the fields on Special:CreateAccount. We can also use that for extra styles as needed.

So, looking at the AC in the parent task T415659: [V1 test] Redesign mobile web account creation form following Codex guidelines:

  1. Remove the "Wikipedia is made by people like you. Log in to contribute." message from the top of the form

This will be varied in \GrowthExperiments\VariantHooks::onSpecialPageBeforeExecute and ultimately removed in \MediaWiki\Minerva\Hooks::onSpecialPageBeforeExecute.

  1. Remove the Wikipedia globe (project logo) between the page title and username field

This will have to be modified in the MobileFrontend hook \MobileFrontendHooks::onAuthChangeFormFields

  1. Move "(username policy)" link into the username field description as "Learn more" within the text "Your username is public and cannot be made private later. Learn more"

This is an i18n change for an existing field, it can be done in a hook in GrowthExperiments as mentioned in the first paragraph. We can add it to the description, but we cannot change the copy because that comes from the community.

  1. Move all field helper texts to be field descriptions displayed above input fields, per Codex guidelines

As above, can be done in a GrowthExperiments hook, but needs HTMLForm: support field descriptions to be merged.

  1. Replace password field description with helper text "Passwords must be at least 8 characters" displayed below the input field

As above.

  1. Change email field label from "(recommended)" to "(optional)" using the Codex field component optional indicator prop

Can also be done in the above mentioned GE hook, but needs HTMLForm: add optional (optional) flag for codex fields to be merged first.

  1. Move hCaptcha disclaimer to appear immediately below the "Create your account" button

I'm still not sure if that is possible, or even desirable. As I understand it, this shows up where also the hCaptcha itself will show up. I'll try to get a screenshot for it.

  1. Increase "Create your account" button size using Codex Button component large size prop

Should be doable via the GE hook mentioned above.

  1. Remove the "Wikipedia is made by people like you." section with statistics below the main button
  2. All existing campaign-specific benefits blocks must continue to work as usual, for example: https://thankyou.wikipedia.org/wiki/Thank%20You/en?country=IN

The two items above will be done in the GrowthExperiments hook \GrowthExperiments\VariantHooks::onSpecialCreateAccountBenefits. See also the PoC change for that: https://gerrit.wikimedia.org/r/c/1240774

  1. Remove the warning message "Please look for an email from us to verify your address." that is displayed on focus of the email address field.

This will need messing with the javascript for Special:CreateAccount that lives in resources/src/mediawiki.special.createaccount/signup.js and resources/src/mediawiki.special.createaccount/HtmlformChecker.js. We can use the approach use by editing and discussed in https://wikimedia.slack.com/archives/C01DFMX6QLB/p1771017072380909 (the gist: have the code in core js depend on a config variable that is by default unset, which means normal behavior, and set it in WikimediaEvents for the treatment group. We can also consider setting it just in GrowthExperiments.)

Test wiki created on Patch demo by MGrosse-WMF using patch(es) linked to this task:
https://776f2cc0f0.catalyst.wmcloud.org/w/

Michael removed a project: Patch-For-Review.

Let's close this. The investigation is done and implementation is happening in T415659.

We'll revisit the open changes when we get to actually implementing the changes after the experiment was successful.

Test wiki on Patch demo by MGrosse-WMF using patch(es) linked to this task was deleted:

https://776f2cc0f0.catalyst.wmcloud.org/w/

Change #1240774 abandoned by Michael Große:

[mediawiki/extensions/GrowthExperiments@master] {PoC}: How to hide the benefits block at signup

Reason:

This work has concluded in Ib5b19c40abda44b51939cafae01be7cb65aba8d2

https://gerrit.wikimedia.org/r/1240774

Change #1239203 abandoned by Michael Große:

[mediawiki/core@master] refactor(LoginSignup): extract field definitions into subclasses

Reason:

This needs to be redone from scratch due to not having been reviewed in time for Iee41278c4 (commit 4bee8ab, task T418534) to be merged.

https://gerrit.wikimedia.org/r/1239203