Skip to content

Conversation

@Riyam111
Copy link

@Riyam111 Riyam111 commented Aug 16, 2025

Changes

  • Matched Signup page colors with Login page for consistent design.
  • Fixed logo visibility issue on Signup page.
  • Added "Already have an account? Sign in here" link for better navigation.

Why

  • Ensures branding consistency across auth pages.
  • Improves user experience with a visible logo.
  • Provides a clear path for registered users to go to the Signin page.

Related Issue

Summary by CodeRabbit

  • New Features

    • Theme-aware signup page with light/dark mode.
    • Loading state on submit: disabled button and “Creating...” feedback.
    • Clear success and error status messages.
  • Improvements

    • Streamlined, card-style layout with refined branding and login link.
    • Enhanced inputs for username, email, and password with clearer focus and placeholders.
    • Polished visuals: dynamic gradients and subtle animations.
    • More reliable submission flow and error handling with user-friendly feedback.
    • Automatic navigation to the login page after successful signup.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 16, 2025

Walkthrough

Refactors Signup page to integrate ThemeContext-driven theming, reworks the UI layout and inputs, adds loading/error/success messaging, and updates form submission to post to the backend and navigate to /login on success. The login link is present. No exported/public signatures changed.

Changes

Cohort / File(s) Summary
Signup page theming and flow
src/pages/Signup/Signup.tsx
Added ThemeContext usage for light/dark UI; revamped page layout/gradients; consolidated form (username, email, password); introduced loading state and disabled submit; enhanced error/success messaging; updated submit handler to POST to ${backendUrl}/api/auth/signup with axios and navigate to /login on success.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant S as SignupPage
  participant T as ThemeContext
  participant B as Backend API
  participant R as Router

  U->>S: Open /signup
  S->>T: Read mode/theme
  T-->>S: Theme values
  U->>S: Submit form
  S->>S: Set isLoading=true
  S->>B: POST /api/auth/signup (formData)
  alt Success
    B-->>S: { message, success:true }
    S->>S: Show success message
    S->>R: navigate("/login")
  else Error
    B-->>S: { message, success:false } / error
    S->>S: Show error message
  end
  S->>S: Set isLoading=false
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
Proper logo display on scroll (#192) No header/logo positioning or scroll-related changes observed in Signup.tsx.
Consistent theme/gradient with login page (#192)
Add "Already have an account? Login" link (#192)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Added loading state and disabled submit button during API call (src/pages/Signup/Signup.tsx) Not requested by #192; focuses on UX polish beyond specified UI issues.
Enhanced error/success messaging logic and styling (src/pages/Signup/Signup.tsx) Not part of #192 objectives; extends feedback behavior beyond color/consistency and login link.
Refactored submission to axios.post with backend navigation on success (src/pages/Signup/Signup.tsx) #192 did not request submission flow changes or navigation logic adjustments.

Possibly related PRs

Suggested labels

gssoc25, level1

Poem

In twilight hues I hop and type,
A signup page now dressed just right.
Buttons wait, then swiftly spring—
“Creating…” hums, a gentle thing.
Dark or light, I match the scene,
And nudge you softly: “Login, keen?”
— your rabbit dev, with whiskers clean.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@netlify
Copy link

netlify bot commented Aug 16, 2025

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 60c5568
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/68a01dbb13498500080bc5d5
😎 Deploy Preview https://deploy-preview-193--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.

Copy link

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

Copy link
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 (5)
src/pages/Signup/Signup.tsx (5)

33-49: Make submit flow more robust: clear stale messages, build URL safely, rely on HTTP status, and type the error.

  • Clear message at submit start.
  • Build the endpoint with a fallback to relative path when backendUrl is empty.
  • Don't rely on exact server message text; use HTTP status for navigation.
  • Type the error to extract Axios response safely.

Apply this diff:

   const handleSubmit = async (e: FormEvent) => {
     e.preventDefault();
-    setIsLoading(true);
+    setIsLoading(true);
+    setMessage("");

     try {
-      const response = await axios.post(`${backendUrl}/api/auth/signup`, formData);
-      setMessage(response.data.message);
-
-      if (response.data.message === "User created successfully") {
-        navigate("/login");
-      }
-    } catch (error: any) {
-      setMessage(error.response?.data?.message || "Something went wrong");
+      const url = (backendUrl ? `${backendUrl}` : "") + "/api/auth/signup";
+      const response = await axios.post(url, formData);
+      const msg = response.data?.message ?? "Account created";
+      setMessage(msg);
+      if (response.status >= 200 && response.status < 300) {
+        navigate("/login");
+      }
+    } catch (err) {
+      const error = err as import("axios").AxiosError<{ message?: string }>;
+      setMessage(error.response?.data?.message ?? "Something went wrong");
     } finally {
       setIsLoading(false);
     }
   };

60-81: Respect reduced motion and avoid intercepting pointer events on decorative elements.

Decorative animated blobs should not trap pointer events and should respect users who prefer reduced motion.

Apply this diff:

-      <div className="absolute inset-0">
+      <div className="absolute inset-0 pointer-events-none" aria-hidden="true">
@@
-          } rounded-full blur-3xl opacity-30 animate-pulse`}
+          } rounded-full blur-3xl opacity-30 motion-safe:animate-pulse motion-reduce:animate-none`}
@@
-          } rounded-full blur-3xl opacity-30 animate-pulse`}
+          } rounded-full blur-3xl opacity-30 motion-safe:animate-pulse motion-reduce:animate-none`}
@@
-          } rounded-full blur-3xl opacity-30 animate-pulse`}
+          } rounded-full blur-3xl opacity-30 motion-safe:animate-pulse motion-reduce:animate-none`}
@@
-          } rounded-full blur-2xl opacity-20 animate-pulse delay-1000`}
+          } rounded-full blur-2xl opacity-20 motion-safe:animate-pulse motion-reduce:animate-none delay-1000`}

