Skip to content

Feat: Add autocomplete attribute to certain user-data specific fields#12080

Merged
lokesh merged 8 commits intointernetarchive:masterfrom
Sadashii:5003/feat/HTML-autocomplete-on-inputs
Mar 12, 2026
Merged

Feat: Add autocomplete attribute to certain user-data specific fields#12080
lokesh merged 8 commits intointernetarchive:masterfrom
Sadashii:5003/feat/HTML-autocomplete-on-inputs

Conversation

@Sadashii
Copy link
Copy Markdown
Contributor

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

Copilot AI review requested due to automatic review settings March 12, 2026 05:37
Copy link
Copy Markdown

@accesslint accesslint Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues across 1 rule.

Repeated issues:

  • openlibrary/templates/account/email/forgot-ia.html Form element has no accessible label. — lines 25, 31

Comment thread openlibrary/templates/account/email/forgot-ia.html Outdated
Comment thread openlibrary/templates/account/email/forgot-ia.html Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 autocomplete attributes to login email/password fields.
  • Add autocomplete="email" to email inputs in account verification failure + “forgot IA email” flows.
  • Add autocomplete attributes to Python-defined auth/register/reset forms in plugins/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

  • ForgotPassword collects an email address but uses Textbox, which renders as type="text". Consider using the Email input type (or otherwise setting type="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)

Comment thread openlibrary/templates/login.html Outdated
Comment thread openlibrary/plugins/upstream/forms.py Outdated
Comment thread openlibrary/templates/account/verify/failed.html Outdated
Comment thread openlibrary/templates/account/email/forgot-ia.html Outdated
Copy link
Copy Markdown

@accesslint accesslint Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 You fixed the issue(s)! Great work.

Sadashii and others added 3 commits March 12, 2026 11:15
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread openlibrary/plugins/upstream/forms.py Outdated
Comment thread openlibrary/plugins/upstream/forms.py
@Sadashii
Copy link
Copy Markdown
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?

@github-actions github-actions Bot added the Needs: Response Issues which require feedback from lead label Mar 12, 2026
Values are not being utilized as inputs are hardcoded in login.html

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lokesh
Copy link
Copy Markdown
Collaborator

lokesh commented Mar 12, 2026

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

@Sadashii if you're interested, it would be helpful to have a broader look at our existing forms and the various paradigms used, and then propose a plan to update with the benefits laid out for us to evaluate.

As for this PR, it's looking good. I'll try to get on testing and we can make sure everything works as expected.

Copy link
Copy Markdown
Collaborator

@lokesh lokesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tried login and signup flows on testing server w/o issue.

@lokesh lokesh merged commit 267e912 into internetarchive:master Mar 12, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Response Issues which require feedback from lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML autocomplete on Known User Info (Sign Up & Login Forms)

3 participants