Rebuild friends and friending in Laravel #55

Closed
opened 2024-01-14 14:50:11 -06:00 by jimmyb · 1 comment
Owner

The Friends feature needs to be rebuilt in Laravel so authenticated users can add and remove friends, view the people they added, and view users who added them.

The current app has profile stat placeholders for “Friends” and “Friends Of,” plus notification settings for friend_added_you, but there are no friend routes, models, controllers, or list pages yet. This issue tracks building the full friending workflow and wiring it into user profiles.

Scope

  • Authenticated add-friend and remove-friend actions.
  • Public or authenticated friend list pages for users’ “Friends” and “Friends Of” lists.
  • Profile action buttons/links that change based on viewer state.
  • Profile stats for Friends and Friends Of counts.
  • Notification integration for “friend added you.”
  • Authorization, duplicate prevention, self-friend prevention, deleted-user filtering, and empty states.

Acceptance Criteria

  • Authenticated users can add another active user as a friend.
  • Authenticated users can remove a previously added friend.
  • Guests cannot add/remove friends and are prompted to log in.
  • Users cannot add themselves as a friend.
  • Users cannot create duplicate active friend records for the same target user.
  • Re-adding a previously removed friend restores or recreates the friendship cleanly.
  • User profiles show the correct Add Friend, Remove Friend, or no-op/self state based on the current viewer.
  • Profile stats show accurate Friends and Friends Of counts.
  • Friends list pages show users the profile owner has added.
  • Friends Of list pages show users who have added the profile owner.
  • Banned, deleted, soft-deleted, or missing users do not expose public friend pages or counts.
  • Friend lists exclude banned, deleted, or soft-deleted related users.
  • Adding a friend respects or prepares the existing friend_added_you notification setting.
  • User-facing UI supports light/dark mode and follows the existing Laravel/Tailwind site layout patterns.

Test Coverage Required

  • Feature tests for add friend, remove friend, duplicate prevention, self-friend prevention, guest restrictions, and re-adding behavior.
  • Feature tests for Friends and Friends Of list rendering, empty states, missing users, banned/deleted users, and filtered related users.
  • Regression tests for profile action button/link state and Friends/Friends Of counts.
  • Tests for notification behavior or explicit notification-stub coverage for friend_added_you.
  • Tests should use Pest and focused feature coverage.
  • Run the focused affected tests, then run vendor/bin/pint --dirty before closing the issue.

Progress Checklist

  • Profile stats reserve Friends and Friends Of rows
  • Notification settings include friend_added_you
  • Add friend persistence table/model
  • Add routes and controller/actions for adding and removing friends
  • Build Friends list page
  • Build Friends Of list page
  • Add profile Add Friend/Remove Friend UI state
  • Wire Friends and Friends Of counts into profiles
  • Integrate or stub friend-added notification behavior
  • Handle guests, self-friending, duplicates, deleted users, and empty states
  • Add tests for friend actions, list rendering, counts, profile UI, notifications, and authorization
  • Confirm the friends feature matches expected data coverage
The Friends feature needs to be rebuilt in Laravel so authenticated users can add and remove friends, view the people they added, and view users who added them. The current app has profile stat placeholders for “Friends” and “Friends Of,” plus notification settings for `friend_added_you`, but there are no friend routes, models, controllers, or list pages yet. This issue tracks building the full friending workflow and wiring it into user profiles. ## Scope - Authenticated add-friend and remove-friend actions. - Public or authenticated friend list pages for users’ “Friends” and “Friends Of” lists. - Profile action buttons/links that change based on viewer state. - Profile stats for Friends and Friends Of counts. - Notification integration for “friend added you.” - Authorization, duplicate prevention, self-friend prevention, deleted-user filtering, and empty states. ## Acceptance Criteria - Authenticated users can add another active user as a friend. - Authenticated users can remove a previously added friend. - Guests cannot add/remove friends and are prompted to log in. - Users cannot add themselves as a friend. - Users cannot create duplicate active friend records for the same target user. - Re-adding a previously removed friend restores or recreates the friendship cleanly. - User profiles show the correct Add Friend, Remove Friend, or no-op/self state based on the current viewer. - Profile stats show accurate Friends and Friends Of counts. - Friends list pages show users the profile owner has added. - Friends Of list pages show users who have added the profile owner. - Banned, deleted, soft-deleted, or missing users do not expose public friend pages or counts. - Friend lists exclude banned, deleted, or soft-deleted related users. - Adding a friend respects or prepares the existing `friend_added_you` notification setting. - User-facing UI supports light/dark mode and follows the existing Laravel/Tailwind site layout patterns. ## Test Coverage Required - Feature tests for add friend, remove friend, duplicate prevention, self-friend prevention, guest restrictions, and re-adding behavior. - Feature tests for Friends and Friends Of list rendering, empty states, missing users, banned/deleted users, and filtered related users. - Regression tests for profile action button/link state and Friends/Friends Of counts. - Tests for notification behavior or explicit notification-stub coverage for `friend_added_you`. - Tests should use Pest and focused feature coverage. - Run the focused affected tests, then run `vendor/bin/pint --dirty` before closing the issue. ## Progress Checklist - [x] Profile stats reserve Friends and Friends Of rows - [x] Notification settings include `friend_added_you` - [x] Add friend persistence table/model - [x] Add routes and controller/actions for adding and removing friends - [x] Build Friends list page - [x] Build Friends Of list page - [x] Add profile Add Friend/Remove Friend UI state - [x] Wire Friends and Friends Of counts into profiles - [x] Integrate or stub friend-added notification behavior - [x] Handle guests, self-friending, duplicates, deleted users, and empty states - [x] Add tests for friend actions, list rendering, counts, profile UI, notifications, and authorization - [x] Confirm the friends feature matches expected data coverage
Codex changed title from Rebuild Friends Component in Laravel to Rebuild friends and friending in Laravel 2026-05-25 21:57:57 -05:00
jimmyb self-assigned this 2026-06-01 18:09:28 -05:00
Author
Owner

Work completed!

Work completed!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#55
No description provided.