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

Đang mở Phù hợp với người mới
#4,919 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
83/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Đọc packages/client/src/components/layout/nav.tsx và kiểm tra cả nhánh liên kết lẫn nhánh nút của NavLink, sau đó so sánh thanh bên mở rộng với cách hoạt động của menu thả xuống thu gọn. Kiểm tra các kiểu và tiêu đề liên quan của thanh bên trong sidelinks.tsx; hoàn tất khi mọi tiêu đề trên giao diện desktop mở rộng đều dễ đọc và thanh bên thu gọn cũng như thanh bên trên thiết bị di động vẫn trông ổn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
30
Fork
10
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
276

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Urigo/accounter-fullstack

Tất cả issue của Urigo/accounter-fullstack

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.