Skip to content

Bring SignUp page up to par with Login dark mode, loading state, password toggle#269

Merged
mehul-m-prajapati merged 4 commits into
GitMetricsLab:mainfrom
zen-ash-dev:main
May 17, 2026
Merged

Bring SignUp page up to par with Login dark mode, loading state, password toggle#269
mehul-m-prajapati merged 4 commits into
GitMetricsLab:mainfrom
zen-ash-dev:main

Conversation

@zen-ash-dev
Copy link
Copy Markdown
Contributor

@zen-ash-dev zen-ash-dev commented May 16, 2026

Related Issue


Description

The SignUp page was missing a bunch of stuff Login already had. No dark/light mode support, no loading state on submit, no way to see your password while typing, no animations. The button used onClick instead of a proper <form onSubmit>, and error messages were generic regardless of what the backend returned. There was also a dead block of commented-out mock code in handleSubmit.
Changes made:

  • Wired up ThemeContext so the page follows the app-wide dark/light toggle instead of being locked into one gradient
  • Added an isLoading state — the button disables itself and shows "Creating account..." while the request is in flight
  • Added password show/hide toggle using Eye/EyeOff icons from lucide-react
  • Moved from button onClick to proper <form onSubmit> — pressing Enter now works
  • Error handling now pulls error.response?.data?.message from the backend instead of hiding behind "Something went wrong"
  • Added framer-motion fade-in animations on the branding section and the form card
  • Added autoComplete attributes on all three inputs
  • Removed the commented-out mock API code block

How Has This Been Tested?

  1. Ran npm run dev, navigated to /signup
  2. Toggled dark/light mode on other pages — the SignUp page switches between purple-dark and light themes
  3. Filled the form and clicked the eye icon — password toggles between hidden and visible
  4. Clicked submit — button shows "Creating account..." and is greyed out
  5. Submitted with empty fields — HTML5 validation fires
  6. Built with npm run build — no type errors, no lint warnings

Screenshots (if applicable)

Dark mode Light mode Password visible
![dark](
1-signup-dark ) | ![light]( 3-signup-light ) | ![password]( 2-signup-password-visible ) |

Type of Change

  • Bug fix
  • New feature
  • Code style update
  • Breaking change
  • Documentation update

Summary by CodeRabbit

  • New Features

    • Theme-aware sign-up page with dark and light mode support
    • Password visibility toggle for improved user experience
    • Smooth entry animations on sign-up page
    • Loading indicator during account creation submission
  • Improvements

    • Enhanced error message handling from backend responses
    • Streamlined navigation experience with hidden elements on authentication pages

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 16, 2026

Deploy Preview for github-spy ready!

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d816bd77-95ff-492a-ac8e-89c0d110edd0

📥 Commits

Reviewing files that changed from the base of the PR and between 3722908 and f783c74.

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

📝 Walkthrough

Walkthrough

The Signup page was refactored to be theme-aware, animated, and to add password visibility and loading-aware async submit handling; App now hides chrome (navbar/footer) on fullscreen routes like /signup and /login.

Changes

Sign-up Page Theme and Form Behavior

Layer / File(s) Summary
Imports, state setup, and context consumption
src/pages/Signup/Signup.tsx
Adds ThemeContext and framer-motion imports, backend URL extraction, and local UI state for message, isLoading, and showPassword.
Form submission handler with async control and error extraction
src/pages/Signup/Signup.tsx
handleSubmit attached to <form onSubmit> sets isLoading, wraps axios.post in try/catch/finally, reads error.response?.data?.message, and navigates to /login when response equals "User created successfully".
Hero/header layout and animations
src/pages/Signup/Signup.tsx
Introduces theme-driven gradient backgrounds, decorative elements, and framer-motion entry animation for the branding/title area.
Form card, inputs, password toggle, and loading button
src/pages/Signup/Signup.tsx
Reworks username/email inputs with theme-dependent styling; adds password show/hide toggle via showPassword and Eye/EyeOff icons; submit button is disabled and shows alternate text while isLoading.
Feedback banner, login link, and footer overlay
src/pages/Signup/Signup.tsx
Restyles success/error banner (still substring-driven), adjusts "Sign in here" link layout, and updates footer/background gradient overlay for theme consistency.
App layout: fullscreen route handling
src/App.tsx
Adds FULLSCREEN_ROUTES, computes isFullscreen from useLocation(), hides ScrollProgressBar, Navbar, and Footer on fullscreen routes, and updates <main> classes for fullscreen layout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

