Skip to content

feat: add password visibility toggle to login form#376

Merged
mehul-m-prajapati merged 2 commits into
GitMetricsLab:mainfrom
shrey2597:add-login-password-toggle
May 23, 2026
Merged

feat: add password visibility toggle to login form#376
mehul-m-prajapati merged 2 commits into
GitMetricsLab:mainfrom
shrey2597:add-login-password-toggle

Conversation

@shrey2597
Copy link
Copy Markdown
Contributor

@shrey2597 shrey2597 commented May 21, 2026

Description

Added a password visibility toggle (eye icon) to the Login form for better usability and consistency with the Sign Up page.

image

Changes Made

  • Added Eye and EyeOff icons using lucide-react
  • Added show/hide password functionality
  • Improved user experience
  • Maintained consistency between Login and Sign Up pages

Fixes #361

Summary by CodeRabbit

  • New Features
    • Added a password visibility toggle button on the login page. Users can now show or hide their entered password with a click.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 21, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit c2a2786
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a0f5dba6795400008b06673
😎 Deploy Preview https://deploy-preview-376--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 21, 2026

Warning

Rate limit exceeded

@shrey2597 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 47 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3b6bf047-0eeb-4964-acd1-7b346ec9ddb4

📥 Commits

Reviewing files that changed from the base of the PR and between af8f856 and c2a2786.

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

Walkthrough

The Login page now includes a password visibility toggle feature. Icon imports (Eye, EyeOff) are added, local React state tracks password visibility, and the password input switches between masked and plain text with a toggle button to control the view.

Changes

Password Visibility Toggle

Layer / File(s) Summary
Password visibility toggle UI
src/pages/Login/Login.tsx
Eye and EyeOff icons are imported; showPassword state controls whether the password input is displayed in plain text or masked; password input type is conditional on state, and a right-aligned toggle button switches the state while swapping the displayed icon.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A toggle appears, both eyes open wide,
Eye and EyeOff, side by side,
Password shown or hidden with care,
Login form now has flair! 👁️✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a password visibility toggle to the login form, which matches the primary objective of the PR.
Description check ✅ Passed The description covers the key sections with changes made, includes a screenshot, references the linked issue, but lacks explicit mention of testing and is missing the structured template format with the 'Type of Change' checklist.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #361: implements password visibility toggle with eye icons, adds show/hide functionality, and maintains consistency with the Sign Up page.
Out of Scope Changes check ✅ Passed All changes in the PR are directly related to the stated objectives in issue #361. The password visibility toggle implementation stays within the scope of the linked issue with no unrelated modifications detected.
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

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

🎉 Thank you @shrey2597 for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines

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)

111-134: 💤 Low value

Inconsistent indentation in the password field block.

This block uses a different indentation style (mix of 1-space and 2-space) than the rest of the form (e.g., the email block at lines 94–109 uses consistent 14-space/JSX indentation). Re-formatting to match the surrounding code will keep diffs clean and avoid churn from formatters.

🎨 Suggested reformat
-           <div className="relative">
-  <input
-    type={showPassword ? "text" : "password"}
-    name="password"
-    autoComplete="current-password"
-    placeholder="Enter your password"
-    value={formData.password}
-    onChange={handleChange}
-    required
-    className={`w-full pl-4 pr-12 py-4 rounded-2xl focus:outline-none transition-all ${
-      mode === "dark"
-        ? "bg-white/5 border border-white/10 text-white placeholder-slate-400 focus:ring-2 focus:ring-purple-500"
-        : "bg-gray-100 border border-gray-300 text-gray-900 placeholder-gray-500 focus:ring-2 focus:ring-purple-400"
-    }`}
-  />
-
-  <button
-    type="button"
-    onClick={() => setShowPassword(!showPassword)}
-    className="absolute right-4 top-1/2 -translate-y-1/2 text-gray-500"
-  >
-    {showPassword ? <EyeOff size={20} /> : <Eye size={20} />}
-  </button>
-</div>
+            <div className="relative">
+              <input
+                type={showPassword ? "text" : "password"}
+                name="password"
+                autoComplete="current-password"
+                placeholder="Enter your password"
+                value={formData.password}
+                onChange={handleChange}
+                required
+                className={`w-full pl-4 pr-12 py-4 rounded-2xl focus:outline-none transition-all ${
+                  mode === "dark"
+                    ? "bg-white/5 border border-white/10 text-white placeholder-slate-400 focus:ring-2 focus:ring-purple-500"
+                    : "bg-gray-100 border border-gray-300 text-gray-900 placeholder-gray-500 focus:ring-2 focus:ring-purple-400"
+                }`}
+              />
+              <button
+                type="button"
+                onClick={() => setShowPassword(!showPassword)}
+                className="absolute right-4 top-1/2 -translate-y-1/2 text-gray-500"
+              >
+                {showPassword ? <EyeOff size={20} /> : <Eye size={20} />}
+              </button>
+            </div>
🤖 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` around lines 111 - 134, The password input block
in Login.tsx has inconsistent indentation compared to the email block; reformat
the JSX inside the <div className="relative"> that contains the password <input>
and the visibility <button> so its opening tag, props (type, name, autoComplete,
placeholder, value, onChange, required, className), and the button JSX align
with the rest of the form's indentation style (match the email field's spacing),
preserving the same attribute order and keeping references to showPassword and
setShowPassword unchanged; run the project's formatter after adjusting to ensure
consistent diffs.
🤖 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 127-133: The password visibility toggle button in Login.tsx (the
button using showPassword and setShowPassword and rendering Eye/EyeOff) lacks
accessible labeling; update that button to include an aria-label that describes
its action (e.g., "Show password" vs "Hide password") and add aria-pressed
reflecting the boolean showPassword state, and ensure the same change is applied
to the equivalent toggle in the Sign Up page for parity.

---

Nitpick comments:
In `@src/pages/Login/Login.tsx`:
- Around line 111-134: The password input block in Login.tsx has inconsistent
indentation compared to the email block; reformat the JSX inside the <div
className="relative"> that contains the password <input> and the visibility
<button> so its opening tag, props (type, name, autoComplete, placeholder,
value, onChange, required, className), and the button JSX align with the rest of
the form's indentation style (match the email field's spacing), preserving the
same attribute order and keeping references to showPassword and setShowPassword
unchanged; run the project's formatter after adjusting to ensure consistent
diffs.
🪄 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: b9c10c31-7c88-4b58-9c4d-c1321cc21b2a

📥 Commits

Reviewing files that changed from the base of the PR and between 9d34c19 and af8f856.

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

Comment thread src/pages/Login/Login.tsx Outdated
@mehul-m-prajapati mehul-m-prajapati merged commit 393dd52 into GitMetricsLab:main May 23, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉🎉 Thank you for your contribution! Your PR #376 has been merged! 🎉🎉

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.

Feature: Add Show/Hide Password Toggle to Login Form

2 participants