You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): generate missing user avatars from names - #143
Users without a profile photo, including those signing in with a magic link, now see a generated avatar in the header and sidebar. The avatar uses only the user name as its seed, so the same name produces the same image.
The DiceBear hook returns an SVG data URI and reuses style instances. Existing profile photos remain in use, with initials available if an image fails to load.
Validation:
Avatar regression tests: 8 passed.
Targeted vp check: passed.
Web TypeScript check: passed.
React Doctor changed-source scan: 100/100, no issues.
Summary by CodeRabbit
New Features
User profiles without a usable photo now display a generated avatar based on the user’s name. Existing profile photos remain in use, and initials are still shown if a photo fails to load.
No actionable comments were generated in the recent review.
Walkthrough
The web app adds a hook that generates name-seeded avatar data URIs with DiceBear styles. UserAvatar uses the generated avatar when its image value is missing or blank. Tests cover generated avatars, profile photos, and failed image loads.
Changes
User Avatar Generation
Layer / File(s)
Summary
Generate avatar data URIs apps/web/package.json, apps/web/src/hooks/use-generate-avatar.ts, apps/web/tests/user-avatar.test.tsx
The web app adds DiceBear dependencies and a memoized hook. The hook supports initialFace and notionistsNeutral, with notionistsNeutral as the default. Tests check stability across rerenders and changes to the name or style.
Integrate generated avatars in UserAvatar apps/web/src/components/user-avatar.tsx, apps/web/tests/user-avatar.test.tsx
UserAvatar uses the generated avatar when image is missing or blank and preserves a nonblank image URL. Tests cover missing and blank image values, profile photos, and initials after an image fails to load.
The generated-avatar change is ready to merge after normal checks; no blocking issue remains from this review.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(web): generate missing user avatars from names" matches the main change. The PR adds generated DiceBear SVG avatars, seeded by user name, for users without a profile photo. Existing pho…
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(web): generate missing user avatars from names" matches the main change. The PR adds generated DiceBear SVG avatars, seeded by user name, for users without a profile photo. Existing photos are kept, and the title uses a conventional commit style. The title is specific and concise, and a teammate scanning history would understand the primary change.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files. (1 skipped: 1 unsupported.)
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 76c02ce and 185c050.
Files ignored due to path filters: 1
bun.lock is excluded by !**/*.lock
Files selected for processing: 4
apps/web/package.json
apps/web/src/components/user-avatar.tsx
apps/web/src/hooks/use-generate-avatar.ts
apps/web/tests/user-avatar.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users without a profile photo, including those signing in with a magic link, now see a generated avatar in the header and sidebar. The avatar uses only the user name as its seed, so the same name produces the same image.
The DiceBear hook returns an SVG data URI and reuses style instances. Existing profile photos remain in use, with initials available if an image fails to load.
Validation:
vp check: passed.Summary by CodeRabbit