Skip to content

Fix user info display in sidebar by restoring profile loader#135

Merged
jeroenrinzema merged 4 commits intomainfrom
copilot/fix-user-info-navbar
Feb 5, 2026
Merged

Fix user info display in sidebar by restoring profile loader#135
jeroenrinzema merged 4 commits intomainfrom
copilot/fix-user-info-navbar

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 3, 2026

The user info section in the sidebar displayed hardcoded fallback values ("User", "user@example.com") because the profile loader was commented out, leaving AdminContext unpopulated.

Changes

  • Uncommented profile loader in router.tsx to populate AdminContext on app load
  • Extracted display name logic into getUserDisplayName helper with proper fallback chain: firstName + lastNamefirstNameemail"User"
  • Removed hardcoded email fallback in favor of actual email or empty string
// Before
<UserDropdown
  user={{
    name: profile?.first_name || "User",
    email: profile?.email || "user@example.com",
  }}
/>

// After
const getUserDisplayName = (profile: Admin | null) => {
  if (profile?.first_name && profile?.last_name) {
    return `${profile.first_name} ${profile.last_name}`;
  }
  return profile?.first_name || profile?.email || "User";
};

<UserDropdown
  user={{
    name: getUserDisplayName(profile),
    email: profile?.email || "",
  }}
/>

Applies to all authenticated routes including Settings pages.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Settings] User info navbar broken</issue_title>
<issue_description>The user information section in the top navigation bar of Settings is broken or does not render user information as expected.

Task:

  • Fix the user info display in the settings navbar so user information loads and is displayed correctly across all settings screens.
  • Confirm behavior in edge cases (e.g., missing profile).
    </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 3, 2026 23:46
Co-authored-by: jeroenrinzema <3440116+jeroenrinzema@users.noreply.github.com>
Co-authored-by: jeroenrinzema <3440116+jeroenrinzema@users.noreply.github.com>
Co-authored-by: jeroenrinzema <3440116+jeroenrinzema@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix user info display in settings navbar Fix user info display in sidebar by restoring profile loader Feb 3, 2026
Copilot AI requested a review from jeroenrinzema February 3, 2026 23:54
@jeroenrinzema jeroenrinzema marked this pull request as ready for review February 5, 2026 22:18
@jeroenrinzema jeroenrinzema merged commit e3cab67 into main Feb 5, 2026
@jeroenrinzema jeroenrinzema deleted the copilot/fix-user-info-navbar branch February 5, 2026 22:18
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.

[Settings] User info navbar broken

2 participants