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

オープン 初心者向け
#4,919 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
83/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react, typescript
領域
frontend

調査の方向性

packages/client/src/components/layout/nav.tsx を読み、NavLink のリンク分岐とボタン分岐の両方を確認してから、展開されたサイドバーと折りたたまれたドロップダウンの動作を比較してください。sidelinks.tsx の関連するサイドバーのスタイルとタイトルを確認してください。展開されたデスクトップ表示のタイトルがすべて読みやすく、折りたたまれたサイドバーとモバイルのサイドバーも適切な見た目であれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
TypeScript
スター
30
フォーク
10
平均マージ
2日 12時間
マージ済み PR(30日)
276

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Urigo/accounter-fullstack のほかの issue

Urigo/accounter-fullstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。