Skip to content

feat: Add User Profile Menu and Logout Option#429

Open
Vamshi-Microsoft wants to merge 4 commits intodevfrom
psl-add-User-Profile
Open

feat: Add User Profile Menu and Logout Option#429
Vamshi-Microsoft wants to merge 4 commits intodevfrom
psl-add-User-Profile

Conversation

@Vamshi-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request adds a user profile avatar with a dropdown menu to the header, which displays the signed-in user's information and provides a logout option. The avatar and menu are only rendered when MSAL authentication is enabled, ensuring compatibility with authentication state. The implementation is modular, with a new UserProfile component and logic to safely determine when authentication is active.

Authentication-aware header improvements:

  • Added a check in Header.tsx to determine if MSAL authentication is enabled, ensuring that authentication-dependent components are only rendered when appropriate.
  • Updated the header's toolbar area to include the new UserProfile avatar and menu, but only when authentication is enabled.

New user profile menu:

  • Introduced a new UserProfile component that displays the signed-in user's initials as an avatar, shows a menu with the user's name and email, and provides a logout option. The component uses the useAuth hook and Fluent UI components for styling and functionality.
  • Imported the new UserProfile component into the header.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an authentication-aware user profile avatar to the frontend header that opens a dropdown menu showing the signed-in user’s name/email and a logout action, while ensuring the profile UI only mounts when MSAL auth is enabled.

Changes:

  • Added a new UserProfile header component that renders an avatar-based menu with user info and logout.
  • Updated Header to conditionally render UserProfile only when window.appConfig.ENABLE_AUTH indicates MSAL authentication is enabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/frontend/src/components/Header/UserProfile.tsx New component that shows the signed-in user avatar/menu and triggers logout via useAuth().
src/frontend/src/components/Header/Header.tsx Conditionally mounts UserProfile based on runtime config (ENABLE_AUTH) and wraps the toolbar area to include it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/frontend/src/components/Header/Header.tsx Outdated
Comment thread src/frontend/src/components/Header/Header.tsx Outdated
Copilot AI review requested due to automatic review settings May 8, 2026 07:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/frontend/src/components/Header/UserProfile.tsx
Comment thread src/frontend/src/components/Header/UserProfile.tsx
Copy link
Copy Markdown

@Tejasri-Microsoft Tejasri-Microsoft left a comment

Choose a reason for hiding this comment

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

looks good so approving

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.

3 participants