Handling undefined value in table columns?
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 153
- フォーク
- 46
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 7
説明
In the issue-pane, it is currently possible for a category to have an undefined value, which then means it doesn't show up in the table view.
This occurs because the filterFunction defined by renderEnumSelector in table.js will never return true for an undefined colValue
https://github.com/solid/solid-ui/blob/c2d0c8aed526db4e35640d9f3d543434a2c310ec/src/table.js#L1121-L1123
Possible solutions
It is possible this is simply a bug. searchValue defaults to {}, so !searchValue will always be false, even though a comment may or may not suggest the intended behaviour was to return true:
https://github.com/solid/solid-ui/blob/c2d0c8aed526db4e35640d9f3d543434a2c310ec/src/table.js#L1099-L1103
In this case, a solution would be to use:
return Object.keys(searchValue).length == 0 || colValue && searchValue[colValue.uri];
However, given that the default behaviour of table.js is to select all options, and on a desktop there is currently no way of unselecting all options, the UI would also need to change.
Instead of a new UI element or interaction to deselect all options (let's call that Solution 1), another solution would then be to add an option for undefined, which would have the advantage of being able to show only those options missing a category (Solution 2).
And rather than doing that automatically within table.js, another option is to simply not support undefined values (and perhaps to include some validation code, Solution 3). issue-pane would then need to make sure that a default value is always assigned for a category.
Not sure which of solution 1-3 would be preferred.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
src/table.js の 1099-1123 行目から始め、undefined カテゴリでの issue-pane テーブルの動作を再現します。提案されている 3 つの動作(選択の変更、明示的な undefined オプション、または検証/デフォルト設定)を現在のテーブル UI と比較し、選択した動作が行の表示とフィルタリングの両方をカバーしていることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 20/100