Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selectコンポーネントのガイドラインに使用上の注意を追加する #1127

Merged
merged 20 commits into from May 14, 2024

Conversation

oti
Copy link
Contributor

@oti oti commented Apr 16, 2024

課題・背景

https://smarthr.atlassian.net/browse/SD-651

やったこと

Selectコンポーネントのガイドラインに使用上の注意を追加しました。
https://deploy-preview-1127--smarthr-design-system.netlify.app/products/components/select

項目が5個以下であればRadioButtonコンポーネントの利用をまず検討してください。

配置するスペースがなかったり、項目が6個以上の場合にSelectコンポーネントの利用を検討してください。

配置するスペースがないとか項目が6以上のとき、ただちにSelectコンポーネントに変えるべきとまでは思わないので、「検討してください」としています。参考

確認おねがいいたします。

Copy link

netlify bot commented Apr 16, 2024

Deploy Preview for smarthr-design-system ready!

Name Link
🔨 Latest commit f31b78a
🔍 Latest deploy log https://app.netlify.com/sites/smarthr-design-system/deploys/663d66622583bb000825e0ef
😎 Deploy Preview https://deploy-preview-1127--smarthr-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@versionfive versionfive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1点コメントですー

content/articles/products/components/select.mdx Outdated Show resolved Hide resolved
@tosiiu tosiiu requested a review from Qs-F April 18, 2024 01:55
Copy link
Contributor

@Qs-F Qs-F left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1点コメントしました!

content/articles/products/components/select.mdx Outdated Show resolved Hide resolved
@oti oti requested a review from a team as a code owner April 22, 2024 08:41
@oti oti requested a review from Qs-F April 22, 2024 08:41
@oti oti requested review from uknmr and versionfive April 22, 2024 08:46
Copy link
Contributor

@tosiiu tosiiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

いくつかコメント入れました!

content/articles/products/components/select.mdx Outdated Show resolved Hide resolved
content/articles/products/components/select.mdx Outdated Show resolved Hide resolved
Copy link
Contributor

@tosiiu tosiiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

個人的に、Selectで選択する対象は「選択項目」より「選択肢」と呼ぶ方が理解しやすいです!(選択項目だと選択済項目をイメージしちゃうかも)

@oti oti requested a review from tosiiu April 23, 2024 02:40
@oti
Copy link
Contributor Author

oti commented Apr 23, 2024

@tosiiu 利用を検討利用を検討ってしつこかったので別の表現に変えつつ、当該箇所を修正しました!
https://deploy-preview-1127--smarthr-design-system.netlify.app/products/components/select/#h2-0

Copy link
Contributor

@versionfive versionfive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

意図が把握できない表現があったのでコメントしました

Comment on lines 26 to 28
選択肢の数が定まらない箇所で、数によってSelectとRadioButtonを出し分けることは推奨しません。

管理画面ではなく操作画面でユーザー自身が選択肢を設定できる場合は、[Combobox](/products/components/combo-box/)の利用を検討してください。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

過去のやり取りを見ていない状況で読んだのですが、この2文が言いたいことがうまく伝わりませんでした。

  • 同一画面で数によってSelectとRadioButtonがバラバラと並んでいるのは避ける?
  • 「管理画面ではなく操作画面で」とはどういうことでしょうか…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@versionfive 前者の一文は、その前の段落とセットになっていて、

選択肢が管理画面などで自由に設定され、ユーザーの操作画面に表示する際に数が定まらない場合は、選択肢の最大数を考慮して利用するコンポーネントを判断してください。

選択肢の数が定まらない箇所で、数によってSelectとRadioButtonを出し分けることは推奨しません。

でまとめて解釈してほしい箇所でした。ここは選択肢の元ネタが増減する場合、たとえば評価シートの設問設定画面で選択肢の数が可変な場合を言っていて、そういうときはユーザーが操作する画面側で「元ネタの数によってUIを切り替える」ようなことはせずに、提供する側の最大値で判断してねという話です。そういうふうに元ネタを設定できる画面を「管理画面」と読んでいるつもり、でした。

