Skip to content

Conversation

@PranjaliBhardwaj
Copy link

@PranjaliBhardwaj PranjaliBhardwaj commented Dec 3, 2025

Closes #213

🔧 Changes Made

after a successful supabase.auth.signUp, the Signup page now shows a green info box saying:
“Verification link sent. Please check your email to verify your account before signing in.”

if Supabase returns an error indicating the email is already registered / user exists, the page now shows:
“An account with this email already exists. Please sign in instead.”

📷 Screenshots or Visual Changes (if applicable)

Screenshot 2025-12-03 163031 Screenshot 2025-12-03 161106

✅ Checklist

  • [ ✅] I have read the contributing guidelines.
  • [ ✅] I have added tests that prove my fix is effective or that my feature works.
  • [ ✅] I have added necessary documentation (if applicable).
  • [ ✅] Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • New Features

    • Multi-thumb slider component enabling advanced range selection.
    • Email verification success message guiding users to check their inbox for verification link.
  • Bug Fixes

    • Improved duplicate email detection with clearer, user-friendly error messaging.
    • Enhanced signup error handling and feedback flow.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Pranjali Bhardwaj <pranjalisharma6543@gmail.com>
Signed-off-by: Pranjali Bhardwaj <pranjalisharma6543@gmail.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

Walkthrough

Backend database utilities show no functional changes. The frontend slider component now supports multi-thumb rendering based on array values. Signup page implements improved user feedback with messages for existing accounts and verification instructions for new registrations.

Changes

Cohort / File(s) Summary
Backend database utilities
Backend/app/db/db.py
No observable functional changes to the database session generator.
Frontend UI slider component
Frontend/src/components/ui/slider.tsx
Replaced single-thumb rendering with dynamic multi-thumb support. Component now calculates thumbCount from array values and renders multiple SliderPrimitive.Thumb elements. Shadow styling added to thumbs.
Frontend signup page improvements
Frontend/src/pages/Signup.tsx
Added successMessage state and enhanced error handling post-signup. Detects existing users via error strings ("already registered", "user already exists") or empty identities array. Displays targeted feedback: "email already exists" for existing users, success message with verification instructions for new accounts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Frontend/src/pages/Signup.tsx: Requires careful review of multi-branch error-handling logic, particularly the conditions for detecting existing vs. new users (identities array inspection) and the corresponding user-facing messages.
  • Frontend/src/components/ui/slider.tsx: Review the thumbCount calculation logic and array rendering to ensure correct multi-thumb behavior with various input formats (arrays vs. single values).

Poem

🐰 A slider with many a thumb now glides with grace,
While signup gives feedback—a welcoming place!
From "email exists" to "check your mail, friend,"
The user knows now, from beginning to end! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The slider component changes in Frontend/src/components/ui/slider.tsx appear unrelated to the SignUp/SignIn messaging requirements from issue #213. Review whether the slider changes are necessary for this PR or should be separated into a different pull request to maintain scope focus.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: displaying correct messages on SignUp/SignIn pages to improve user feedback.
Linked Issues check ✅ Passed The pull request successfully implements the core objectives from issue #213: displaying 'already registered' error and 'verification link sent' success messages to improve SignUp/SignIn clarity.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • 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

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

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: 1

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

52-77: Good handling of Supabase's existing-user quirk, but type safety could be improved.

The logic correctly handles both the explicit error case and the identities-empty quirk. However, as any bypasses type safety. Supabase's User type already includes identities?: UserIdentity[].

-      const identities = (data.user as any)?.identities ?? [];
+      const identities = data.user?.identities ?? [];

Also note that relying on error.message.toLowerCase().includes(...) is fragile if Supabase changes their error messages. Consider adding a comment documenting this dependency for future maintainers.

Frontend/src/components/ui/slider.tsx (2)

8-12: Multi-thumb calculation logic is correct.

The calculation correctly determines thumb count from array values. Minor simplification possible:

-  const thumbCount =
-    Array.isArray(props.value ?? props.defaultValue)
-      ? (props.value ?? props.defaultValue ?? []).length || 1
-      : 1
+  const valueArray = props.value ?? props.defaultValue;
+  const thumbCount = Array.isArray(valueArray) ? valueArray.length || 1 : 1;

31-31: Consider adding displayName for better DevTools debugging.

ForwardRef components commonly set displayName for React DevTools clarity.

 })
+Slider.displayName = SliderPrimitive.Root.displayName
 
 export { Slider };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3be437 and 9076352.

📒 Files selected for processing (3)
  • Backend/app/db/db.py (1 hunks)
  • Frontend/src/components/ui/slider.tsx (1 hunks)
  • Frontend/src/pages/Signup.tsx (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Saahi30
Repo: AOSSIE-Org/InPactAI PR: 98
File: Frontend/src/pages/CollaborationDetails.tsx:519-521
Timestamp: 2025-07-12T20:28:05.017Z
Learning: In frontend-only commits that use mock data, hardcoded progress values and similar placeholder data are acceptable and intentional. These values serve as placeholders for UI development and will be replaced with dynamic calculations once backend integration occurs.
🧬 Code graph analysis (2)
Frontend/src/pages/Signup.tsx (1)
Frontend/src/utils/supabase.tsx (1)
  • supabase (11-11)
Frontend/src/components/ui/slider.tsx (1)
Frontend/src/lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (5)
Backend/app/db/db.py (1)

38-40: No functional changes detected.

This appears to be a whitespace or formatting-only change. The get_db() async generator implementation is correct and follows standard SQLAlchemy async session management patterns.

Note: This file seems unrelated to the PR's objective of improving SignUp/SignIn messages. If this change was unintentional, consider excluding it from the PR to keep the changeset focused.

Frontend/src/pages/Signup.tsx (2)

20-20: LGTM!

Adding the successMessage state to provide user feedback after successful signup attempts is a clean approach.


170-175: Nice success message UI with appropriate visual styling.

The green info box with the checkmark icon provides clear visual feedback. The styling is consistent with the error message block above, and the flex-shrink-0 on the icon prevents layout issues with longer messages.

Frontend/src/components/ui/slider.tsx (2)

23-28: LGTM on multi-thumb rendering.

Using Array.from with index-based keys is appropriate here since thumb order corresponds to stable array positions.


5-31: Verify: Is this slider change intentionally part of this PR?

This PR's objectives focus on SignUp/SignIn messaging improvements. The slider multi-thumb support appears unrelated. Please confirm this change was intentionally included, or if it should be a separate PR.

}
setIsLoading(true);
setError("");
setSuccessMessage("");
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor indentation inconsistency.

There's an extra leading space before setSuccessMessage("").

-     setSuccessMessage("");
+    setSuccessMessage("");
📝 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
setSuccessMessage("");
setSuccessMessage("");
🤖 Prompt for AI Agents
In Frontend/src/pages/Signup.tsx around line 43, there's an indentation
inconsistency: the line "setSuccessMessage(\"\");" has an extra leading space.
Remove the extra leading space so the call aligns with the surrounding code's
indentation (match the same indent level as adjacent statements) to keep
formatting consistent.

@PranjaliBhardwaj
Copy link
Author

When I committed these changes into this PR, Slider changes were pushed too, but now I have removes all the changes of previous pr, now it is only about this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Making SignUp/SignIn easier for new contributors/users.

1 participant