Skip to content

feat: add contributor avatars with circular clipping and border#84

Open
rahul-vyas-dev wants to merge 1 commit into
AOSSIE-Org:mainfrom
rahul-vyas-dev:feat/contributor-avatar
Open

feat: add contributor avatars with circular clipping and border#84
rahul-vyas-dev wants to merge 1 commit into
AOSSIE-Org:mainfrom
rahul-vyas-dev:feat/contributor-avatar

Conversation

@rahul-vyas-dev

@rahul-vyas-dev rahul-vyas-dev commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Screenshots/Recordings:

Before:
image

After:
image

Additional Notes:

This PR changes to show contributors avatar in Network tab for repo-contributor graph.
Previously this only shows a circle, but changes made in src/pages/NetworkPage.jsx to display the avatar of the contributor.

This change ensures better UX.

Checklist

  • My code follows the project's code style and conventions
  • [] I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • New Features
    • Updated contributor nodes in network visualization to display avatar images in circular frames instead of colored circles.
    • Added visual distinction for cross-repository connectors with specialized border styling.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Contributor nodes in the network graph SVG are changed from rendering a plain filled/stroked circle to rendering a clipped avatar image. Each node now gets a clipPath element keyed on its id, an image element displaying avatar_url clipped to a circle, and an overlaid border circle with stroke color driven by the isConnector flag.

Changes

Contributor Node Avatar Rendering

Layer / File(s) Summary
Avatar clipPath, image, and border circle
src/pages/NetworkPage.jsx
Contributor nodes no longer draw a filled/stroked circle. Instead, each node creates an SVG clipPath with an id derived from d.id, renders an image element at the computed radius clipped to that shape, and draws an overlaid border circle with stroke color toggled by isConnector.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

Typescript Lang

Poem

🐇 No more gray blobs in the graph so bare,
Now avatars bloom in circles with flair!
A clipPath per node, a border in hue,
Connector or not — the stroke tells you true.
Hop hop, the network looks sharp as can be! 🌟

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding contributor avatars with circular clipping and borders to the network visualization.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added no-issue-linked PR has no linked issue frontend Frontend changes javascript JavaScript/TypeScript changes size/S 11-50 lines changed external-contributor External contributor and removed size/S 11-50 lines changed labels Jun 20, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/NetworkPage.jsx`:
- Around line 100-103: The `svg.append('defs')` call is currently being executed
inside the contributor node iteration loop, creating a new `<defs>` container
for each node which is inefficient. Move the `svg.append('defs')` statement
outside and before the loop that iterates through contributors, store the
resulting `defs` reference in a variable, and then inside the loop append the
`clipPath` to the existing `defs` container instead of creating a new one each
time. This ensures a single shared `<defs>` container is created once and reused
for all subsequent `clipPath` elements.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f75c1f57-245f-486f-9750-01f75b158dad

📥 Commits

Reviewing files that changed from the base of the PR and between 46c5c95 and c50af6a.

📒 Files selected for processing (1)
  • src/pages/NetworkPage.jsx

Comment thread src/pages/NetworkPage.jsx
Comment on lines +100 to +103
svg.append('defs')
.append('clipPath')
.attr('id', clipId)
.append('circle')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Use a single shared <defs> container instead of creating one per node.

svg.append('defs') inside each contributor iteration creates unnecessary DOM nodes and work. Create <defs> once, then append each clipPath into it.

Proposed refactor
+    const defs = svg.append('defs')
+
     node.each(function(d) {
       const el = d3.select(this)
       if (d.type === 'repo') {
         const r = repoRadius(d.data.stargazers_count || 0)
         el.append('rect')
@@
       } else {
         const r = contribR(d.data.totalContribs || 1)
         const clipId = `avatar-clip-${d.id}`

-        svg.append('defs')
-          .append('clipPath')
+        defs.append('clipPath')
           .attr('id', clipId)
           .append('circle')
           .attr('r', r)
           .attr('cx', 0)
           .attr('cy', 0)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/NetworkPage.jsx` around lines 100 - 103, The `svg.append('defs')`
call is currently being executed inside the contributor node iteration loop,
creating a new `<defs>` container for each node which is inefficient. Move the
`svg.append('defs')` statement outside and before the loop that iterates through
contributors, store the resulting `defs` reference in a variable, and then
inside the loop append the `clipPath` to the existing `defs` container instead
of creating a new one each time. This ensures a single shared `<defs>` container
is created once and reused for all subsequent `clipPath` elements.

Source: Coding guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor External contributor frontend Frontend changes javascript JavaScript/TypeScript changes no-issue-linked PR has no linked issue size/S 11-50 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant