BBButton: truncate a long label with an ellipsis
メンテナーはふだん 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 notooltipLabelis 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 ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bigbluebutton/bbb-ui-components-react のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bigbluebutton/bbb-ui-components-react#108 ·
メンテナーはふだん 1 日以内に返信
-
BBButton: subtle variant with neutral color has an opaque white background, so it renders white on white in dark mode再び着手できるかも @nisatsama が 11 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bigbluebutton/bbb-ui-components-react#100 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
bigbluebutton/bbb-ui-components-react#107 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 45/100
bigbluebutton/bbb-ui-components-react#105 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
bigbluebutton/bbb-ui-components-react#87 ·
メンテナーはふだん 1 日以内に返信
bigbluebutton/bbb-ui-components-react の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Chocobozzz/PeerTube#7832 ·
メンテナーはふだん 3 日以内に返信
-
Pay to use?オープン
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
darkreader/darkreader#16108 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Add: Dak Nong TV SDオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug engine
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
frostney/GocciaScript#1746 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
agilepathway/label-checker#739 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信