hypothesis / product-backlog

Where new feature ideas and current bugs for the Hypothesis product live
118 stars 7 forks source link

Allow the use of form `description` fields in form templates #508

Open lyzadanger opened 6 years ago

lyzadanger commented 6 years ago

Right now, we're using deform widely on the h service for rendering forms. colander schemas, which are used by deform, have a description attribute available. But h forms only make use of the hint attribute, which gets rendered behind a tooltip.

I believe that tooltips can be appropriate in certain situations, but in other places they introduce extra work for the user and are not accessibility- or (very) mobile-friendly.

I'd like to be able to use and render descriptions—right now just in admin forms—by adding description property output to the form-field templates.

I've done a quick grep of the codebase and I don't see any use of description in colander schemas outside of my own new admin schema for groups; thus I'm hoping that exposing description in templates would not affect any existing forms (especially user-facing ones) but I'd like to discuss.

The actual work here would be relatively quick: add description to several form-field templates and appropriate styling.

robertknight commented 6 years ago

I believe that tooltips can be appropriate in certain situations, but in other places they introduce extra work for the user and are not accessibility- or (very) mobile-friendly.

I'll have a look at this PR more closely tomorrow but I just wanted to comment on this specifically.

Our tooltips do actually work on mobile devices and they are visible to assistive technology. See notes in tooltip-controller.js. I do note that for some form controls we have an affordance to make them larger depending on the input device (@media (pointer: coarse)) and we are missing this for tooltips.

lyzadanger commented 6 years ago

I'm glad our tooltips are (mostly) mobile-friendly! I think what I'm getting at is: would it be possible not to hide information behind something that requires a user action, especially in an admin-like form? Perhaps this is wandering into territory that @dawariley would be able to help us with.

The tooltip targets seem a little small and they're visually tiny—what they imply to me is more of a "footnote" (extra information about the field) versus the core description of what a field's purpose is. Does that make any sense or am I splitting hairs here?

The way it feels to me intuitively:

If we're hiding essential field information—the kind that would be needed to be able to fill out the form correctly by most of the people using the form—behind tooltips, that feels potentially cumbersome to me.

@robertknight Note: This isn't a PR :)

seanh commented 6 years ago

Agree with Lyza about tooltips hiding information

seanh commented 6 years ago

@lyzadanger I wonder if we can remove this one from the current sprint though? I think it's a general improvement to our forms (product wide, or at least h wide) rather than a part of the groups feature specifically. In fact the only forms that the groups feature involves (so far and for the foreseeable future) are staff-only admin forms. Also this will probably require design input for how showing field descriptions on forms should look.

Having said that I think improving the usability of our forms is important so if this is something you want to work on I'm happy to support that.

By the way, how much does this issue apply to our staff admin forms vs to our user-facing forms? Both?

Just for context, here are some other known issues with our user-facing form design. We could make a whole project out of "fixing forms" unfortunately:

Also P.S. at one point we actually got agreement that error messages should be moved outside of form fields but it never got done

lyzadanger commented 6 years ago

I agree that this is not urgent, but important 👍

lyzadanger commented 6 years ago

By the way, how much does this issue apply to our staff admin forms vs to our user-facing forms? Both?

AFAICT, none of our forms (by "forms" I mean deform using colander schema) use the description property at all except for the ones I have been adding in the admin-add-group form. That means—theoretically—that if I add description rendering to form-field templates, this should just work and none of the other (i.e. user-facing) forms should be affected.