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

Abierto Apto para principiantes
#4,919 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
83/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Lee packages/client/src/components/layout/nav.tsx e inspecciona tanto la rama de enlace como la de botón de NavLink. Después, compara la barra lateral expandida con el comportamiento del menú desplegable contraído. Revisa los estilos y títulos relevantes de la barra lateral en sidelinks.tsx; el trabajo estará terminado cuando todos los títulos de la vista de escritorio expandida sean legibles y las barras laterales contraída y móvil sigan viéndose bien.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
30
Forks
10
Merge medio
2 d 12 h
PR fusionados (30 d)
276

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Urigo/accounter-fullstack

Todos los issues de Urigo/accounter-fullstack

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.