Skip to content

Conversation

@AbdulrahmanReda70
Copy link
Contributor

@AbdulrahmanReda70 AbdulrahmanReda70 commented Oct 29, 2025

Summary

Adds a manual avatar refresh button that allows users to update their GitHub avatar on demand. The button only appears on a user's own profile when they have a connected GitHub account.

Changes

  • Added refresh button next to avatar on user profile settings page
  • Add Livewire component RefreshAvatar with per-user rate limiting (1 request/minute)
  • Updated avatar component to support optional showRefresh prop
  • Renamed hasIdenticon() to hasGitHubIdenticon() for consistency

Fixes #1377

AbdulrahmanReda70 and others added 2 commits October 30, 2025 00:25
- Add refresh button next to avatar on user profile pages
- Button only visible when viewing your own profile
- Button only appears if GitHub account is connected
- Implement per-user rate limiting (1 request per minute)
- Add ProfileController::refresh() method with proper validation
- Update avatar component to support showRefresh prop
- Fix method name from hasIdenticon() to hasGithubIdenticon() for consistency
- Add route for avatar refresh functionality

This feature allows users to manually refresh their GitHub avatar
without waiting for automatic updates. The rate limiting prevents
abuse while providing a better user experience.
Copy link
Member

@driesvints driesvints left a comment

Choose a reason for hiding this comment

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

This is great thanks. Just a few small remarks.

@AbdulrahmanReda70
Copy link
Contributor Author

Oops, I just noticed Blade formatter was on — that’s why there are some style changes in resources/views/components/avatar.blade.php

@driesvints driesvints changed the title [#1377] Add avatar refresh button for GitHub-connected users Add avatar refresh button for GitHub-connected users Oct 31, 2025
@driesvints
Copy link
Member

I actually wanted to have the refresh on the user profile settings instead so I moved it there. The issue now is that the form doesn't works anymore because it's within the settings form. Could you have a look to do that differently? Perhaps create a Livewire component out of the avatar part in the settings form.

The refresh icon also is showing below the avatar now instead of bottom right for some reason.

Thanks for your work!

Scherm­afbeelding 2025-10-31 om 13 10 12

@AbdulrahmanReda70
Copy link
Contributor Author

Thanks! I’ll refactor it as a Livewire component and adjust the icon.

AbdulrahmanReda70 and others added 2 commits October 31, 2025 18:05
- Replace form-based refresh with a dedicated Livewire component
- Fix refresh icon position on avatar
- Remove old refresh route and controller method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to manually refresh the GitHub avatar

2 participants