SolidOS / SolidOS/solid-ui

Handling undefined value in table columns?

Offen
#418 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
TypeScript
Sterne
153
Forks
46
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
7

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei src/table.js in den Zeilen 1099-1123 und bilde das Verhalten der Issue-Pane-Tabelle mit einer undefined-Kategorie nach. Vergleiche die drei vorgeschlagenen Verhaltensweisen – Änderungen der Auswahl, eine explizite undefined-Option oder Validierung/Standardwertsetzung – mit der aktuellen Tabellen-UI und bestätige anschließend, dass das gewählte Verhalten sowohl die Anzeige von Zeilen als auch deren Filterung abdeckt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.