-
Notifications
You must be signed in to change notification settings - Fork 641
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
Feature/dev 212 errors summary #12125
Conversation
#11569 - WIP: validate element for all sites before publishing (live/pending/enabled)
DEV-212 Summarize errors on top of entry page
Motivation: I've been testing the readout of field errors and "Couldn't save" alerts with VO and have found that the experience of identifying and navigating to fields is difficult from the experience of a screen reader user.
My suggestion is to add a new section to the content container. If the entry has errors after submit and couldn't be saved, keyboard focus should be moved to the heading indicating how many errors there were. A list inside will link to each of the fields with errors, activating the relevant tab panel and moving focus to the input in question. Screen Shot 2022-01-19 at 3.29.39 PM.png This follows the pattern described here: https://www.w3.org/WAI/tutorials/forms/notifications/#listing-errors |
# Conflicts: # src/controllers/ElementsController.php # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map
Awesome work on this feature @i-just AccessibilityThe focus management on this page when the page loads is a little unexpected. Focus seems to either be placed on the title field or the active tab button. However, when there’s an error summary present, focus should be placed on the error container. This will require adding I also noticed on entries with a lot of fields and/or multiple tabs or Matrix blocks, it can be difficult for users to track down the field in question. It would be nice if the list item text was wrapped in an anchor tag. When clicked, focus is moved to the field in question; if it’s in a different tab than the currently-active one, the new tab is activated and then focus is moved. See an example of this in the 'Error on top' recovery pattern For the cross-site validation, I recommend removing the "(View)" text and having the entire error message as the link. This will help provide information about the link's purpose in-context StylesOne styling suggestion that's also a11y-related - a large chunk of red text in the error summary might be anxiety-inducing (especially when paired with the error notification and the red tabs). I think having the summary heading and list text inherit the body text color would work well |
Co-authored-by: Guadalupe Camacho <[email protected]>
Co-authored-by: Guadalupe Camacho <[email protected]>
Co-authored-by: Guadalupe Camacho <[email protected]>
Co-authored-by: Guadalupe Camacho <[email protected]>
Thanks @gcamacho079! All clear, all makes sense. I've actioned the following:
|
Wasn't this PR supposed to be part of the 4.4 release? We were really looking forward to this one, sad to see it didn't make it. Error messages have way too little visibility right now, multiple of our clients have run into problems because they missed the tiny error message at the bottom left that the entry didn't save correctly. This PR would've helped, though it still doesn't address the problem regarding validation errors on related assets I mentioned in my previous comment. @i-just @gcamacho079 Any insight on why this didn't make it? Also, I would really appreciate a response to my previous comment as well as the discussion linked there. This is the largest issue we have with Craft, and our clients constantly stumble over this. Regarding the low visibility of error messages, we had to humbly apologize to a client who lost a lot of work because they didn't notice their entries hadn't been saved. There's some user error involved here, but due to the way that errors aren't clearly presented, we couldn't in good conscience tell them it was just their fault. I feel this should get a higher priority due to the accessibility implications and frustration potential related to this issue. |
@MoritzLost I didn’t get a chance to review in time for 4.4, but it’s planned for 4.5 :) |
@MoritzLost, regarding your previous comment, we have decided to make the validation message for related elements more user-friendly, which we believe should help. The related element validation will read “Validation errors in - please fix them.” |
Thanks @brandonkelly! We're looking forward to it.
@i-just Thanks, that will be an improvement over the current error message. Though I would still like to see the actual validation errors that occurred somewhere in the context of the field. I guess we'll see if this change helps our new clients understand the problem better without us having to explain it. |
# Conflicts: # src/services/Elements.php # src/web/CpScreenResponseFormatter.php # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map # src/web/assets/cp/dist/css/cp.css # src/web/assets/cp/dist/css/cp.css.map # src/web/assets/cp/src/js/ElementEditor.js
[ci skip]
Work for dev-212 and #11569
Description
for dev-212:
for #11569:
TODO:
Related issues
#11569
#11612