Feat: Add autocomplete attribute to certain user-data specific fields#12080
Open
Sadashii wants to merge 7 commits intointernetarchive:masterfrom
Open
Feat: Add autocomplete attribute to certain user-data specific fields#12080Sadashii wants to merge 7 commits intointernetarchive:masterfrom
Sadashii wants to merge 7 commits intointernetarchive:masterfrom
Conversation
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull request overview
Adds HTML autocomplete metadata to authentication-related form inputs to better support browser autofill and WCAG 2.1 SC 1.3.5 (Identify Input Purpose).
Changes:
- Add
autocompleteattributes to login email/password fields. - Add
autocomplete="email"to email inputs in account verification failure + “forgot IA email” flows. - Add
autocompleteattributes to Python-defined auth/register/reset forms inplugins/upstream.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| openlibrary/templates/login.html | Adds autocomplete for login identifier + password fields |
| openlibrary/templates/account/verify/failed.html | Adds autocomplete="email" to resend-verification email input |
| openlibrary/templates/account/email/forgot-ia.html | Adds autocomplete to email + password inputs for IA-email recovery |
| openlibrary/plugins/upstream/forms.py | Adds autocomplete attributes to login/register/forgot/reset form inputs |
Comments suppressed due to low confidence (1)
openlibrary/plugins/upstream/forms.py:157
ForgotPasswordcollects an email address but usesTextbox, which renders astype="text". Consider using theEmailinput type (or otherwise settingtype="email") so the rendered forgot-password form gets the correct semantics and benefits from browser validation/autofill.
return True
validate_password = Validator(_("Invalid password"), verify_password)
…dashii/openlibrary into 5003/feat/HTML-autocomplete-on-inputs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
@lokesh You can have a look, while this PR has changes with low importance, one major issue I saw is that while some auth forms use forms defined in plugins/upstream/forms.py, some use native html and login.html uses a hybrid mix, this causes quite a lot of confusion in my opinion. Is this something worth creating an Issue ticket for and changing to python forms for consistency? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5003
This PR adds autocomplete attributes to certain user-related data fields on the site to enable faster input during auth steps
Technical
Testing
While most browsers these days autocomplete themselves based on attributes like type, name, in certain cases the autocomplete may help. Can be tested on the signup page, password field is defined as 'new-password' (as new account), browsers should now suggest a new password and not existing account password.
Screenshot
Stakeholders
@lokesh