Skip to content

fix: Display requested friend's name in pending partner requests#40

Merged
JustinhSE merged 2 commits intomainfrom
copilot/fix-friend-request-display
Feb 25, 2026
Merged

fix: Display requested friend's name in pending partner requests#40
JustinhSE merged 2 commits intomainfrom
copilot/fix-friend-request-display

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

friendRequests.outgoing was stored as string[] (IDs only), so the "Pending Requests" UI had no reliable way to resolve names — it fell back to looking up IDs in allUsernames, which explicitly filtered out users with pending requests.

Changes

src/utils/auth.tsx

  • Changed friendRequests.outgoing type from string[]UserProfile[]
  • Fetch full UserProfile for each outgoing request ID at auth load time, mirroring the existing pattern for incoming requests:
const outgoingRequests: UserProfile[] = [];
if (profile.friendRequests?.outgoing?.length) {
  for (const recipientId of profile.friendRequests.outgoing) {
    const recipientProfile = await getUserProfile(recipientId);
    if (recipientProfile) outgoingRequests.push(recipientProfile);
  }
}
setFriendRequests({ incoming: incomingRequests, outgoing: outgoingRequests });

src/components/FriendsList.tsx

  • Updated allUsernames filter: .includes(user.id).some(u => u.id === user.id) to account for the new object shape
  • Rewrote the "Pending Requests" render to iterate UserProfile objects directly — removes the fragile allUsernames lookup fallback that was producing "User" as the display name
Original prompt

This section details on the original issue you should resolve

<issue_title>fix: Display Requested Friend's Name When Sending Partner Request</issue_title>
<issue_description>## Overview

Currently, when a user sends a friend request to add someone as a partner, the system does not display the name of the friend who was requested. This can cause confusion for users, as they may not be certain which friend the request was sent to. Improving this feature will enhance user experience and clarity within the application.

To-Do

  • Investigate the current implementation of the friend request feature.
  • Identify where the friend's name should be displayed after sending a request.
  • Update the UI to show the name of the requested friend as a partner.
  • Test the feature to ensure the correct name appears in all relevant views.
  • Review for accessibility and usability.
  • Update documentation and screenshots if necessary.
    </issue_description>

<agent_instructions>In the pr map out the workflow of someone requesting being an accountability partner from the receiving and sending aspect. When accepted, the user's should be able to see each other's "calendars" of progress that is already in their personal data</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

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.

Almost at your first merged PR here! Super exciting 🥳🥳🥳

Co-authored-by: JustinhSE <84724234+JustinhSE@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix display of requested friend's name when sending partner request fix: Display requested friend's name in pending partner requests Feb 25, 2026
@JustinhSE JustinhSE requested a review from Copilot February 25, 2026 20:10
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 fixes the display of requested friend names in the "Pending Requests" section by changing how outgoing friend requests are stored in the application state. Previously, only user IDs were stored, making it impossible to reliably display user names without fragile lookups.

Changes:

  • Modified friendRequests.outgoing from storing user IDs (string[]) to full user profiles (UserProfile[])
  • Updated auth loading logic to fetch complete profile data for each outgoing friend request
  • Simplified the "Pending Requests" UI to directly access user properties from the profile objects

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/utils/auth.tsx Changed friendRequests.outgoing type from string[] to UserProfile[] and added logic to fetch full profiles at auth load time
src/components/FriendsList.tsx Updated filter logic to work with UserProfile[] objects and simplified the "Pending Requests" rendering to use profile data directly

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

@JustinhSE JustinhSE marked this pull request as ready for review February 25, 2026 20:45
@JustinhSE JustinhSE self-requested a review February 25, 2026 20:45
@JustinhSE JustinhSE merged commit 22d96b8 into main Feb 25, 2026
6 of 7 checks passed
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.

fix: Display Requested Friend's Name When Sending Partner Request

3 participants