Show success feedback after adding a friend #20

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

Adding a friend should show a clear visual confirmation so users know the friend action succeeded.

The original issue described the legacy flow redirecting users to their own profile without any success notification. In the current Laravel checkout, the broader friends feature is still incomplete, but profile stats reserve Friends and Friends Of rows, notification settings include friend_added_you, and related friend visibility/ownership issues track rebuilding the friend actions themselves. This issue focuses on the user-facing success feedback that should be wired into the add-friend flow when friend actions are implemented.

Scope

  • Add Friend action success response.
  • Profile and friend-list surfaces where Add Friend appears.
  • Normal full-page redirect flow.
  • Ajax/JSON flow if friend actions are implemented asynchronously.
  • Existing Laravel/Tailwind session status or alert patterns.
  • Light/dark-mode accessible feedback.

Acceptance Criteria

  • Successfully adding a friend shows a clear success message on the redirected page or updated UI.
  • The message identifies the target user where appropriate, such as “Added username as a friend.”
  • The success state works when adding a friend from a public profile.
  • The success state works when adding a friend from Friends/Friends Of list surfaces where add controls appear.
  • Duplicate or already-friend submissions do not show misleading “added” success feedback.
  • Failed, unauthorized, invalid, banned, deleted, soft-deleted, or self-add attempts show the correct validation/auth response instead of a success message.
  • Guest add-friend attempts still redirect to login and do not show success feedback.
  • Ajax/JSON add-friend requests return a success payload that the frontend can render without a full page reload if that interaction style is used.
  • Feedback is accessible with appropriate status/alert semantics and visually distinct in light and dark mode.
  • Existing profile/comment/status feedback remains unaffected.

Test Coverage Required

  • Feature test confirming a successful add-friend POST redirects with visible success feedback.
  • Feature test confirming the success message includes the target username or clear friend-added copy.
  • Feature tests confirming duplicate, already-friend, self-add, invalid-user, banned-user, deleted-user, and guest attempts do not show success feedback.
  • Regression tests confirming Add Friend controls update or disappear after success where the UI supports that state.
  • Tests for profile and Friends/Friends Of surfaces once those pages exist.
  • JSON/Ajax tests for success and failure payloads if the add-friend action supports JSON requests.
  • 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

  • Public profile page exists
  • Profile stats reserve Friends and Friends Of rows
  • Notification settings include friend_added_you
  • Existing profile comment flow has visible success feedback pattern
  • Add or confirm friend persistence and Add Friend route/action
  • Add success flash/status feedback for full-page Add Friend flow
  • Add JSON success payload for async Add Friend flow if applicable
  • Render friend-added feedback on profile and friend-list surfaces
  • Ensure duplicate/already-friend/self/invalid/guest failures do not show success feedback
  • Add tests for success feedback, failure feedback, redirects, and UI state updates
  • Confirm friend success messaging matches existing Laravel/Tailwind feedback patterns
Adding a friend should show a clear visual confirmation so users know the friend action succeeded. The original issue described the legacy flow redirecting users to their own profile without any success notification. In the current Laravel checkout, the broader friends feature is still incomplete, but profile stats reserve Friends and Friends Of rows, notification settings include `friend_added_you`, and related friend visibility/ownership issues track rebuilding the friend actions themselves. This issue focuses on the user-facing success feedback that should be wired into the add-friend flow when friend actions are implemented. ## Scope - Add Friend action success response. - Profile and friend-list surfaces where Add Friend appears. - Normal full-page redirect flow. - Ajax/JSON flow if friend actions are implemented asynchronously. - Existing Laravel/Tailwind session status or alert patterns. - Light/dark-mode accessible feedback. ## Acceptance Criteria - Successfully adding a friend shows a clear success message on the redirected page or updated UI. - The message identifies the target user where appropriate, such as “Added username as a friend.” - The success state works when adding a friend from a public profile. - The success state works when adding a friend from Friends/Friends Of list surfaces where add controls appear. - Duplicate or already-friend submissions do not show misleading “added” success feedback. - Failed, unauthorized, invalid, banned, deleted, soft-deleted, or self-add attempts show the correct validation/auth response instead of a success message. - Guest add-friend attempts still redirect to login and do not show success feedback. - Ajax/JSON add-friend requests return a success payload that the frontend can render without a full page reload if that interaction style is used. - Feedback is accessible with appropriate status/alert semantics and visually distinct in light and dark mode. - Existing profile/comment/status feedback remains unaffected. ## Test Coverage Required - Feature test confirming a successful add-friend POST redirects with visible success feedback. - Feature test confirming the success message includes the target username or clear friend-added copy. - Feature tests confirming duplicate, already-friend, self-add, invalid-user, banned-user, deleted-user, and guest attempts do not show success feedback. - Regression tests confirming Add Friend controls update or disappear after success where the UI supports that state. - Tests for profile and Friends/Friends Of surfaces once those pages exist. - JSON/Ajax tests for success and failure payloads if the add-friend action supports JSON requests. - 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] Public profile page exists - [x] Profile stats reserve Friends and Friends Of rows - [x] Notification settings include `friend_added_you` - [x] Existing profile comment flow has visible success feedback pattern - [x] Add or confirm friend persistence and Add Friend route/action - [x] Add success flash/status feedback for full-page Add Friend flow - [x] Add JSON success payload for async Add Friend flow if applicable - [x] Render friend-added feedback on profile and friend-list surfaces - [x] Ensure duplicate/already-friend/self/invalid/guest failures do not show success feedback - [x] Add tests for success feedback, failure feedback, redirects, and UI state updates - [x] Confirm friend success messaging matches existing Laravel/Tailwind feedback patterns
Codex changed title from Show a Visual Notification When You Add a New Friend to Show success feedback after adding a friend 2026-05-26 00:42:09 -05:00
jimmyb self-assigned this 2026-06-03 17:27:22 -05:00
Member

Implemented in commit c7ce0e9.

Notes:

  • Full-page friend add/remove/duplicate flows now render friend_status visibly on public profile and friends-list pages with role="status" and aria-live="polite".
  • Ajax friend add/remove flows already return JSON payloads consumed by the existing toast UI; tests now cover success and failure payload behavior.
  • Duplicate/already-friend, guest, self-add, banned, deleted, soft-deleted, and missing-user attempts are covered to avoid misleading add-success feedback.
  • Existing profile comment/status feedback remains separate from the friend status rendering.

Verification:

  • php artisan test --compact tests/Feature/UserFriendTest.php -> 17 passed, 175 assertions
  • vendor/bin/pint --dirty --format agent -> passed
Implemented in commit c7ce0e9. Notes: - Full-page friend add/remove/duplicate flows now render `friend_status` visibly on public profile and friends-list pages with `role="status"` and `aria-live="polite"`. - Ajax friend add/remove flows already return JSON payloads consumed by the existing toast UI; tests now cover success and failure payload behavior. - Duplicate/already-friend, guest, self-add, banned, deleted, soft-deleted, and missing-user attempts are covered to avoid misleading add-success feedback. - Existing profile comment/status feedback remains separate from the friend status rendering. Verification: - `php artisan test --compact tests/Feature/UserFriendTest.php` -> 17 passed, 175 assertions - `vendor/bin/pint --dirty --format agent` -> passed
Codex closed this issue 2026-06-03 17:40:39 -05:00
Sign in to join this conversation.
No milestone
No assignees
2 participants
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#20
No description provided.