type:accessibility

Poem

🐰 I hopped to tweak the signup view tonight,
Light and dark now play beneath the site.
Password peeks and buttons rest when pressed,
Animations greet each form and brand new quest—
A little rabbit's patch to make it right. 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title concisely summarizes the three main improvements: dark mode support, loading state, and password toggle functionality.
Description check ✅ Passed Description includes all required sections with comprehensive details: related issues, detailed change description, testing methodology, screenshots, and change type selection.
Linked Issues check ✅ Passed All eight objectives from issue #268 are implemented: ThemeContext integration, isLoading state, password toggle, form onSubmit migration, backend error handling, framer-motion animations, autoComplete attributes, and dead code removal.
Out of Scope Changes check ✅ Passed Changes to App.tsx for route-aware layout (hiding navbar/footer on fullscreen routes) directly support the SignUp page improvements and are within scope of the PR objectives.

✏️ 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 @zen-ash-dev 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: 2

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

194-202: ⚡ Quick win

Add accessible name/state to the password visibility toggle.

The icon-only button needs an aria-label (and preferably aria-pressed) so screen-reader users can understand and operate it reliably.

Suggested fix
               <button
                 type="button"
                 onClick={() => setShowPassword(!showPassword)}
+                aria-label={showPassword ? "Hide password" : "Show password"}
+                aria-pressed={showPassword}
                 className={`absolute inset-y-0 right-0 pr-4 flex items-center ${
                   mode === "dark" ? "text-slate-400 hover:text-white" : "text-gray-500 hover:text-gray-800"
                 } transition-colors duration-200`}
               >
🤖 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/Signup/Signup.tsx` around lines 194 - 202, The password visibility
toggle button lacks accessible name/state; update the button rendered near
showPassword and setShowPassword to include an aria-label that changes with
state (e.g., "Show password" when showPassword is false and "Hide password" when
true) and add aria-pressed={showPassword} so screen readers know its toggle
state; keep the existing onClick and type="button" behavior and ensure the
accessible text is tied to the showPassword boolean used by the Eye/EyeOff
icons.
🤖 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/Signup/Signup.tsx`:
- Around line 44-46: The redirect is currently gated on an exact
response.data.message string ("User created successfully"), which is fragile;
update the success check in the signup handler (the code that calls
navigate("/login") using the response variable) to rely on a stable indicator
such as HTTP status (e.g., response.status in the 2xx range), a boolean success
flag (response.data.success === true), or presence of a created user id
(response.data.user?.id) instead of the verbose message, and then call
navigate("/login") when that stable condition is met; also keep existing error
handling paths intact so failures still surface to the user.
- Around line 36-42: handleSubmit can be invoked multiple times before React
updates state, so add an early guard using a mutable ref (e.g., isSubmittingRef)
to block duplicate POSTs: at the top of handleSubmit return immediately if
isSubmittingRef.current is true, then set isSubmittingRef.current = true and
setIsLoading(true) before the try, and reset isSubmittingRef.current = false
(and setIsLoading(false)) in the finally block; reference handleSubmit,
isSubmittingRef, setIsLoading to locate where to implement this.

---

Nitpick comments:
In `@src/pages/Signup/Signup.tsx`:
- Around line 194-202: The password visibility toggle button lacks accessible
name/state; update the button rendered near showPassword and setShowPassword to
include an aria-label that changes with state (e.g., "Show password" when
showPassword is false and "Hide password" when true) and add
aria-pressed={showPassword} so screen readers know its toggle state; keep the
existing onClick and type="button" behavior and ensure the accessible text is
tied to the showPassword boolean used by the Eye/EyeOff icons.
🪄 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: b212a702-cf07-4dff-a126-914ca840cb98

📥 Commits

Reviewing files that changed from the base of the PR and between 7a15543 and 3722908.

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

Comment on lines 36 to +42
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setIsLoading(true);

