Skip to content

Navbar UI breaks with long usernames #113

Description

@SahithiKokkula

Navbar UI Breaks with Long Usernames

Describe the bug
When a user has a long display name (e.g., "Kokkula Sahithi 4-Yr B.Tech.: Mechanical Engg., IIT(BHU)"), the navbar layout breaks. The username section expands beyond its allocated space, causing navigation tabs to overlap and the layout to become cluttered.

Root Cause Analysis
In src/components/Navbar.tsx, the username is displayed using user?.fullName || user?.username || "User" inside a badge component (around line 151) without any text truncation or max-width constraint. The badge uses hidden md:block for responsive hiding but has no overflow handling.

What Needs to Be Done

  1. Add max-w-[150px] truncate or similar Tailwind classes to the username badge
  2. Add a title attribute to show the full name on hover
  3. Test with very long names on desktop, tablet, and mobile breakpoints
  4. Ensure the Clerk UserButton component and navigation links do not overlap

Files to Modify

  • src/components/Navbar.tsx — line ~150-155 (username badge section)

Acceptance Criteria

  • Long usernames are truncated with ellipsis in the navbar
  • Full name visible on hover (tooltip)
  • Navigation links remain properly spaced
  • Works on all screen sizes (desktop, tablet, mobile)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersui/uxInterface or user experience improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions