Skip to content

feat: display gravatars as user-images - #72

Draft
maxy-shpfy wants to merge 1 commit into
mainfrom
07-31-feat_display_gravatars_as_user-images
Draft

feat: display gravatars as user-images#72
maxy-shpfy wants to merge 1 commit into
mainfrom
07-31-feat_display_gravatars_as_user-images

Conversation

@maxy-shpfy

@maxy-shpfy maxy-shpfy commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Gravatar support for user and message avatars

Contributes to https://github.com/Shopify/oasis-frontend/issues/682

UserAvatar now resolves a Gravatar image for a given email address rather than rendering an initials badge directly. It fetches the Gravatar URL (using d=404 so missing avatars return a 404 rather than a placeholder), caches the result indefinitely via React Query, and renders a fallback node when no avatar exists or the lookup is still in flight.

The initials badge previously baked into UserAvatar has been extracted into a standalone UserInitialsBadge component and passed as the fallback prop at the AppTopNav call site.

MessageAvatar in the chat view now accepts an optional email prop for human authors (sourced from message.author.id). When present, it delegates to UserAvatar with the role icon badge as the fallback, so human messages show a Gravatar when one exists and silently fall back to the existing icon badge when one does not.

Gravatar URL construction uses the Web Crypto API (crypto.subtle) for SHA-256 hashing, avoiding an md5 dependency or Node crypto usage in the browser.

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

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.

1 participant