New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New design for forms #7960
New design for forms #7960
Conversation
Personally I like this approach. It seems more semantically correct & clear, as opposed to mixing labels, inputs from different parts of the form. And
Do you think some developers might have issues w/ this? It seems easy to screw up.
If Regarding styling |
looks otherwise good to me |
Here is a quick feedback: looking the screenshot above (https://cloud.githubusercontent.com/assets/720328/7744667/99e2e468-ffa5-11e4-811f-c4962540a27e.png) from a usability point of view, there is not enough contrast for the inline help. Solution: either we make the Inline text Grey color darker (or alternatively: Make the background grey lighter). More contrast will make inline help easy to read. |
@mattab I agree but this is the alert style, we can change it separately (because I think it would be good to apply that change for alerts too, not just form help) @diosmosis I will try using fieldset and legend then! Regarding "float: right" and "It seems easy to screw up" that's true, but we can immediately see that the help is positioned below the field in that case. I'll give another try at placing the help after the input in the HTML and see how that turns out.
Agreed this PR will already be quite extensive. |
I have tried using
I haven't reproduced that particular behavior (I guess all screen readers are different) but I tried 2 screen readers and the fieldset behaves as a group encapsulating its content, it becomes hard to tab or navigate inside them (i.e. it adds a lot of steps to be able to fill the form). Additionally replacing labels with legends makes them non-clickable because not associated to the inputs anymore. Additionally with the screen reader legend≠label so inputs would have no description anymore… All in all I think fieldsets are not a good option. Even for radios and checkboxes I found the user experience worse when using a screen reader (but maybe that's because I'm not used to it). I suggest to keep using Regarding help blocks I tried to put it after the fields (inputs, radios, …) in the HTML layout but it requires some complicated Less/CSS and it messes up a lot of things (because we have to make the inputs float:left, which is a mess when there are several radios/checkboxes with labels). I don't think it's worth it, keeping it simple and logical is good (a float element should always be put before the item on which we want to align). And if by mistake we put the help after the input it's quite easy to understand what's wrong (visually it's explicit). Also the good thing with the current solution is that when using a screen reader the help is read before reaching the input, which is much better. |
Ok, I withdraw my comments about |
@mnapoli Is this ready to merge? If so, can you remove the WIP label? I can look again and merge if it looks good. I'll also create a follow up issue for the notification contrast. |
Not 100% finished, I want to move all the forms to the new design. I also need to review all the UI tests to make sure there is no regression. I'll ping you when it's done ;) |
Looking forward to the new forms applied consistently 👍
Is there another solution to style tags in Chrome or do you think it looks acceptable not to style them? |
Oh I think we should try as much as we can (because else it doesn't look good at all), even maybe use fake selects (if it doesn't mess up too much the tests). But I think it's even possible on Chrome with CSS only, it's just that it requires a more work because when you disable the default appearance you loose everything (e.g. the arrow) so you have to recreate the style from scratch. Anyway I need to research more into that, but in the meantime I think it shouldn't block that (which blocks the user/site manager). |
…dn't tick the "yes I'm sure" box
@mattab thanks I have fixed those UI regressions (one was appearing only on Firefox). What's left is check every UI screenshot diff (lots of them because of small changes everywhere) + test using different browsers |
Ok great 👍 merging (it will make it into the next beta) |
I didn't check the screenshot diffs neither with different browsers did you? There were a lot of changed screenshots and I was stuck yesterday by the UI tests failing because of the segmentation faults |
they were broken, I thought about it but then wanted us to move forward with design changes. Hopefully we can solve the UI tests issue. (not sure if it is #8034 or a new one) |
yes they were broken, but this PR has been merged without being tested (at least by me) that's what I'm saying (was still WIP). I'm going to test on master then |
…dn't tick the "yes I'm sure" box
…dn't tick the "yes I'm sure" box
ref #7584, #7585, #7587
I have applied the new design for forms. This is more difficult than the other redesigns because the mockups do not cover even half of all the possible use cases (and sometimes they were not consistent). Additionally in order to get the desired layout I had to add
<div>
tags (formatting cannot be done entirely in CSS) unlike simpler elements like alerts, buttons or tables…So I'm asking please review the HTML layout that one has to use to create forms. This layout will become API.
Currently, HTML forms are constructed using tables: these forms should not (will not) break as they might be used in plugins. However new forms should be created using the new way (i.e. not tables).
Here is a preview of new forms:
You can see some mockups here: #7587 (the new forms also appear in the installer, etc.)
And here is the HTML layout that you should review:
For some complex use cases I had to be a little creative, I used Bootstrap as an inspiration. Here is for example the before:
After (input with addon):
A little background:
<div class="form-group">
is a pain but doing without it was extremely complex and wouldn't even work with advanced use cases (like radio/checkbox lists, …)form-group
is a class inspired by Bootstrap<div class="form-help">
isfloat: right
that's why it must be put before the fields (side note: I think it's also good for screen readers/disabled users…)radio
andcheckbox
CSS classes are necessary to force display correctly (as block, etc.), applying directly to the input radio would mess up many things… This is also inspired by Bootstrap.Some questions:
<div class="form-group">
by<fieldset>
? I'm not 100% sure if it would make sense<legend>
tags maybe? The reason I'm asking this is that we use<label>
for titles of the form-groups as well as for radio/checkbox labels (sometimes 2 labels following each other as you can see in the example above). Using a different HTML tags might make things clearer?<div class="form-help">
and replace it with alerts (since it's what is used behind the scenes):<div class="alert alert-info">
form-help
is simpler thanalert alert-info
Notes:
<select>
tags like in the mockups because on some browsers (e.g. Chrome) it's not possible: we would have to use hacks and recreate a select using HTML/CSS