Handling undefined value in table columns?
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 153
- Forks
- 46
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 7
Description
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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par les lignes 1099-1123 de src/table.js et reproduisez le comportement de la table de l’issue-pane avec une catégorie undefined. Comparez les trois comportements proposés — changements de sélection, option undefined explicite ou validation/définition de valeurs par défaut — avec l’UI actuelle de la table, puis confirmez que le comportement choisi couvre à la fois l’affichage des lignes et leur filtrage.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 20/100