Skip to content

feat(sidebar): added user profile as (avatar + name) → settings - #52

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
sourabh-31:feat/user-profile-sidebar
May 19, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
sourabh-31:feat/user-profile-sidebar

Conversation

@sourabh-31

Copy link
Copy Markdown
Contributor

What Changed And Why

  • Added a shared profile nav component in user-profile-nav-item.tsx and reused it in both sidebar.tsx and mobile-nav.tsx. This keeps the user profile UI consistent across desktop and mobile.
  • Added a safe loading fallback in the shared profile item: while auth data is not ready, the avatar shows U and the label shows User Name, so the UI never looks empty.
  • The profile label uses truncate so long names or emails do not break the sidebar/mobile-nav layout.
  • Avatar initials are derived from only the first two name parts, so a name like Jack D Harlow would render as JD instead of using more than two initials.
  • Updated mobile nav so the menu items are scrollable and the user profile stays fixed at the bottom.
  • Fixed the collapsed desktop sidebar header so the logo is centered properly when minimized.

How To Test The Change

  1. Open the dashboard on desktop and verify the profile row appears at the bottom of the sidebar above the collapse button.
  2. Refresh the page and confirm the temporary fallback state can show avatar U and label User Name before auth data is available.
  3. Verify a long display name or email is visually truncated and does not overflow the sidebar or mobile nav row.
  4. Verify initials use only the first two name parts. For example, a user with First Middle Last should show FM.
  5. Collapse the desktop sidebar and confirm the logo is centered and the profile switches to avatar-only.
  6. Open the mobile nav sheet and confirm the nav items scroll while the profile row stays fixed at the bottom.
  7. Tap the profile row in mobile nav and confirm the sheet closes and navigation goes to /dashboard/settings.

Screenshots

image image

This should fix #45

@gkhngyk

gkhngyk commented May 19, 2026

Copy link
Copy Markdown
Contributor

Great structural work — the shared UserProfileNavItem component, the initials cap at two name parts, and the mobile nav improvements (scrollable list + bottom-pinned profile + logo in header) are all clean judgment calls.

One small ask before we merge:

Please revert web/src/components/ui/sheet.tsx. The 33-line diff there is pure formatting churn (double quotes → single, added semicolons, trailing commas) on a shadcn primitive this PR doesn't logically touch — it's just adding noise to the review surface. One-liner:

git checkout main -- web/src/components/ui/sheet.tsx

Once that's done, we're good to go.

@gkhngyk

gkhngyk commented May 19, 2026

Copy link
Copy Markdown
Contributor

Clean revert — merging now. Thanks for the quick turnaround, looking forward to the next one.

@gkhngyk
gkhngyk merged commit b9d0f3f into ansvisor:main May 19, 2026
@gkhngyk gkhngyk mentioned this pull request May 26, 2026
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.

feat(sidebar): show signed-in user profile row at the bottom (avatar + name → Settings)

2 participants