Problem/Motivation
I think people know what a password is and that they need to enter one that matches their username.
Maybe it wasn't as self-explanatory in... 2001!!!!
git show f358893b52f364ae | grep accompanies
+ $output .= form_password(t("Password"), "pass", $pass, 20, 64, t("Enter the password that accompanies your username."));
+ $output .= form_password(t("Password"), "pass", $pass, 20, 64, t("Enter the password that accompanies your username."));

Steps to reproduce
Proposed resolution

Remaining tasks
We could also remove the description from the username field, one caveat is that we don't allow e-mail logins by default so maybe it's actually useful. But also the field name is 'username' and e-mail login modules change the description anyway I think.
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #2
catchComment #3
catchComment #4
lauriiiThe change seems fine. I think it might be worth writing a CR given that this page is something that might have some special styles and might be featured in a lot of screenshots.
I'm also wondering why not remove descriptions for both fields at once?
Comment #6
catchBoth a CR and removing both descriptions here sounds good.
The test failure is real - locale test is using this as a string to translate.
Comment #7
ckrina+1 on removing the description for the password.
About #4suggestion to remove the description for the user, I'm afraid that might need some more discussion: users can assume it can either be an email or a user name since there are different standard patterns out there. So this description is actually helping with that, and to remove that we should find an alternative way to help with any confusion.
Comment #8
lauriiiI agree that the username pattern is used less and less and may be confusing. However, I'm not sure I understand how the description helps with this, given that the label is already "Username", and the description text is "Enter your username". 🤔 Usually when login uses email, the username field is labelled as "Email". Even in this case you probably wouldn't need additional description because email as the label is already descriptive.
Comment #9
ckrinaAh right, I guess that's true since the description is just adding the same key info as the label. I'm assuming though that in a situation where you can have both username and email, the label shouldn't be "Username or email" but it would ideally add description. But since that's not the default and the description can be added anyway, removing here the existing description for the username makes sense.
Comment #10
catchfwiw #7 was why I originally left this out of the patch/title, but I agree with #8 and #9.
Comment #11
urvashi_vora commentedHi everyone,
I went through the discussion going on here, from the summary based on the updated issue title and the points discussed in #8 and #9, I drew a conclusion that, since the field label mentions "Username", and the description for the Username field is also somewhat similar as "Enter your username", it could be easier to understand the purpose of the field from the label itself and thus the Username field description to be removed along with the description of Password field as per the updated issue title.
After applying the patch provide by @catch in #2, the description for Password field was successfully removed.
I would like to provide a patch for removing the description on Username field.
Please guide me if anything wrong with the patch. I tested the patch in my local system. Also attaching the screenshots of before and after applying the patch.
Thanks
Comment #13
kushagra.goyal commentedAfter removing the description there is no longer necessary to write tests for description and test-cases as encountered failures in patch #11, So according updating the Patch to resolve failure.
Thanks..
Comment #14
kushagra.goyal commentedUpdating patch again as above mentioned patch in #13 have some issues.
Comment #17
sakthi_dev commentedAs the patch failed to apply, created a MR for the same.
Comment #18
smustgrave commentedNot ready for review
Why are we removing an entire test check?
Comment #19
catchYes that test can't be removed, it's testing translation functionality, it just happens to use the login page to do so. Instead, we need to translate a different string and visit the page that string appears on.
Comment #20
spokjeComment #21
spokje- Hidden patches, since we're using the MR-flow
- Opted to translate "Password" in
\Drupal\Tests\locale\Functional\LocaleTranslationUiTest::testStringTranslationwith a lesser known zoological fact about Llamas (wink wink, nudge nudge).- Added a (minimal) draft CR. That needs a look over by a native speaker since it's non-technical, also left "Introduced in version" open.
Comment #22
catchSwitched the after screenshot in the issue summary and made a couple of edits to the change record.
A couple more things we need to sort out.
@Jillian Chueka brought up aria labels in slack - that the description is recommended when aria labels aren't implemented. So I double checked what the markup looks like at the moment.
We do have aria-labelledby and we even have some explicit code referencing it:
This is in UserLoginBlock.
So we need to get rid of that, but also should we add aria-labelledby to replace it?
Comment #23
spokjeThe removing bit is always the easy one...
I think we should add the
aria-labelledbybecause it seems we're loosing accessibility now.However:
1)
aria-labelledbyseems to want an id-selector, which the logical candidates (at least for me), the labels don't have.2) I struggle to find a place where we can set
aria-labelledby.\Drupal\user\Form\UserLoginForm::buildFormknows nothing about the labels.Needs guidance/an actual brain to look at this, so putting on NR.
Comment #24
lauriiiWe don't need the
aria-labelledbyon input elements because labels can reference the input withforattribute which is set automatically by Drupal.Comment #25
spokjeThanks @lauriii, so I was thinking the wrong way-round and this is already covered.
So now it's a proper NR :)
Comment #27
catchlabel
formakes sense, thanks for stopping us going down a rabbit hole.Crediting Jillian Chueka for the slack comments, I think we're fine here after all, but good to find the login block cruft and confirm things.
Translating 'Password' is a great idea to avoid having to completely redo that test.
Since my original patch here only removed one line and not any of the important bits, I think I'm OK to RTBC this one given the +1s from both @ckrina and @lauriii.
btw I realised we should make this change when working on #3323850: Set theme logo fetchpriority to high - on the login page for Umami, the description field is the largest contentful paint, and it was this that actually made me read the password description for the first time in probably years.
Comment #29
catchComment #30
lauriiiCommitted 85700fc and pushed to 11.x. Thanks!