MultiSelector: add showTooltip to list the selected options on the trigger

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

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

@ironAiken2 がすでに取り組んでいます。

2026年11月10日 から。

  • #162 @ironAiken2 による — オープン

評価

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

調査の方向性

Start at the ui-common MultiSelector wrapper and inspect how it uses useMergedValue, resolves option labels, merges refs, and forwards onOpenChange; then check the existing Tooltip API. Add the opt-in trigger tooltip under the conditions in the proposal, and verify it lists all selected labels while staying closed for an open listbox, disabled state, and renderTrigger.

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

説明

Problem

When a MultiSelector trigger has more selections than it shows, the rest collapse into +N (after three labels in triggerDisplay="labels", after maxBadges badges in "badges"), and long labels are cut off by the ellipsis. The user cannot tell which options are selected without opening the listbox.

Astryx MultiSelector offers no hook for this: +N is fixed text, formatValue returns a string and is not called for "badges", and renderTrigger replaces the whole field. Consumers who wrap the selector in their own Tooltip have to track the selection, merge refs, and keep the tooltip shut while the listbox is open.

Proposal

Add an opt-in showTooltip?: boolean prop to ui-common MultiSelector. When it is set and at least one option is selected, a ui-common Tooltip anchored to the trigger (anchorRef) lists every selected label, comma-separated.

  • The selection comes from the wrapper's existing useMergedValue, so controlled and uncontrolled use both work.
  • Labels are resolved from options (including section options), falling back to the value.
  • The consumer's ref is merged with the anchor ref.
  • The tooltip is held shut while the listbox is open (onOpenChange is still forwarded).
  • No tooltip when disabled, so it does not compete with Astryx's disabledMessage tooltip, and none with renderTrigger, whose control the caller owns.

The default stays off, so existing call sites are unchanged.

Context

lablup/backend.ai-webui#10955 built this inside a product wrapper; that PR is on hold until this lands, after which the wrapper goes back to a plain re-export (lablup/backend.ai-webui#10986).

主要言語
TypeScript
スター
2
フォーク
0
平均マージ
21時間 38分
マージ済み PR(30日)
38

環境構築

はじめの一歩

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

lablup/ui-common のほかの issue

lablup/ui-common の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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