Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BBButton: truncate a long label with an ellipsis

オープン
#106 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
react, typescript
領域
frontend

調査の方向性

Start in the BBButton component and its styles, where the label span is rendered in the default layout and the div in the stacked layout. Read the TruncatingButtonWrapper example in the issue to see which rules the new truncateLabel prop must reproduce. Done means that with truncateLabel the button can shrink and the label truncates with an ellipsis in the default layout, and the full label appears as the tooltip only when no tooltipLabel is set. Confirm the design choice against #105 before writing code.

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

説明

Is your feature request related to a problem? Please describe.
In a row of equal-width buttons, a long label either overflows or pushes the row wider. The BigBlueButton 4.0 breakout rooms panel handles this by truncating with an ellipsis. Its buttons include Join/Leave room, Call moderator, Megaphone and Finish. To truncate, the client reaches into BBButton's markup through TruncatingButtonWrapper:

const TruncatingButtonWrapper = styled(FullWidthFlexItem)`
  flex: 1 1 10rem;
  min-width: 0;

  > * {
    min-width: 0;
  }

  button span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
`;

className forwarding (0.9.0) moves the button-level rules into styled(BBButton). The ellipsis still has to target the label <span>, which is internal: the stacked layout renders a div there instead.

Truncation also hides part of the label from sighted users. The accessible name stays whole, because aria-labelledby points at the span. But most of those buttons have no tooltipLabel, so a truncated label can't be read in full.

Describe the solution you'd like
A truncateLabel?: boolean prop for the default layout:

  • The button gets min-width: 0, so it can shrink as a flex item.
  • The label gets overflow: hidden; text-overflow: ellipsis; white-space: nowrap.
  • Optionally, when the label is actually truncated (scrollWidth > clientWidth) and no tooltipLabel is set, the full label shows as the tooltip.

This is the other answer to the overflow in #105. One prop could cover both: labelOverflow?: 'nowrap' | 'wrap' | 'ellipsis'.

Describe alternatives you've considered
The wrapper above, which depends on the label being a direct <span> of the <button>.

Affected component(s)
BBButton

Proposed API / Usage Example

const RoomActionButton = styled(BBButton)`
  flex: 1 1 10rem;
`;

<RoomActionButton label={intl.formatMessage(messages.callModerator)} truncateLabel fullWidth onClick={callModerator} />
主要言語
TypeScript
スター
2
フォーク
5
平均マージ
1日 21時間
マージ済み PR(30日)
15

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

bigbluebutton/bbb-ui-components-react のほかの issue

bigbluebutton/bbb-ui-components-react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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