Skip to content

expand usermenu to show name, handle - #5559

Open
Elazawy wants to merge 1 commit into
OWASP:mainfrom
Elazawy:feat/improve-navbar-profile-3746
Open

Elazawy wants to merge 1 commit into
OWASP:mainfrom
Elazawy:feat/improve-navbar-profile-3746

Conversation

@Elazawy

@Elazawy Elazawy commented Sep 9, 2026

Copy link
Copy Markdown

Proposed change

Resolves #3746

The authenticated user button in the navbar previously rendered only a bare avatar circle, giving no visible identity context and feeling visually unbalanced in both the desktop navbar and the mobile drawer.
This change expands the UserMenu trigger to display:
- The user's circular avatar
- Display name
- GitHub handle
- Smoothly animated rotating chevron indicator when the menu opens/closes
- min-w-0 and truncation styling to ensure long names/logins do not overflow in desktop view or the 16rem mobile navigation drawer

Unit tests have been added to verify:                                                                                          
- Name and handle rendering                                                                                                    
- Fallback when display name is not provided                                                                                   
- Safe omitting of handle when absent
- Chevron icon rotation class toggling on menu state change

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran all required checks and tests locally; all warnings addressed and failures resolved
  • I used AI for code, documentation, tests, or communication related to this PR

@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 839a8811-2586-4fec-ac88-d73804a475f1

📥 Commits

Reviewing files that changed from the base of the PR and between c012dd6 and ac70aed.

📒 Files selected for processing (2)
  • frontend/__tests__/unit/components/UserMenu.test.tsx
  • frontend/src/components/UserMenu.tsx

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Summary by CodeRabbit

  • New Features

    • User menu now displays the signed-in user’s name and handle beside the avatar.
    • Added fallback labels when profile details are unavailable.
    • Added a chevron indicator that rotates when the menu opens or closes.
  • Tests

    • Added coverage for user-name fallbacks and dropdown chevron behavior.

Walkthrough

UserMenu now shows the authenticated user's name and handle, applies fallbacks when profile fields are missing, and rotates a chevron when the dropdown opens. Tests cover identity rendering and chevron state changes.

Changes

User menu identity and interaction

Layer / File(s) Summary
Identity display and chevron state
frontend/src/components/UserMenu.tsx, frontend/__tests__/unit/components/UserMenu.test.tsx
UserMenu derives display-name and handle fallbacks, renders them beside the avatar, and rotates the chevron based on dropdown state. Tests cover authenticated identity, missing-field fallbacks, and open/closed chevron state.

Priority: ⬇️ Low

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

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to ac70a

The user menu now shows profile identity details with safe fallbacks and a stateful chevron. The covered UI behavior is ready to merge with no identified production risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: expanding the user menu to show the user's name and handle.
Description check ✅ Passed The description directly explains the UserMenu changes, related UI behavior, styling, tests, and linked issue.
Linked Issues check ✅ Passed The changes address issue #3746 by making the GitHub profile section more informative and visually balanced. The display name, handle, avatar layout, chevron state, and overflow handling support the i…
Out of Scope Changes check ✅ Passed All changes are within scope for issue #3746. The implementation and unit tests cover the expanded profile display, fallback behavior, responsive truncation, and menu-state indicator.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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 commented Sep 9, 2026

Copy link
Copy Markdown

Contribution validation failed:

  • commit_signature: One or more commits are not signed.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 9, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread frontend/src/components/UserMenu.tsx Resolved
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Contribution validation failed:

  • commit_signature: One or more commits are not signed.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Re-trigger cubic

Signed-off-by: elazawy <ahmed.m.elazawy@gmail.com>
@Elazawy
Elazawy force-pushed the feat/improve-navbar-profile-3746 branch from ac70aed to 4913e8b Compare September 9, 2026 11:24
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@ahmedxgouda ahmedxgouda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve GitHub Profile Section in Navbar

2 participants