Client sidebar: long nav titles are cut off in the expanded sidebar

Open Beginner friendly
#4,919 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Read packages/client/src/components/layout/nav.tsx and inspect both the NavLink link and button branches, then compare the expanded sidebar with the collapsed dropdown behavior. Check the relevant sidebar styles and titles in sidelinks.tsx; done when every expanded desktop title is readable and the collapsed and mobile sidebars still look right.

Written by the indexing model from the issue text.

Description

Problem

In the expanded desktop sidebar (w-[240px], packages/client/src/components/layout/sidebar.tsx), nav links whose title is longer than the available width are cut off at the sidebar's right edge instead of wrapping or shortening. Seen after #4913 regrouped the menu, but the behavior predates it.

Titles that currently get cut off include:

  • Tax & Filings → "Corporate Tax Ruling Compliance Report", "Securities Semi-Annual Report", "Generate Uniform Files", "CPI Linkage Calculator"
  • Reports → "Profit and Loss Report", "Transactions Balance", "Annual Revenue Report"
  • Documents → "Issue Monthly Documents"
  • Charts → "Monthly Income/Expense"
  • Year-End Closing → "Accountant Approvals"

Sub-links are indented (ml-8 on the <li> plus px-2 and the icon), which leaves roughly 130px for the title.

The collapsed (icon) mode is not affected: its dropdown items use max-w-52 text-wrap and wrap correctly.

Where

  • packages/client/src/components/layout/nav.tsx: NavLink (both the <Link> and the action <button> branches) passes text-wrap together with buttonVariants({ variant: 'ghost', size: 'sm' }). The button variants include whitespace-nowrap, which most likely wins over text-wrap, so the title never wraps. Not yet confirmed.
  • packages/client/src/components/layout/sidelinks.tsx: the titles themselves.

Possible fixes (pick one or combine)

  1. Let sub-link titles wrap: override whitespace-nowrap (e.g. whitespace-normal) in NavLink, and let the row grow past the fixed h-10/h-12 height (e.g. h-auto min-h-10 py-2) so wrapped text isn't clipped vertically.
  2. Shorten menu titles where the group already gives context, e.g. "Tax Ruling Compliance", "Securities Semi-Annual", "Profit and Loss", "Annual Revenue". The page title (route handle.title in packages/client/src/router/config.tsx) can keep the full name. Note that header.tsx takes its title from the sidelinks entry, so it would show the short name too.
  3. Truncate with an ellipsis (truncate) and show the full title in a tooltip.

Done when

  • Every link title in the expanded desktop sidebar is fully readable (wrapped, shortened, or ellipsized with a tooltip) and nothing is clipped at the sidebar edge.
  • Collapsed mode and the mobile sidebar (mobile-sidebar.tsx) still look right.
Dominant language
TypeScript
Stars
30
Forks
10
Avg merge
2d 12h
Merged PRs (30d)
276

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Urigo/accounter-fullstack

All issues in Urigo/accounter-fullstack

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.