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

Aperta Adatta ai principianti
#4,919 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
83/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Leggi packages/client/src/components/layout/nav.tsx ed esamina sia il ramo link sia quello button di NavLink, quindi confronta la barra laterale espansa con il comportamento del menu a discesa compresso. Controlla gli stili e i titoli pertinenti della barra laterale in sidelinks.tsx; il lavoro è terminato quando tutti i titoli della versione desktop espansa sono leggibili e le barre laterali compressa e mobile continuano ad avere un aspetto corretto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
30
Fork
10
Merge medio
2g 12h
PR unite (30g)
276

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Urigo/accounter-fullstack

Tutte le issue di Urigo/accounter-fullstack

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.