Skip to content

Conversation

@marvin-chen
Copy link

Popup modal for users when they click on join ride that has text boxes for phone number and optional comments. Also informs the user that an email has been sent to original ride creator.

Copilot AI review requested due to automatic review settings December 2, 2025 03:40
@linear
Copy link

linear bot commented Dec 2, 2025

@marvin-chen marvin-chen changed the title Tig 134 join request pop up TIG-134-Join_Request_Popup Dec 2, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a join request modal popup that collects user phone number and optional comments before sending a ride join request. The modal notifies users that an email will be sent to the ride creator with their information.

Key Changes

  • Added a modal dialog for ride join requests with phone number and comment fields
  • Modified the join button to open the modal instead of directly submitting the request
  • Updated backend dependencies to use psycopg2-binary instead of psycopg2

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
frontend/src/pages/AllRides.jsx Added join request modal with phone number and comment inputs; updated handleRideRequest to accept and pass these new parameters
backend/requirements.txt Changed psycopg2 to psycopg2-binary for better compatibility
backend/app.py Added trailing whitespace to final line
.gitignore Expanded ignore patterns for Python virtual environments and Node modules
Comments suppressed due to low confidence (1)

frontend/src/pages/AllRides.jsx:354

  • The success message is shown and modal is closed before checking if the response is ok. Lines 339-349 should be moved inside a conditional block that executes only when response.ok is true, otherwise users will see a success message even when the request fails.
      handleShowPopupMessage(
        setPopupMessageInfo,
        true,
        "Request sent! An email has been sent to the ride creator."
      );

      // Close modal and reset fields
      setShowJoinModal(false);
      setPhoneNumber("");
      setJoinComments("");
      setSelectedRide(null);

      await fetchDashboardData(); // refresh dashboardData after requesting ride
      if (!response.ok) {
        console.error("Request failed:", response.status);
      }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +766 to +772
<input
type="tel"
value={phoneNumber}
onChange={(e) => setPhoneNumber(e.target.value)}
placeholder="Enter your phone number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-theme_medium_1"
/>
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

The phone number input lacks validation. Users can submit the form without entering a phone number or with an invalid format. Consider adding required validation and pattern matching for phone number format before allowing the request to be sent.

Copilot uses AI. Check for mistakes.
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.

2 participants