Skip to content

Improve Contributor Profile header layout - #146

Closed
priyanshunitr wants to merge 2 commits into
AOSSIE-Org:mainfrom
priyanshunitr:contributorUI
Closed

Improve Contributor Profile header layout#146
priyanshunitr wants to merge 2 commits into
AOSSIE-Org:mainfrom
priyanshunitr:contributorUI

Conversation

@priyanshunitr

@priyanshunitr priyanshunitr commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Addressed Issues

Fixes #142

Screenshots/Recordings

Before

image

After

image

Additional Notes

This PR improves the Contributor Profile header by:

  • Replacing the redundant heading and subtitle with the contributor’s avatar and username.
  • Adding a direct link to the contributor’s GitHub profile.
  • Adding a Share Profile button that shares the current contributor profile URL.
  • Making the back navigation more visible.
  • Matching and centering the Share and Export action buttons.
  • Adding a hover effect to the Export button.
  • Preventing horizontal overflow on mobile devices.
  • Stacking profile actions and using a two-column metrics grid on smaller screens.
  • Collapsing navbar action labels into accessible icon buttons on mobile.

Verification

  • All 40 automated tests pass.
  • The production build completes successfully.
  • Desktop, tablet, and 390px mobile layouts were manually verified.
  • No new runtime errors were introduced.
  • No documentation changes were required because this is a presentational UI update.

AI Disclosure

AI tools were used to assist with implementation and verification. The resulting changes were manually reviewed, tested, and validated against the issue requirements.

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
    • Contributor profiles now display avatars with fallback initials, GitHub profile links, and social sharing controls.
    • Export and navigation actions have clearer labels and improved accessibility.
  • Style
    • Added hover states, transitions, and refined styling for profile controls and links.
    • Improved responsive layouts for smaller screens, including stacked actions, resized controls, hidden labels, and two-column statistics.
  • Bug Fixes
    • Improved handling of missing or failed contributor avatars, including automatic fallback display.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The PR adds navbar styling hooks and accessible action markup. It redesigns the contributor profile header with avatar fallback handling, GitHub and sharing actions, export controls, and responsive layout rules.

Changes

Contributor profile UI

Layer / File(s) Summary
Navbar controls and styling hooks
src/components/Navbar.jsx
The navbar now exposes dedicated container classes. Settings and Support Us buttons now define button types, ARIA labels, shared action styling, and label spans.
Contributor profile header and responsive layout
src/pages/ContributorProfilePage.jsx, src/styles/global.css
The profile header now renders avatar fallback handling, GitHub and sharing actions, export and back controls, and responsive statistics styling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: Typescript Lang

Suggested reviewers: rahul-vyas-dev

Poem

A rabbit hops through profiles bright,
With icons neat and buttons right.
Avatars bloom or initials show,
Share and export now softly glow.
Small screens stack the controls with care.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Navbar.jsx changes add mobile navbar behavior that is not requested by linked issue #142. Move the navbar changes to a separate pull request or link an issue that requires mobile navbar action updates.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: improving the Contributor Profile header layout.
Linked Issues check ✅ Passed The changes implement issue #142 objectives, including the profile image, Share Profile action, clearer back navigation, and improved header alignment.
✨ 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.

@github-actions github-actions Bot added enhancement New feature or request frontend Frontend changes javascript JavaScript/TypeScript changes size/L 201-500 lines changed first-time-contributor First time contributor and removed size/L 201-500 lines changed labels Aug 6, 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: 2

