Skip to content

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

Open
Sadashii wants to merge 7 commits intointernetarchive:masterfrom
Sadashii:5003/feat/HTML-autocomplete-on-inputs
Open

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

Conversation

@Sadashii
Copy link
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

@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

Copy link
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)

Copy link

@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
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.

@Sadashii
Copy link
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
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