New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fallback for missing avatar images #9603
Conversation
Signed-off-by: Matt Krick <matt.krick@gmail.com>
@mattkrick What if we just used a single default image? |
that's an option! it just sucks when you're in a meeting & you see a sea of the same avatar so you don't know who is who. |
An approach would be to make images with random patterns like GitHub does on the fly, and use it with the user's session. It'll eliminate the drawbacks of single default imaging while being much more user friendly. If you would like me to work on it I can help make an endpoint and raise a PR! |
@Mohd-Muneeb an identicon would be a great idea! Do you have a favorite package? I saw https://www.dicebear.com/styles/initials/ could replicate something very similar to what we have today & it looks like we could even pick a few colors from our palette to set the background. If you'd like to open a PR I'd love to review it! I imagine the flow would be something like:
|
@mattkrick Yep, dicebear sounds like a really good idea. Also, maybe instead of storing them in a CDN, we can probably generate the avatar real time. What I mean to say is, since an email always gives the same image, we can show a identicon generated on client side. This will reduced the cost of a CDN and I don't think it will cause a huge performance reduction on the client side. Please tag me once if you are cool with the idea. I would also like you to look at this Repoistory's README, it solves the problem and I prefer this over dicebear personally, this will eliminate the need for the CDN. Here is an example codepen implementation of the library link, let me know if you are interested and I'll make a custom component and send in a PR! |
If we only used it on the client that could work. Unfortunately we serve that avatar URL everywhere, including emails, which requires URLs that point to raster images or we risk emails getting truncated and avatars not showing up. A CDN only costs about $0.02/GB, so cost isn't a factor. |
Cool, I'll try to send a PR with the plan. You can expect it by Sunday! Do let me know if you have any update, and if I have any questions regarding the project setup, please help me with it. :D |
awesome! looking forward to it |
Description
touches on #9555, but doesn't fix it properly.
this adds a fallback image in case their profile pic fails to load, but it only does this on the Avatar component (think user dash). there may be other places that their avatar fails to load!
not eager to dump 1300 images into our github repo, but not sure what the better alternative is...