Skip to content

fix(web): generate missing user avatars from names - #143

Merged
mrboxs merged 1 commit into
mainfrom
fix/users-avatar
Nov 8, 2026
Merged

mrboxs merged 1 commit into
mainfrom
fix/users-avatar

Conversation

@mrboxs

@mrboxs mrboxs commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

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.
    • Added support for two avatar styles.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: Minimal · up to 185c0

The generated-avatar change is ready to merge after normal checks; no blocking issue remains from this review.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

Commits

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.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 185c050.

@mrboxs
mrboxs merged commit c2de073 into main Nov 8, 2026
3 checks passed
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