paleobot / pbot-dev

Codebase and initial design documents for pbot client
MIT License
2 stars 2 forks source link

Add a "blank" option to every select list #81

Closed clairecleveland closed 1 year ago

clairecleveland commented 1 year ago

Right now, if you make a mistake there is no way to clear what you have entered. Here are some examples of things that happen. Not sure if cancel, reset, undo, or empty field option is best for each/all of these.

aazaff commented 1 year ago

We will have to go into this in more detail at a later date. Not assigning it a priority until we've discussed more thoroughly.

clairecleveland commented 1 year ago

Not promised for HackAThon, but more than a low priority.

NoisyFlowers commented 1 year ago

For mutation forms: It doesn't really make sense to add a blank or "None" option to select boxes in Required accordions. I'll add them to select boxes in Optional Accordions.

For query forms: "None" in selects make sense. However, many of these select components are shared with the mutation forms. Where this is the case, I can add a param to the component, like "includeNone" or something.

Is there value in adding a form reset button next to Submit on all forms?

NoisyFlowers commented 1 year ago

Note: It also makes no sense to add a None option to multiselects, since they allow you to deselect.

NoisyFlowers commented 1 year ago

Ugh. This is a can of worms.

For complex query forms like OTU, which builds up Schema/Character/State combinations, it's not enough to provide a None option. Choosing None on Schema, for instance, requires that Character and State be reset as well. Since these are shared modular components, this level of state management is complicated.

I'm thinking of bailing completely on the "None" option and just leaning on the form level Reset button idea, at least until after Hack-a-whatsit.

clairecleveland commented 1 year ago

@NoisyFlowers Yeah, I'm good with that Doug. More recently there was a specific case where a required form was causing an issue, but I can't remember the details. I'll report if I come across it again or perhaps it will come out at HackAThon. I got rid of HackAThon label and changed to high priority question for after HackAThon. Please relabel if that's not appropriate. Thanks!

NoisyFlowers commented 1 year ago

I decided to go ahead with the mutation-related Nones because those forms would be particularly nasty to have to fully reset because of a mistake. I decided not to add Nones to selects in queries because the Schema/Character/State logic mentioned above would require more effort than it is worth for such short forms.

This is in

paleobot/pbot-client@4dd3926deb2247a8341954aa92dffbfb4d1597d6 paleobot/pbot-client@0e737243d5ce2865e77aa3dc6c01f6f4b0ed2b30 paleobot/pbot-client@a1586de708d552fdec3d57f2fc47689c44d95c44 paleobot/pbot-client@7a087ed80e47d851ed632ee7377326cc4dd6f2ba paleobot/pbot-client@4bd809665308d2e6a3f3dcba3f6cb1ead0af1496 paleobot/pbot-client@f461ecd98dc977b048aef225fde5c41f9ec90c66

Because there were so many files involved, I tagged the code history before bringing these changes so we can roll back if anyone is unhappy.

If this is satisfactory to everyone, I suggest we close this issue.