124-137: Add accessibility and autofill hints to inputs.

Improve a11y and UX with proper autocomplete hints, labels (or aria-labels), and sensible constraints.

Apply these diffs:

-            <input
+            <input
               type="text"
               name="username"
               placeholder="Enter your username"
               value={formData.username}
               onChange={handleChange}
               required
+              autoComplete="username"
+              aria-label="Username"
+              autoCapitalize="none"
+              autoCorrect="off"
+              spellCheck={false}
               className={`w-full pl-4 pr-4 py-4 rounded-2xl focus:outline-none transition-all ${
-            <input
+            <input
               type="email"
               name="email"
               placeholder="Enter your email"
               value={formData.email}
               onChange={handleChange}
               required
+              autoComplete="email"
+              aria-label="Email address"
+              autoCapitalize="none"
+              autoCorrect="off"
+              spellCheck={false}
               className={`w-full pl-4 pr-4 py-4 rounded-2xl focus:outline-none transition-all ${
-            <input
+            <input
               type="password"
               name="password"
               placeholder="Enter your password"
               value={formData.password}
               onChange={handleChange}
               required
+              autoComplete="new-password"
+              aria-label="Password"
+              minLength={8}
               className={`w-full pl-4 pr-4 py-4 rounded-2xl focus:outline-none transition-all ${

Optional (further improvement): add visible elements for best a11y rather than relying solely on placeholders/aria-labels.

Also applies to: 139-151, 153-165


176-176: Make status messaging accessible and less brittle.

  • Use aria-live and role="status" so screen readers announce feedback.
  • Prefer case-insensitive "success" substring over exact "successfully" to reduce brittleness.

Apply this diff:

-          {message && (
-            <div
-              className={`mt-6 p-4 rounded-2xl text-center text-sm font-medium ${
-                message.includes("successfully")
+          {message && (
+            <div
+              role="status"
+              aria-live="polite"
+              className={`mt-6 p-4 rounded-2xl text-center text-sm font-medium ${
+                message.toLowerCase().includes("success")
                   ? "bg-green-500/20 text-green-300 border border-green-500/30"
                   : "bg-red-500/20 text-red-300 border border-red-500/30"
               }`}
             >

Also applies to: 178-184


208-213: Prevent the bottom gradient overlay from capturing pointer events.

Mark the overlay as decorative to avoid any chance it intercepts clicks near the page bottom.

Apply this diff:

-      <div
+      <div
         className={`${
           mode === "dark" ? "from-slate-900" : "from-slate-100"
-        } absolute bottom-0 left-0 w-full h-20 bg-gradient-to-t to-transparent`}
+        } absolute bottom-0 left-0 w-full h-20 bg-gradient-to-t to-transparent pointer-events-none`}
       />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 00a00d6 and 60c5568.

📒 Files selected for processing (1)
  • src/pages/Signup/Signup.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/pages/Signup/Signup.tsx (2)
src/context/ThemeContext.tsx (3)
  • ThemeContext (10-10)
  • ThemeContextType (49-49)
  • ThemeContextType (5-8)
src/pages/Login/Login.tsx (2)
  • e (28-44)
  • e (23-26)
🔇 Additional comments (3)
src/pages/Signup/Signup.tsx (3)

52-58: Design consistency LGTM.

The theme-aware gradient background aligns with the Login page and the PR objective for branding consistency.


189-204: Sign-in link UX LGTM.

Clear navigation for returning users (“Already have an account? Sign in here”) meets the issue requirement. Styling is consistent with the Login page.


86-88: Asset path validated & alt text improved

The logo file exists at public/crl-icon.png, so the absolute path is correct. Updated the alt attribute to “GitHubTracker logo” for better accessibility.

-            <img src="/crl-icon.png" alt="Logo" className="w-14 h-14 object-contain" />
+            <img src="/crl-icon.png" alt="GitHubTracker logo" className="w-14 h-14 object-contain" />

Comment on lines +4 to +6
import { ThemeContext } from "../../context/ThemeContext";
import type { ThemeContextType } from "../../context/ThemeContext";

Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Avoid unsafe ThemeContext cast; provide a safe fallback for mode.

ThemeContext is created with a nullable default (see src/context/ThemeContext.tsx). Casting and destructuring without a guard risks runtime crashes if the Provider is ever omitted. Use a nullable context and a sane fallback.

Apply this diff:

-  const themeContext = useContext(ThemeContext) as ThemeContextType;
-  const { mode } = themeContext;
+  const themeContext = useContext(ThemeContext);
+  const mode = themeContext?.mode ?? "light";

If you adopt the above, you can remove the now-unused type-only import:

-import type { ThemeContextType } from "../../context/ThemeContext";

Run this quick check to confirm the app wraps routes with a Theme Provider:

Also applies to: 25-26


🏁 Script executed:

#!/bin/bash
# Verify ThemeContext provider usage exists somewhere in the app.
rg -n -C2 -g '!**/node_modules/**' -P '(ThemeProvider|<ThemeContext\.Provider\b|ThemeContext\.Provider\b)'

Length of output: 950


🏁 Script executed:

#!/bin/bash
# Print the beginning of ThemeContext file to inspect Provider component wrapper
sed -n '1,100p' src/context/ThemeContext.tsx

Length of output: 1416


🏁 Script executed:

#!/bin/bash
# Check for ThemeWrapper usage in the app entry points or components
rg -n -C2 -g '!**/node_modules/**' 'ThemeWrapper'

Length of output: 1678


Handle nullable ThemeContext safely; remove unsafe cast and redundant import

Verified that ThemeWrapper wraps the entire app (in both App.tsx and main.tsx), so useContext(ThemeContext) should never be null at runtime—but it’s still best practice to guard against a missing provider and eliminate the unnecessary cast.

• In src/pages/Signup/Signup.tsx, replace:

-  const themeContext = useContext(ThemeContext) as ThemeContextType;
-  const { mode } = themeContext;
+  const themeContext = useContext(ThemeContext);
+  const mode = themeContext?.mode ?? "light";

• Remove the now-unused type-only import:

- import type { ThemeContextType } from "../../context/ThemeContext";

Also apply the same change on lines 25–26 if this pattern repeats.

📝 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
import { ThemeContext } from "../../context/ThemeContext";
import type { ThemeContextType } from "../../context/ThemeContext";
// src/pages/Signup/Signup.tsx
import { ThemeContext } from "../../context/ThemeContext";
function Signup() {
// …
const themeContext = useContext(ThemeContext);
const mode = themeContext?.mode ?? "light";
// …
}
🤖 Prompt for AI Agents
In src/pages/Signup/Signup.tsx around lines 4 to 6 (and similarly on lines 25–26
if repeated), the code currently imports ThemeContext and also imports
ThemeContextType then uses an unsafe non-null cast; remove the redundant
type-only import (ThemeContextType) and replace the non-null cast by calling
useContext(ThemeContext) and defensively handling a possible null (e.g., check
the returned value and either throw a clear error, return a fallback theme, or
guard rendering until the context is available) so the component no longer
relies on a non-null assertion.

import { ThemeContext } from "../../context/ThemeContext";
import type { ThemeContextType } from "../../context/ThemeContext";

const backendUrl = import.meta.env.VITE_BACKEND_URL;
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Provide a safe fallback when VITE_BACKEND_URL is not set.

Without a fallback, the code may post to the literal string "undefined/api/auth/signup". Default to empty string so relative URLs still work (useful in dev or same-origin deployments).

Apply this diff:

-const backendUrl = import.meta.env.VITE_BACKEND_URL;
+const backendUrl = import.meta.env.VITE_BACKEND_URL || "";

Optional: verify the env var is defined in your repo:


🏁 Script executed:

#!/bin/bash
rg -n 'VITE_BACKEND_URL'

Length of output: 247


Add a safe fallback for VITE_BACKEND_URL

To prevent the app from posting to "undefined/api/auth/signup" (or login), default the backend URL to an empty string when the env var isn’t set.

• Update in src/pages/Signup/Signup.tsx
• Also update in src/pages/Login/Login.tsx for consistency

--- a/src/pages/Signup/Signup.tsx
+++ b/src/pages/Signup/Signup.tsx
@@ -7,1 +7,1 @@
-const backendUrl = import.meta.env.VITE_BACKEND_URL;
+const backendUrl = import.meta.env.VITE_BACKEND_URL || "";
--- a/src/pages/Login/Login.tsx
+++ b/src/pages/Login/Login.tsx
@@ -7,1 +7,1 @@
-const backendUrl = import.meta.env.VITE_BACKEND_URL;
+const backendUrl = import.meta.env.VITE_BACKEND_URL || "";
📝 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 backendUrl = import.meta.env.VITE_BACKEND_URL;
const backendUrl = import.meta.env.VITE_BACKEND_URL || "";
🤖 Prompt for AI Agents
In src/pages/Signup/Signup.tsx around line 7, import.meta.env.VITE_BACKEND_URL
may be undefined causing requests to go to "undefined/..."; change the
assignment to provide a safe fallback (e.g. const backendUrl =
import.meta.env.VITE_BACKEND_URL ?? ""; or || "") so the app uses an empty
string when the env var is missing; apply the same change in
src/pages/Login/Login.tsx for consistency.

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.

UI Issues on Signup Page (Scrolling, Color Mismatch, Missing Login Link)

2 participants