🤖 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/ContributorProfilePage.jsx`:
- Around line 332-340: In ContributorProfilePage, keep all hooks unconditional
but add an early missing-profile render before the avatar identity expressions
and other username-dependent rendering execute. Guard the contributor lookup in
the avatarUrl derivation and the username.charAt() usage by returning the
existing fallback state when username is absent, while preserving normal
rendering for valid usernames.

In `@src/styles/global.css`:
- Around line 66-156: Reorder declarations alphabetically within the newly added
CSS blocks, especially `.contributor-profile-github` and the mobile
`.navbar-icon-action` rule, placing properties such as `height` before `width`
where applicable. Apply the same alphabetical ordering consistently to the other
changed selectors without changing their values or behavior.
🪄 Autofix

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 Plus

Run ID: 14b0d55c-3d69-4012-b861-81719e4146d4

📥 Commits

Reviewing files that changed from the base of the PR and between f911298 and ec7f888.

📒 Files selected for processing (3)
  • src/components/Navbar.jsx
  • src/pages/ContributorProfilePage.jsx
  • src/styles/global.css

Comment on lines +332 to +340
const contributorAvatar = model?.contributors?.find(
contributor => contributor.login.toLowerCase() === username.toLowerCase()
)?.avatar_url
const contributionAvatar = rawContributions.find(item => item.user?.avatar_url)?.user.avatar_url
const avatarUrl = contributorAvatar || contributionAvatar

useEffect(() => {
setAvatarFailed(false)
}, [avatarUrl, username])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Handle a missing username before deriving the profile identity.

When username is missing, the effect at Line 153 stops loading but does not stop rendering. Line 333 then calls username.toLowerCase(). Line 454 also calls username.charAt(). Both calls throw before the page can show a fallback state.

Keep hooks unconditional. Then render a missing-profile state before these identity expressions execute.

Also applies to: 432-496

🤖 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/ContributorProfilePage.jsx` around lines 332 - 340, In
ContributorProfilePage, keep all hooks unconditional but add an early
missing-profile render before the avatar identity expressions and other
username-dependent rendering execute. Guard the contributor lookup in the
avatarUrl derivation and the username.charAt() usage by returning the existing
fallback state when username is absent, while preserving normal rendering for
valid usernames.

Comment thread src/styles/global.css
Comment on lines +66 to +156
.contributor-profile-actions .social-share-btn {
box-sizing: border-box;
height: 44px;
padding-top: 0;
padding-bottom: 0;
justify-content: center;
}

.contributor-profile-export {
transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contributor-profile-export:hover:not(:disabled) {
transform: translateY(-1px);
box-shadow: 0 8px 22px rgba(245,197,24,.25) !important;
}

.contributor-profile-back {
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.contributor-profile-back:hover {
background: var(--surface2) !important;
border-color: rgba(245, 197, 24, 0.35) !important;
color: var(--text) !important;
}

.contributor-profile-github {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
flex: 0 0 32px;
align-self: center;
line-height: 0;
color: var(--text2);
transition: color 0.2s ease, transform 0.2s ease;
}

.contributor-profile-github:hover {
color: var(--accent);
transform: translateY(-1px);
}

@media (max-width: 600px) {
.app-navbar {
padding-left: 12px !important;
padding-right: 12px !important;
gap: 8px !important;
}

.app-navbar-links {
min-width: 0;
}

.app-navbar-actions {
gap: 6px !important;
}

.navbar-action-label {
display: none;
}

.navbar-icon-action {
width: 32px;
height: 32px;
padding: 0 !important;
justify-content: center;
}

.contributor-profile-heading > div {
flex-direction: column;
align-items: stretch !important;
gap: 16px;
}

.contributor-profile-actions {
width: 100%;
flex-direction: column;
align-items: stretch !important;
}

.contributor-profile-actions > div,
.contributor-profile-actions .social-share-btn,
.contributor-profile-actions .contributor-profile-export {
width: 100%;
}

.contributor-profile-stats {
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use alphabetical declaration order in the new CSS blocks.

Several blocks do not follow the Google CSS declaration-order rule. For example, .contributor-profile-github starts with display before align-items, and .navbar-icon-action starts with width before height.

Reorder declarations consistently in the changed blocks. As per path instructions, review CSS against the Google CSS style guide.

🤖 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/styles/global.css` around lines 66 - 156, Reorder declarations
alphabetically within the newly added CSS blocks, especially
`.contributor-profile-github` and the mobile `.navbar-icon-action` rule, placing
properties such as `height` before `width` where applicable. Apply the same
alphabetical ordering consistently to the other changed selectors without
changing their values or behavior.

Source: Path instructions

@Ri1tik

Ri1tik commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closing as duplicated by your recent PR# 147

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

Labels

enhancement New feature or request first-time-contributor First time contributor frontend Frontend changes javascript JavaScript/TypeScript changes size/L 201-500 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Improve Contributor Profile header layout and back-button visibility

2 participants