後者の一文は、そういう管理画面がない場合で、ユーザーが自分で選択肢を追加できるシーンを言っています。Comboboxにもうその機構があるから使ってねくらいのつもりでしたが、この文になる前は「例えばselectやradioの隣に新規に選択肢を入力するinputと追加buttonなどを配置する必要はありません」的なことを添えていました。

前者は段落を分けずにつなげたら良さそう? 後者はもはや不要な気がしてきましたが、イキの場合はもうちょっと説明が必要かもしれませんね…

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほどなんとなく理解できました。
想定元のUIのイメージがない人が読み取るのがどちらも難しいと思ったのですが、例えばUIイメージを画像なりで示すのはどうですか?「こうしないでね」という意図を感じたのでDo&Don'tで見せるのもアリかと思いました。

Copy link
Contributor Author

@oti oti May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@versionfive UIイメージを画像なりで示すとなると、たとえば人事評価の管理画面を使うと思うんですが、それはそれで人事評価ツールを使っていない人にとってはイメージしづらいのは変わらなそうだなぁと思えてきました。文章だけで伝わるようにできないかもう少し考えてみます。

Qs-F
Qs-F previously approved these changes Apr 26, 2024
@oti oti requested a review from versionfive May 1, 2024 02:27
wentzzz
wentzzz previously approved these changes May 1, 2024
Copy link
Contributor

@wentzzz wentzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@oti oti dismissed stale reviews from wentzzz, Qs-F, and uknmr via 752de9c May 7, 2024 07:52
@oti oti requested review from uknmr, Qs-F and wentzzz May 7, 2024 07:55

ただし、RadioButtonで配置するスペースがない場合はSelectも利用可能です。

### 選択肢の数が未定の場合
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 選択肢の数が未定の場合
### 選択肢の数が不定の場合

imo: 「未定」だといつか決まるというニュアンスに聞こえるので、「不定」が良さそうな気がします

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

言いたいこと的に不定が合ってそうなので修正しました!

@oti
Copy link
Contributor Author

oti commented May 7, 2024

@uknmr @Qs-F @wentzzz @versionfive @tosiiu 構成を見直して全体的に文章を変更しました。

  • 選択肢が6個以上の場合を基本とし、選択肢が一覧できないことを最初に記述した
  • 数での切り分けからの流れで、5個以下のとき、数が未定のときを記述した
  • ユースケースとしてフィルタリングさせたい場合を記述した

#1152 のPRでSingleComboBoxのページが作られる予定なので、リンク先をそれに合わせています。

何度もreview requestして恐縮ですが確認お願いいたします!

@oti oti requested a review from wentzzz May 7, 2024 08:05
@@ -9,6 +9,26 @@ import { ComponentStory } from '@Components/ComponentStory'

<ComponentStory name="Select" />

## 使用上の注意

基本的に選択肢の数が6個以上になる場合はSelectを利用します。また、初期状態では選択肢を一覧できないことに注意してください。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「また」に関して、「また」の前後が並列関係の書き方ではないので最初ちょっと不自然に感じました😭 (私だけかもなので気にならなかったらLGTMです!

Copy link
Contributor

@versionfive versionfive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全体的に見通しが良くなったと思います!コメントしました

Comment on lines 12 to 27
## 使用上の注意

基本的に選択肢の数が6個以上になる場合はSelectを利用します。また、初期状態では選択肢を一覧できないことに注意してください。

ユーザーがスムーズに操作できるよう、選択肢の数に応じてSelectコンポーネント以外の利用も考えられます。

### 選択肢が5個以下の場合

一般的に人は4±1個の情報のまとまりまでしか短期的に記憶できないと言われています。選択肢が5個以下であれば、初期状態で選択肢が一覧できる[RadioButton](/products/components/radio-button/)の利用を推奨します。

ただし、RadioButtonで配置するスペースがない場合はSelectも利用可能です。

### 選択肢の数が不定の場合

ユーザーの設定や条件によって選択肢の数が増減するなど、実装時に数を固定できない場合は、想定される最大数を考慮して利用するコンポーネントを判断してください。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 使用上の注意
基本的に選択肢の数が6個以上になる場合はSelectを利用します。また、初期状態では選択肢を一覧できないことに注意してください。
ユーザーがスムーズに操作できるよう、選択肢の数に応じてSelectコンポーネント以外の利用も考えられます。
### 選択肢が5個以下の場合
一般的に人は4±1個の情報のまとまりまでしか短期的に記憶できないと言われています。選択肢が5個以下であれば、初期状態で選択肢が一覧できる[RadioButton](/products/components/radio-button/)の利用を推奨します。
ただし、RadioButtonで配置するスペースがない場合はSelectも利用可能です。
### 選択肢の数が不定の場合
ユーザーの設定や条件によって選択肢の数が増減するなど、実装時に数を固定できない場合は、想定される最大数を考慮して利用するコンポーネントを判断してください。
## 使用上の注意
### 選択肢が6個以上の場合に使用する
基本的に選択肢の数が6個以上になる場合はSelectを使用します。また、初期状態では選択肢を一覧できないことに注意してください。
ユーザーがスムーズに操作できるよう、選択肢の数に応じてSelectコンポーネント以外の使用も考えられます。
#### 選択肢が5個以下の場合
一般的に人は4±1個の情報のまとまりまでしか短期的に記憶できないと言われています。選択肢が5個以下であれば、初期状態で選択肢が一覧できる[RadioButton](/products/components/radio-button/)の使用を推奨します。
ただし、RadioButtonで配置するスペースがない場合はSelectも使用可能です。
#### 選択肢の数が不定の場合
ユーザーの設定や条件によって選択肢の数が増減するなど、実装時に数を固定できない場合は、想定される最大数を考慮して使用するコンポーネントを判断してください。

見出し構造が見づらくなっていたので、まず「このとき使う」を見えるようにして、その他のケースは下に下げました。

[Proposal] また主語が開発者の場合、コンポーネントは「利用」よりも「使用」派です。(という話を @tosiiu sanとしていました)


### SingleComboBoxとの使い分け

単一選択かつ、ユーザーに選択肢をフィルタリングさせたい場合は[SingleComboBox](/products/components/combo-box/single-combo-box)の利用を検討してください。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
単一選択かつ、ユーザーに選択肢をフィルタリングさせたい場合は[SingleComboBox](/products/components/combo-box/single-combo-box)の利用を検討してください
単一選択かつ、ユーザーに選択肢をフィルタリングさせたい場合は[SingleComboBox](/products/components/combo-box/single-combo-box)の使用を検討してください

[Proposal] 主語が開発者の場合、コンポーネントは「利用」よりも「使用」派です。

@oti oti requested review from versionfive and Qs-F May 10, 2024 00:12
@oti
Copy link
Contributor Author

oti commented May 10, 2024

@versionfive @Qs-F 見出し構造と表現を修正しました!

@wentzzz こちらが先にマージされる気運になってきたので、single-combo-box のリンクを combo-box に戻してあります。お手数ですが #1152 の対応時に select.mdx の修正もお願いいたします。

Copy link
Contributor

@versionfive versionfive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

Copy link
Contributor

@tosiiu tosiiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
一点細かい個人的な気になりをコメントしましたが、判断はお任せします!


### ComboBoxとの使い分け

単一選択かつ、ユーザーに選択肢をフィルタリングさせたい場合は[ComboBox](/products/components/combo-box/)の使用を検討してください。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[IMO] SmartHRのSelectにおいてはmultiple属性を想定されていない認識なので、単一選択であることは文脈から自明として省けそうに思いました。

Suggested change
単一選択かつ、ユーザーに選択肢をフィルタリングさせたい場合は[ComboBox](/products/components/combo-box/)の使用を検討してください。
ユーザーに選択肢をフィルタリングさせたい場合は[ComboBox](/products/components/combo-box/)の使用を検討してください。

Copy link
Contributor

@Qs-F Qs-F left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMです!

@oti oti merged commit d613489 into main May 14, 2024
5 checks passed
@oti oti deleted the add-guidlines-select branch May 14, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants