Skip to content

fix: signup toggle not switching modes#229

Open
TheBinaryAVA wants to merge 1 commit into
GitMetricsLab:mainfrom
TheBinaryAVA:fix/signup-dark-mode
Open

fix: signup toggle not switching modes#229
TheBinaryAVA wants to merge 1 commit into
GitMetricsLab:mainfrom
TheBinaryAVA:fix/signup-dark-mode

Conversation

@TheBinaryAVA
Copy link
Copy Markdown

@TheBinaryAVA TheBinaryAVA commented May 13, 2026

Description

The Signup page had hardcoded styles that did not respond to theme changes.

This PR updates the styles using Tailwind's dark mode utilities (dark:) to ensure proper visual switching between light and dark themes. The UI now adapts correctly when the theme toggle is used.


Fixes #228

Type of Change

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

How Has This Been Tested?

  • Verified that theme toggle updates UI on Signup page
  • Checked both light and dark modes manually in browser

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced signup form with improved user feedback messaging
  • Style

    • Redesigned signup page with updated visual styling
    • Added dark mode support to the signup experience
    • Updated form inputs, submit button, and message banner
    • Improved footer link appearance

Review Change Stack

The Signup page had hardcoded styles that did not respond to theme changes.

This PR updates the styles using Tailwind dark mode utilities to ensure proper visual switching between light and dark themes.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 13, 2026

Deploy Preview for github-spy ready!

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

📝 Walkthrough

Walkthrough

The signup page is refactored to integrate backend authentication via axios, replacing the previous submission flow. The component imports useNavigate from React Router, updates the form handler to POST credentials to the backend signup endpoint, and navigates to login on successful user creation. All form inputs, buttons, and layout receive comprehensive Tailwind styling with dark-mode support.

Changes

Signup Page Refactor

Layer / File(s) Summary
Submission handler and module structure
src/pages/Signup/Signup.tsx
React Router imports consolidate useNavigate alongside Link, the handleSubmit function now calls axios POST to ${backendUrl}/api/auth/signup, sets user-facing message from response, and conditionally navigates to /login when the message equals "User created successfully". Main JSX layout and logo section are restructured.
Form inputs and UI styling
src/pages/Signup/Signup.tsx
Username, email, and password inputs are restyled with updated Tailwind classes including dark-mode, background, border, placeholder, and focus-ring behavior. Submit button, success/error message banner condition, and footer sign-in link presentation are also updated with new Tailwind styling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

gssoc25, level1

Poem

🐰 A signup form hops into the light,
With axios-bound requests taking flight,
Dark-mode tailwinds styling each input line,
From backend response to navigation's sign—
Where forms and flows in harmony align! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'fix: signup toggle not switching modes' does not match the actual changes. The raw summary shows UI restyling with dark-mode Tailwind classes and signup submission handler updates, while the PR objectives indicate the fix is about enabling dark mode support. The title is misleading about what the 'toggle' problem actually is. Update the title to accurately reflect the main change, such as 'fix: enable dark mode support on signup page' or 'fix: add Tailwind dark mode styling to signup'.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description covers the main objective (dark mode support), includes the issue reference, specifies the bug fix type, and documents testing approach.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/pages/Signup/Signup.tsx (1)

87-106: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Missing accessible labels for form inputs.

All three input fields rely solely on placeholder attributes without corresponding <label> elements or aria-label attributes. This makes the form difficult or impossible to use with screen readers, as the field purpose is not announced. Placeholders also disappear when users start typing.

♿ Proposed fix using visually-hidden labels

For each input, add a <label> element. If you want to keep the current visual design, use Tailwind's sr-only class to hide labels visually while keeping them accessible to screen readers:

 {/* Username */}
 <div className="relative">
+  <label htmlFor="username" className="sr-only">Username</label>
   <div className="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
     <User className="h-5 w-5 text-purple-500 dark:text-purple-300" />
   </div>
   <input
+    id="username"
     type="text"
     name="username"

Apply the same pattern to email and password fields.

Also applies to: 108-127, 129-148

🤖 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 87 - 106, Add accessible labels for
the inputs that currently only use placeholders: add a visually-hidden <label>
(use the project's Tailwind "sr-only" utility) for the username, email, and
password inputs so screen readers announce the field purpose; ensure each
label's htmlFor matches the input's name/id (e.g., the username input that binds
to formData.username and handleChange), or alternatively add descriptive
aria-label attributes if you prefer not to add label elements, and keep required
and existing classes intact.
🧹 Nitpick comments (2)
src/pages/Signup/Signup.tsx (2)

42-44: ⚡ Quick win

Generic error message hides useful server feedback.

The catch block shows "Something went wrong. Please try again." for all errors. Axios errors often include server-provided messages (e.g., "Email already exists", "Password too weak") in error.response?.data?.message. Extracting and displaying these would improve UX.

♻️ Proposed fix to surface server error messages
     } catch (error) {
-      setMessage("Something went wrong. Please try again.");
+      if (axios.isAxiosError(error) && error.response?.data?.message) {
+        setMessage(error.response.data.message);
+      } else {
+        setMessage("Something went wrong. Please try again.");
+      }
     }
🤖 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 42 - 44, The catch block in the
Signup component currently sets a generic message via setMessage("Something went
wrong. Please try again."); update the catch to detect Axios/server errors and
extract a meaningful message (e.g. error.response?.data?.message or
error.response?.data?.error) and pass that to setMessage, falling back to
error.message and then the current generic text; ensure you reference the same
catch block and setMessage call in Signup.tsx so the UI surfaces server-provided
feedback like "Email already exists" or "Password too weak".

99-104: ⚡ Quick win

Consider adding dark mode variant for focus ring.

The input focus ring uses focus:ring-purple-400 without a dark mode variant. While this may be visible in dark mode, consider testing the contrast and potentially using a lighter shade (e.g., dark:focus:ring-purple-300) to ensure the focus indicator is clearly visible for keyboard navigation in dark mode.

♻️ Proposed enhancement
-                  focus:outline-none focus:ring-2 focus:ring-purple-400 transition"
+                  focus:outline-none focus:ring-2 focus:ring-purple-400 dark:focus:ring-purple-300 transition"

Also applies to: 120-125, 141-146

🤖 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 99 - 104, The focus ring class on
the Signup input elements (the className string in the Signup component for the
input elements) only uses focus:ring-purple-400 and should include a dark-mode
variant for better contrast; update each input's className (the same string
around lines where the inputs are defined) to add dark:focus:ring-purple-300 (or
an appropriate lighter shade) alongside focus:ring-purple-400 so the focus
indicator is clearly visible in dark mode.
🤖 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 39-41: Replace the brittle string check in the signup response
handling with a status or explicit success flag: inside the handler where you
currently have if (response.data.message === "User created successfully")
navigate("/login"); (in Signup.tsx), instead check response.status === 201 or
response.data.success === true before calling navigate("/login"); and keep a
sensible fallback/error branch that shows the backend message if present. Ensure
you update any tests or callers that relied on the exact message.
- Line 6: The code reads import.meta.env.VITE_BACKEND_URL into backendUrl
without guarding for undefined; update Signup.tsx to validate backendUrl (the
constant backendUrl) at module init or before use (e.g., in the signup request
path) and if missing either throw a clear error (e.g., "VITE_BACKEND_URL is not
set") or supply a safe dev fallback URL, then use the validated value for
building the axios request URL so you fail fast with a descriptive message
instead of making requests to undefined.

---

Outside diff comments:
In `@src/pages/Signup/Signup.tsx`:
- Around line 87-106: Add accessible labels for the inputs that currently only
use placeholders: add a visually-hidden <label> (use the project's Tailwind
"sr-only" utility) for the username, email, and password inputs so screen
readers announce the field purpose; ensure each label's htmlFor matches the
input's name/id (e.g., the username input that binds to formData.username and
handleChange), or alternatively add descriptive aria-label attributes if you
prefer not to add label elements, and keep required and existing classes intact.

---

Nitpick comments:
In `@src/pages/Signup/Signup.tsx`:
- Around line 42-44: The catch block in the Signup component currently sets a
generic message via setMessage("Something went wrong. Please try again.");
update the catch to detect Axios/server errors and extract a meaningful message
(e.g. error.response?.data?.message or error.response?.data?.error) and pass
that to setMessage, falling back to error.message and then the current generic
text; ensure you reference the same catch block and setMessage call in
Signup.tsx so the UI surfaces server-provided feedback like "Email already
exists" or "Password too weak".
- Around line 99-104: The focus ring class on the Signup input elements (the
className string in the Signup component for the input elements) only uses
focus:ring-purple-400 and should include a dark-mode variant for better
contrast; update each input's className (the same string around lines where the
inputs are defined) to add dark:focus:ring-purple-300 (or an appropriate lighter
shade) alongside focus:ring-purple-400 so the focus indicator is clearly visible
in dark mode.
🪄 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: ee25a82b-a350-44a2-91ff-03243cdd51e8

📥 Commits

Reviewing files that changed from the base of the PR and between 56e17a3 and dc2219d.

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

Comment thread src/pages/Signup/Signup.tsx
Comment thread src/pages/Signup/Signup.tsx
@TheBinaryAVA TheBinaryAVA changed the title fix: enable dark mode support on signup page fix: enable dark mode support on signup page#228 May 15, 2026
@TheBinaryAVA TheBinaryAVA changed the title fix: enable dark mode support on signup page#228 fix: enable dark mode support on signup page May 15, 2026
@TheBinaryAVA TheBinaryAVA changed the title fix: enable dark mode support on signup page fix: Signup page toggle does not switch modes on click #228 May 15, 2026
@TheBinaryAVA TheBinaryAVA changed the title fix: Signup page toggle does not switch modes on click #228 fix: signup toggle not switching modes May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Signup page toggle does not switch modes on click

1 participant