try {
const response = await axios.post(`${backendUrl}/api/auth/signup`,
formData // Include cookies for session
);
setMessage(response.data.message); // Show success message from backend

// Navigate to login page after successful signup
if (response.data.message === 'User created successfully') {
navigate("/login");}


// // Simulate API call (replace with your actual backend integration)
// try {
// // Mock successful signup
// setMessage("Account created successfully! Redirecting to login...");

// // In your actual implementation, integrate with your backend here:
// // const response = await fetch(`${backendUrl}/api/auth/signup`, {
// // method: 'POST',
// // headers: { 'Content-Type': 'application/json' },
// // body: JSON.stringify(formData)
// // });

// setTimeout(() => {
// // Navigate to login page in your actual implementation
// console.log("Redirecting to login page...");
// }, 2000);

} catch (error) {
setMessage("Something went wrong. Please try again.");
const response = await axios.post(`${backendUrl}/api/auth/signup`, formData);
setMessage(response.data.message);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prevent duplicate submit requests in handleSubmit.

Line 38 sets loading, but there’s no early guard; fast repeated Enter/click can still trigger multiple POSTs before re-render.

Suggested fix
 const handleSubmit = async (e: React.FormEvent) => {
   e.preventDefault();
+  if (isLoading) return;
   setIsLoading(true);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setIsLoading(true);
try {
const response = await axios.post(`${backendUrl}/api/auth/signup`,
formData // Include cookies for session
);
setMessage(response.data.message); // Show success message from backend
// Navigate to login page after successful signup
if (response.data.message === 'User created successfully') {
navigate("/login");}
// // Simulate API call (replace with your actual backend integration)
// try {
// // Mock successful signup
// setMessage("Account created successfully! Redirecting to login...");
// // In your actual implementation, integrate with your backend here:
// // const response = await fetch(`${backendUrl}/api/auth/signup`, {
// // method: 'POST',
// // headers: { 'Content-Type': 'application/json' },
// // body: JSON.stringify(formData)
// // });
// setTimeout(() => {
// // Navigate to login page in your actual implementation
// console.log("Redirecting to login page...");
// }, 2000);
} catch (error) {
setMessage("Something went wrong. Please try again.");
const response = await axios.post(`${backendUrl}/api/auth/signup`, formData);
setMessage(response.data.message);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (isLoading) return;
setIsLoading(true);
try {
const response = await axios.post(`${backendUrl}/api/auth/signup`, formData);
setMessage(response.data.message);
🤖 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/Signup/Signup.tsx` around lines 36 - 42, handleSubmit can be
invoked multiple times before React updates state, so add an early guard using a
mutable ref (e.g., isSubmittingRef) to block duplicate POSTs: at the top of
handleSubmit return immediately if isSubmittingRef.current is true, then set
isSubmittingRef.current = true and setIsLoading(true) before the try, and reset
isSubmittingRef.current = false (and setIsLoading(false)) in the finally block;
reference handleSubmit, isSubmittingRef, setIsLoading to locate where to
implement this.

Comment on lines +44 to +46
if (response.data.message === "User created successfully") {
navigate("/login");
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don’t gate redirect on an exact response message string.

Line 44 couples success flow to "User created successfully". Any backend wording change can leave users stuck on signup even after successful creation.

Suggested fix
-      if (response.data.message === "User created successfully") {
+      if (response.status >= 200 && response.status < 300) {
         navigate("/login");
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (response.data.message === "User created successfully") {
navigate("/login");
}
if (response.status >= 200 && response.status < 300) {
navigate("/login");
}
🤖 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/Signup/Signup.tsx` around lines 44 - 46, The redirect is currently
gated on an exact response.data.message string ("User created successfully"),
which is fragile; update the success check in the signup handler (the code that
calls navigate("/login") using the response variable) to rely on a stable
indicator such as HTTP status (e.g., response.status in the 2xx range), a
boolean success flag (response.data.success === true), or presence of a created
user id (response.data.user?.id) instead of the verbose message, and then call
navigate("/login") when that stable condition is met; also keep existing error
handling paths intact so failures still surface to the user.

@zen-ash-dev
Copy link
Copy Markdown
Contributor Author

Hi @mehul-m-prajapati ,
Please review and merge at your earliest convenience to avoid any future conflicts.
Looking forward to your approval. Thank you!

…Bar, auto-label workflow; keep enhanced Signup page with dark/light mode, animations, password toggle
@zen-ash-dev
Copy link
Copy Markdown
Contributor Author

Hi @mehul-m-prajapati , review asap

All merge conflicts have been successfully resolved. Please review and merge at your earliest convenience to avoid any future conflicts. Additionally, could you please add gssoc:approved label to this PR and issue?

Looking forward to your approval. Thank you!

@mehul-m-prajapati mehul-m-prajapati merged commit ab044b5 into GitMetricsLab:main May 17, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉🎉 Thank you for your contribution! Your PR #269 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: Improve SignUp page design with dark/light mode, loading state, password visibility toggle, and animations

2 participants