Page MenuHomePhabricator

Add live username validation to mobile account creation form
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
AAlhazwani-WMF
Mar 9 2026, 10:58 AM
Referenced Files
Restricted File
May 13 2026, 11:02 AM
F81203224: Screenshot_1778664959.png
May 13 2026, 9:41 AM
F81203215: Screenshot_1778664950.png
May 13 2026, 9:41 AM
F81202552: IMG_6220.png
May 13 2026, 9:27 AM
F81202446: image.png
May 13 2026, 9:27 AM
F81202689: Screenshot_1778664386.png
May 13 2026, 9:27 AM
F81202463: IMG_6221.PNG
May 13 2026, 9:27 AM
F81202290: IMG_6218.PNG
May 13 2026, 9:27 AM

Description

This task builds on the account creation form cleanup (T409236) by improving the existing username validation experience. Currently, validation triggers almost immediately as users type, jumping straight from no feedback to a validation result. This can feel abrupt - especially on mobile where the keyboard covers half the screen and users are still mid-thought on their username choice.

The goal is a more gradual validation UX: show a lightweight "checking" state early so users know the system is working, but delay the actual validation result until there's a meaningful typing pause. This gives users time to finish typing before seeing success or failure feedback.

User story & summary:

As a new user creating an account on mobile web, I want the username availability check to feel responsive but not rushed so that I have time to finish typing before seeing whether my username is taken.

Design:

Scope: this task is scoped to Mobile only.

Figma designs

image.png (1,870×1,134 px, 333 KB)

Acceptance Criteria:

✅ AC1 - Checking state

  • Given I am on the account creation page on mobile web
  • When I focus the username field and begin typing
  • Then after 250ms, a "Checking availability" message with a spinner is displayed below the username field

✅ AC2 - Validation timing

  • Given the "Checking availability" message is displayed
  • When I continue typing
  • Then the system waits for a 2000ms typing pause (debounce) before running the availability check

✅ AC3 - Available state

  • Given the typing pause threshold has been reached and the availability check has completed
  • When the username is available
  • Then a success message "Username available" with a green checkmark replaces the checking message

✅ AC4 - Taken state (warning)

  • Given the typing pause threshold has been reached and the availability check has completed
  • When the username is taken
  • Then a warning message "[username] is taken" with a warning icon replaces the checking message

✅ AC5 - Taken state (error on submit)

  • Given I have entered a username that is taken
  • When I submit the form by tapping "Create your account"
  • Then an error message "[username] is taken" with an error icon is displayed below the username field
  • And the username field is highlighted with an error state (red border)

✅ AC6 - Revalidation on edit

  • Given a validation result (available or taken) is currently displayed
  • When I modify the username text
  • Then the validation resets to the "Checking availability" state and a new debounce cycle begins

✅ AC7 - Validation on blur

  • Given I am typing in the username field and the debounce threshold has not yet been reached
  • When I blur the field (e.g., tap into the password field)
  • Then the system immediately runs the availability check without waiting for the full debounce
Open questions:
  1. What should the exact copy be for the "username is taken" message, and how should it work together with the existing error messages listed in https://phabricator.wikimedia.org/T414235#11549867?

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
KStoller-WMF moved this task from Product Backlog to Needs Refinement on the Growth-Team board.
Michael set the point value for this task to 3.Mar 23 2026, 2:36 PM

Change #1262149 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/core@master] [DNM][WIP] signup: improve live username validation

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

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

Change #1262149 merged by jenkins-bot:

[mediawiki/core@master] signup: improve live username validation

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

This can be tested in all wikis including testwiki. Needs to use the experiment override param: Special:CreateAccount&mpo=we-1-8-account-creation-form-v2%3Atreatment

Etonkovidova subscribed.

Checked on enwiki beta - all ACs are in place.

Checking availabilityUsername availableUsername not availableUsername not available - red warning
{F80902162}
Screenshot 2026-05-11 at 10.53.43 AM.png (339×739 px, 67 KB)
Screenshot 2026-05-11 at 10.54.04 AM.png (359×739 px, 72 KB)
Screenshot 2026-05-08 at 5.29.24 PM.png (760×1,368 px, 148 KB)
Screenshot 2026-05-08 at 5.30.46 PM.png (718×1,396 px, 135 KB)

Special cases:

  • not a valid user name
    • empty username field

Screenshot 2026-05-08 at 5.27.03 PM.png (708×1,362 px, 144 KB)

  • not valid format

Screenshot 2026-05-08 at 5.25.51 PM.png (752×1,454 px, 166 KB)

Checked on enwiki beta - all ACs are in place.

Checking availabilityUsername availableUsername not availableUsername not available - red warning
{F80902162}
Screenshot 2026-05-11 at 10.53.43 AM.png (339×739 px, 67 KB)
Screenshot 2026-05-11 at 10.54.04 AM.png (359×739 px, 72 KB)
Screenshot 2026-05-08 at 5.29.24 PM.png (760×1,368 px, 148 KB)
Screenshot 2026-05-08 at 5.30.46 PM.png (718×1,396 px, 135 KB)

Special cases:

  • not a valid user name
    • empty username field

Screenshot 2026-05-08 at 5.27.03 PM.png (708×1,362 px, 144 KB)

  • not valid format

Screenshot 2026-05-08 at 5.25.51 PM.png (752×1,454 px, 166 KB)

