Skip to content

fix: restore password visibility toggle on login page#598

Open
shrey2597 wants to merge 2 commits into
GitMetricsLab:mainfrom
shrey2597:fix-password-toggle
Open

fix: restore password visibility toggle on login page#598
shrey2597 wants to merge 2 commits into
GitMetricsLab:mainfrom
shrey2597:fix-password-toggle

Conversation

@shrey2597
Copy link
Copy Markdown
Contributor

@shrey2597 shrey2597 commented May 28, 2026

Related Issue


Description

This PR restores the password visibility toggle functionality on the login page.


Screenshots

Screenshot 2026-05-28 183253
  • Users can now securely toggle password visibility directly from the login form.

Type of Change

  • Added show/hide password toggle using Eye and EyeOff icons from lucide-react
  • Added showPassword state handling
  • Updated password input field to dynamically switch between "password" and "text"
  • Improved input spacing to properly align the toggle icon
  • Maintained existing UI design and responsiveness

Issue Fixed

The password visibility feature was previously missing from the current login page implementation.

Summary by CodeRabbit

  • New Features
    • Added password visibility toggle to the login form. Users can now reveal or hide their password while entering credentials by clicking the eye icon, providing improved flexibility and control during authentication.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 4b56c03
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a18411a1d3c1f0008bbcf1d
😎 Deploy Preview https://deploy-preview-598--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Warning

Review limit reached

@shrey2597, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 54 minutes and 5 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a97822a8-8664-4ab5-b5a6-59940fa15393

📥 Commits

Reviewing files that changed from the base of the PR and between 16f2b31 and 4b56c03.

📒 Files selected for processing (1)
  • src/pages/Login/Login.tsx
📝 Walkthrough

Walkthrough

The login form gains password visibility toggling by importing icon assets, tracking visibility in local state, and conditionally rendering the password input type alongside a clickable toggle button. Existing authentication and form submission logic remain unchanged.

Changes

Password Visibility Toggle

Layer / File(s) Summary
Icon imports and visibility state
src/pages/Login/Login.tsx
Imports Eye and EyeOff icons from lucide-react and introduces a showPassword React state to track whether the password field should display as plain text or masked.
Toggle button and conditional password input
src/pages/Login/Login.tsx
Password input field dynamically switches its type attribute between password and text based on showPassword state. A right-aligned button allows users to toggle visibility and displays the corresponding icon (eye open or closed).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

quality:clean, type:accessibility

Poem

🐰 A password's veil, now lifts at will,
With eye and icon, both keen and still,
The toggle speaks in silent grace,
No longer hidden, shown with ease!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change—restoring password visibility toggle on the login page, matching the PR's primary objective.
Description check ✅ Passed The description includes the required template sections: Related Issue (#596), a clear Description, a screenshot, and Type of Change details. All critical information is present.
Linked Issues check ✅ Passed The PR successfully addresses all requirements from issue #596: adds password visibility toggle with Eye/EyeOff icons, implements showPassword state, switches input type dynamically, and preserves UI/responsiveness.
Out of Scope Changes check ✅ Passed All changes are directly related to restoring the password visibility toggle feature in src/pages/Login/Login.tsx as specified in the linked issue, with no out-of-scope modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/pages/Login/Login.tsx (1)

129-129: ⚡ Quick win

Make button color theme-aware for consistency.

The toggle button uses a fixed text-gray-500 color while the rest of the component adapts its colors based on the theme mode. Consider making the button color conditional to maintain visual consistency and ensure adequate contrast in both themes.

🎨 Proposed fix for theme consistency
-                  className="absolute right-4 top-1/2 -translate-y-1/2 text-gray-500"
+                  className={`absolute right-4 top-1/2 -translate-y-1/2 ${mode === "dark" ? "text-slate-400" : "text-gray-600"}`}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/Login/Login.tsx` at line 129, The toggle button in Login.tsx
currently uses a fixed class string "absolute right-4 top-1/2 -translate-y-1/2
text-gray-500"; make its color theme-aware by replacing the single-tone text
class with a theme-aware class or conditional (e.g., add a dark: variant or pick
based on the component/theme state) so the button uses an appropriate color in
both light and dark modes (for example use text-gray-500 dark:text-gray-300 or
derive from the existing theme state used by the Login component).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/Login/Login.tsx`:
- Around line 126-132: The password visibility toggle button (the button using
onClick={() => setShowPassword(!showPassword)} and rendering {showPassword ?
<EyeOff .../> : <Eye .../>}) lacks an accessible label; add an aria-label
attribute that reflects the action and state (e.g., "Show password" when
showPassword is false and "Hide password" when showPassword is true) so screen
readers announce its purpose, and ensure the aria-label dynamically updates
based on the showPassword boolean.

---

Nitpick comments:
In `@src/pages/Login/Login.tsx`:
- Line 129: The toggle button in Login.tsx currently uses a fixed class string
"absolute right-4 top-1/2 -translate-y-1/2 text-gray-500"; make its color
theme-aware by replacing the single-tone text class with a theme-aware class or
conditional (e.g., add a dark: variant or pick based on the component/theme
state) so the button uses an appropriate color in both light and dark modes (for
example use text-gray-500 dark:text-gray-300 or derive from the existing theme
state used by the Login component).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 78a41e8a-5e07-4eac-aa5b-f04f49c762c4

📥 Commits

Reviewing files that changed from the base of the PR and between 4ae0ef6 and 16f2b31.

📒 Files selected for processing (1)
  • src/pages/Login/Login.tsx

Comment thread src/pages/Login/Login.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Password Visibility Toggle Missing on Login Page

1 participant