Skip to content

feat(auth): add password visibility toggle to auth forms - #210

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
MaitreyeeDeshmukh:feat/password-visibility-toggle
Jun 9, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
MaitreyeeDeshmukh:feat/password-visibility-toggle

Conversation

@MaitreyeeDeshmukh

Copy link
Copy Markdown
Contributor

Summary

Adds a reusable PasswordInput component and wires it into all four auth forms so users can reveal or mask their password by clicking the eye icon.

Closes #209

Changes

  • new web/src/components/ui/password-input.tsx — reusable component that wraps the existing Input with an Eye/EyeOff toggle from lucide-react (already a dependency, no new packages added)
  • web/src/components/auth/sign-in-form.tsx — password field swapped to PasswordInput
  • web/src/components/auth/sign-up-form.tsx — password field swapped to PasswordInput
  • web/src/components/auth/reset-password-form.tsx — both password fields swapped to PasswordInput, Input import removed (no longer needed)
  • web/src/components/team/accept-invitation-card.tsx — both password fields swapped to PasswordInput

Acceptance criteria

  • Password fields have a working eye toggle (masked by default)
  • Toggle button is type="button" — does not submit the form
  • aria-label set for accessibility (Show password / Hide password)
  • No existing form logic, validation, or state changed
  • TypeScript: zero errors
  • Lint: zero new warnings

- add reusable PasswordInput component to web/src/components/ui/password-input.tsx
- wraps Input with Eye/EyeOff toggle from lucide-react (already a dependency)
- replace all type="password" fields in sign-in, sign-up, reset-password, and accept-invitation forms
- toggle is type="button" to avoid accidental form submission
- has aria-label for accessibility
- default state is masked, no existing form logic changed

Closes ansvisor#209

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.

In the meantime, two things that make review faster:

  • A short description of why the change matters, not just what it does — most of our PRs link a Fixes #... to the issue that explains the why.
  • A quick local test note if there's anything worth eyeballing in the browser.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@MaitreyeeDeshmukh

Copy link
Copy Markdown
Contributor Author

Thanks! The fix is purely UI — to test locally, run the web app, go to any auth form (sign-in, sign-up, reset password, or accept invitation), and click the eye icon on the password field to toggle visibility. Default state is masked, no form behavior changed.

@gkhngyk
gkhngyk merged commit ffc7932 into ansvisor:main Jun 9, 2026
2 checks passed
@gkhngyk

gkhngyk commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Merged — clean reusable PasswordInput wired into all four auth forms, exactly the right approach. Thanks for the great contribution! 🙌 (filed a tiny fix-forward for className passthrough in #211 if you'd like to take it.)

gkhngyk pushed a commit that referenced this pull request Jun 9, 2026
- className="pr-10" placed after {...props} was silently dropping any
  className passed by callers since spread props were overridden
- destructure className from props and merge with cn('pr-10', className)
- pr-10 is always applied as the base; caller className is appended
- no behavior change for the four existing auth form callers (none pass className)

Fixes #211
Follow-up to #210
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(auth): add show/hide password toggle to auth forms

2 participants