@Etonkovidova FYI the files attached in the comment above are marked as restricted

image.png (1,412×606 px, 76 KB)
image.png (386×712 px, 73 KB)

Did you test it only on mobile? On PC, it shows a warning when the username is available

image.png (626×198 px, 9 KB)

@Sgs i tested things on a real device - a iphone 13 mini running ios/safari 24.6.2 and this is what i've found

❌ AC4 - Taken state (warning)

  • Given the typing pause threshold has been reached and the availability check has completed
  • When the username is taken
  • Then a warning message "[username] is taken" with a warning icon replaces the checking message

when a username is taken - but also for other types of errors - the system doesn't display the message as a warning message instead it displays the message as an error. the system should display messages as errors only on submit.

IMG_6218.PNG (1,125×2,436 px, 1020 KB)
IMG_6221.PNG (1,125×2,436 px, 955 KB)

tested also on a google pixel 9a simulator - same result

Screenshot_1778664386.png (1,080×2,424 px, 277 KB)


similarly to screenshots posted by @Etonkovidova above i've noticed that the icon of the message is not aligned with the first line of text of the message. is this an issue upstream with codex or is this something we can control? if it's an issue with codex lets file a task.

image.png (339×739 px, 63 KB)
IMG_6220.png (1,125×2,436 px, 563 KB)

ok - i tested this on beta and the "taken username" does display as a warning

Screenshot_1778664950.png (1,080×2,424 px, 241 KB)

but other messages display as an error

Screenshot_1778664959.png (1,080×2,424 px, 252 KB)

Change #1286859 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/core@master] fix(signup.js): display user taken errors as warnings

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

@Sgs i tested things on a real device - a iphone 13 mini running ios/safari 24.6.2 and this is what i've found

❌ AC4 - Taken state (warning)

The reason why some already taken users are returning a red error state, while others get a warning state is because of how the username validation was/is designed. In cases where the source wiki where the create account flow started is the home wiki for a given user, auth.wikimedia will be able to return a userid along with the error "Username entered already in use. Please choose a different name.". Also if the user was created in metawiki (at least that's my observation). That user id is used to determine if the error should be shown as error or warning state. So we're failing to show the warning state for all users taken in a different wiki from the create-account-target wiki. I had overlooked this scenario because in my CentralAuth setup there's only one wiki and the authwiki, so all users source wiki matched the target one. Submitted a fix.


similarly to screenshots posted by @Etonkovidova above i've noticed that the icon of the message is not aligned with the first line of text of the message. is this an issue upstream with codex or is this something we can control? if it's an issue with codex lets file a task.

image.png (339×739 px, 63 KB)
IMG_6220.png (1,125×2,436 px, 563 KB)

I'm investigating it, but it seems indeed something with Codex markup or styles, we didn't add any custom CSS that I know to the validation message. I see some CSS variables are not loading which could cause issues, however the fallback values seems to match the missing variable values so not sure if it is indeed at the culprit.

I checked Codex docs and the miss-alignment is there as well:
{F81206837}

Did you test it only on mobile? On PC, it shows a warning when the username is available

image.png (626×198 px, 9 KB)

@Nemoralis - the warning-style message "Username available" is the current behavior for a validating message and it's present on both - desktop and mobile. The work in this ticket will improve both the logic and the UX of validating usernames/

Change #1287833 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/core@master] fix(HtmlformCheckerV2): prevent validate password bad requests

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

Change #1286859 merged by jenkins-bot:

[mediawiki/core@master] fix(signup.js): display user taken errors as warnings

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

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

[mediawiki/core@master] fix(signup.js): Do not warn about a username being available

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

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

[mediawiki/core@wmf/1.47.0-wmf.2] fix(signup.js): Do not warn about a username being available

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

Change #1287918 merged by jenkins-bot:

[mediawiki/core@master] fix(signup.js): Do not warn about a username being available

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

Change #1288487 merged by jenkins-bot:

[mediawiki/core@wmf/1.47.0-wmf.2] fix(signup.js): Do not warn about a username being available

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

Mentioned in SAL (#wikimedia-operations) [2026-05-18T13:10:07Z] <lucaswerkmeister-wmde@deploy1003> Started scap sync-world: Backport for [[gerrit:1288487|fix(signup.js): Do not warn about a username being available (T419401)]]

Mentioned in SAL (#wikimedia-operations) [2026-05-18T13:11:50Z] <lucaswerkmeister-wmde@deploy1003> lucaswerkmeister-wmde, sgimeno: Backport for [[gerrit:1288487|fix(signup.js): Do not warn about a username being available (T419401)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-05-18T13:19:25Z] <lucaswerkmeister-wmde@deploy1003> Finished scap sync-world: Backport for [[gerrit:1288487|fix(signup.js): Do not warn about a username being available (T419401)]] (duration: 09m 18s)

Change #1287833 merged by jenkins-bot:

[mediawiki/core@master] fix(HtmlformCheckerV2): prevent validate password bad requests

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

All the acceptance criteria in the task seems to be met, so this looks resolvable. Any issues can be filled in a separate ticket for follow up

Change #1290779 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/core@master] fix(signup): show all errors under username with warning state

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

Change #1290779 merged by jenkins-bot:

[mediawiki/core@master] fix(signup): show all errors under username with warning state

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

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

https://c886d213ec.catalyst.wmcloud.org/w/