microbiomedata / nmdc-field-notes

Mobile app for metadata collection on the go
https://fieldnotes.microbiomedata.org/
Other
1 stars 0 forks source link

Add ability to control which slots are displayed on sample view/edit page #80

Open pkalita-lbl opened 3 months ago

pkalita-lbl commented 3 months ago

Currently when a user goes to the sample view/edit page, they see all the slots for appropriate schema class. This is often a lot of slots. Some of them will probably never be collected in the field and others will not apply to certain studies/scenarios.

Proposal: Use local app storage to store, for each schema class, which slots should be displayed. That is, the locally stored data would look something like:

// Store the slot names that the user wants to see, keyed by the class name
{
  AirInterface: ["samp_name", "alt", "humidity"],
  SoilInterface: ["samp_name", "depth", "elev"],
}

From a user perspective if they get to a sample page showing a class that is not in the settings object (e.g. WaterInterface following the above example), show a banner at the top that says something like "Too many fields? Tap here to select fields to show". Tapping that message should bring up a modal overlay which lists all the slots with checkboxes and a Select/Deselect All control. The modal should explain that once set, only the selected fields will be shown for that template. And that they can change their selections in Settings later. The next time the user lands on a sample page where the template is in the settings object, show a message at the bottom of the list indicating that some fields are hidden based on previous selection and that they can change it in Settings.

In the Settings tab, add a section for Field Visibility. In that section, show each template that is represented in the stored settings object (e.g. Air and Soil following the above example). Tapping on a template name should bring up the modal with the checkboxes where they can update their selections.

pkalita-lbl commented 3 months ago

That was a bit of a brain dump. I can make rough interface sketches later if it wasn't clear.

simroux commented 3 months ago

Sounds clear to me, and I really like the option of having a different UI and user message when it's the first time they interact with a class vs when they have a selection already in the system.

pkalita-lbl commented 2 months ago

@eecavanna proposed an interesting idea that this setting could be export/import-able so that users could share this configuration with each other. Sharing device-to-device via something like a QR code might be the simplest approach. Otherwise doing device-to-server and vice-versa would allow users to share across the internet, but there are a lot more considerations there about permissions and how to search etc.