Skip to content

Add optional custom avatar to repository block#14

Open
mathetos wants to merge 1 commit into
DevinWalker:mainfrom
mathetos:feature/repository-custom-avatar
Open

Add optional custom avatar to repository block#14
mathetos wants to merge 1 commit into
DevinWalker:mainfrom
mathetos:feature/repository-custom-avatar

Conversation

@mathetos

@mathetos mathetos commented Jun 27, 2026

Copy link
Copy Markdown

Summary

Fixes #4 by adding an optional Custom avatar control to the repository block.

  • New block attributes: customAvatarMediaId / customAvatarMediaUrl (separate from the profile header image fields).
  • Repository sidebar uses the same media picker pattern as the profile block.
  • Server render uses the custom attachment when set; otherwise falls back to the GitHub repo owner's avatar (user or organization).

Approach

Profile and repository blocks already shared one block type but used different image needs, so custom avatar gets its own attributes instead of reusing mediaId. That avoids carrying a profile header photo over when switching block modes.

Org-owned repos need no special API path: GitHub returns owner.avatar_url for both users and organizations, and the override simply replaces that default when present.

Closes #4

Test plan

  • Insert a repository block for a personal repo; confirm default owner avatar shows.
  • Set a custom avatar; confirm it replaces the GitHub image in editor and front end.
  • Remove the custom avatar; confirm GitHub default returns.
  • Repeat with an organization-owned repo (e.g. WordPress/gutenberg) and confirm fallback uses the org logo until overridden.

Separate media attributes from the profile header image, with fallback
to GitHub owner avatars for both user- and org-owned repositories.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

[Update existing functionality] Option to override github profile photo in repository block

1 participant