cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
91 stars 23 forks source link

Proposal: UI for working with non-enum multivalued slots #423

Open pkalita-lbl opened 7 months ago

pkalita-lbl commented 7 months ago

Currently DataHarmonizer presents a custom editing modal for slots that are multivalued and the range is an enum:

image

Once the user finishes using the modal, the cell value becomes a ;-delimited string of the chosen items:

image

However, for a slot that is multivalued but the range is not an enum it is incumbent upon the user to manually produce that ;-delimited string. There are a few drawbacks here:

Here are some quick sketches of a proposed UI for editing non-enum multivalued slots. Starting with the following:

DH multivalued string

If the user starts editing a cell in the "Multivalued string" column, they see a modal with a text input field:

DH multivalued string(1)

Typing into the text box and clicking the "Add" button adds that item to a list displayed below the input. From that list items can also be removed. For example, if the user has added three items:

DH multivalued string(3)

Once the user dismisses the modal, the appropriate delimited string is set as the cell value:

DH multivalued string(4)

Separately, if we decide to adopt this, it may be worth considering updating the editing interface for multivalued cells with enum ranges to be consistent. I could imagine the same type of modal, but instead of a plain text box, it would present a dropdown with the enum options:

DH multivalued string(5) DH multivalued string(6)

ddooley commented 6 months ago

Having existing items each to a row, and deletable via [x] looks good. Having this and the multi-select interface unified also looks good!

Another feature would be to have for the non-enum multiselects is that they too get a dropdown list of items which are compiled (say, on load) from the existing strings across all rows of that column as a way to informally provide an enumeration.

pkalita-lbl commented 6 months ago

Another feature would be to have for the non-enum multiselects is that they too get a dropdown list of items which are compiled (say, on load) from the existing strings across all rows of that column as a way to informally provide an enumeration.

Yeah that makes sense.

I'm going to put this on my backlog for now. It has been talked about within NMDC but hasn't become a super high priority yet. I can give you a heads up if I start working on it.