Describe the bug
While writing tests with Cypress, I found that in the /settings
page when you try to change your username with a capital letter, it silently get's converted to lowercase. For example: if Quincy
was input, it get's converted to quincy
.
To Reproduce
Steps to reproduce the behavior:
Save
Expected behavior
It should show an error message or warn the user that capital letters in name will get converted to lowercase.
I'm seeing this in the actual input box itself. When I type "NHCARRIGAN", the input box shows "nhcarrigan" even before save.
This behavior is intentional. At the minute we have a bug with case sensitivity and it works best if usernames are in small case.
I figured the behaviour was intentional, but should it be silent?
Maybe a note above/below the input that says "must be all lowercase letters"?
Maybe a note above/below the input that says "must be all lowercase letters"?
Yes, it could be part of the validation message. A PR is welcome to clear up the confusion.
This line makes it lowercase:
This is something which we want to keep because of the current limitations.
But I am not sure about yet another alert type info, because already have a couple which would clutter the UI
Hey @ahmadabdolsaheb could you guide here?
I think that Username (lowercase only)
should be enough. (We could also use Username (lowercase alphanumeric only)
if we want to be more explicit.)
Since we haven't had any objections lets go with Username (lowercase only)
.
We could go with:
but have the text "Characters must be lowercase". So, rather than transforming each character, we just validate in the usual way.
So... have a warning like that would suffice?
@Twaha-Rahman it seems odd to treat capitals differently from any other symbol we're not allowing. With that in mind I think we should just have a warning like that and remove https://github.com/freeCodeCamp/freeCodeCamp/blob/4e51e845bb1fd3d044ccc2b7a121584d172f5ebd/client/src/components/settings/Username.js#L99
@raisedadead is that reasonable?
If we do want to remove the forced lowercasing in that input field we want to make sure its lowercased elsewhere before being sent to the API.
Sure. What I'm suggesting is that it's forced to be lowercase by validation, so you can't click submit until all the characters are lowercase.
To be on the safe side, I think we should validate in here
as well.
I'll be getting back to this after I get #39622 merged. That way I can add the tests for this feature in this PR.
Thanks, Twaha. Take whatever time you need.
Personnality I think this is nice like that. Nothing to do!
Most helpful comment
Since we haven't had any objections lets go with
Username (lowercase only)
.