-
Notifications
You must be signed in to change notification settings - Fork 384
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
Improve placement of AMP validation errors in the block editor #3821
Comments
Related: We need to provide non-technical users with an escalation path with technical administrators to get assistance with validation errors when they occur. For users who have developer tools turned off, showing the full error details should not be done by default but rather a way for them to ping an administrator with the details. |
Yes, that is better. However, the warning icon probably can't be placed along the side since it would cause the same layout problems as the inline notice. So can the button to show the validation errors be moved to the block toolbar? Actually this may not even be needed since as soon as a block is selected the block validation errors panel would appear in the sidebar. Maybe that wouldn't promote discovery enough and an additional toolbar button could focus on that panel and expand it. Not sure what the best practice is there. |
We just had a discussion about this, and it may make sense to remove the (!) icon from the top right, to simplify the work, since manipulating the DOM may be challenging. |
Wanted to make a suggestion here. In addition to notice fatigue in the editor, a lot of sites have an excess of panels in the editor Document sidebar. It's easy for individual plugin panels to get visually lost or confused with core panels, as they all look the same. I suggest using a PluginSidebar instead. We should be able to tailor the sidebar icon to the severity of the issues (I'd need to test this to make sure), and then all the AMP features would be in one place, instead of mixed into the block editor or the main document sidebar in a less controlled manner. |
@johnwatkins0 that's a great idea. I've been wondering how we would fit a third tab in the Document/Blocks section. A plugin sidebar makes more sense. |
Would a PluginSidebar work well to display both document-level and block-level validation errors? Or would block-level errors still show up in the block settings sidebar when the block is selected? |
There should still be a link to view the validated URL screen as well, since there will be additional information available there, namely the stylesheet data. This link should appear regardless of whether there are errors or not. So this message would be shown below that link. I think perhaps a simple ✅ with simple “Page at permalink is valid AMP” message would suffice. |
Oh good point. Agreed! |
@jwold @westonruter About 75% done with this. After working on it a while, I have some suggestions that may warrant one more design round if you think I'm going in the right direction. Current state of the sidebar below. You'll see I've deviated from the design: I think we want the sidebar to give the following information in order of importance:
All of this is captured in what I have right now in the screenshot.
What do you think about this direction? Other thingsBlock iconThe icon on the left is the JS/CSS/HTML icon. The icon on the right is the block icon taken from the block settings. This is a departure from the design (where the block icon has a gray background with white SVG paths) because these block icons can be almost anything, so we shouldn't try to manipulate them beyond adding that border and the border radius. Panel contentI haven't been sure what to include in the panel content: We should probably include more than this but less than what's on the URL validation screen. Any suggestions? Orange lineI'm not sure I'm linking this orange line around the block containing an error, because as a new user I might not know what it is: But I wouldn't fight to remove it. Users will figure out what it is after a little while. Block toolbar iconThe block toolbar icon (which can't be placed all the way to the left as in the design) works well: But with my current approach every block has this icon, even if the block has no errors: I'm not sure that this is a good idea. Should we perhaps only show the icon on blocks that have unreviewed errors? |
Quick addition to the above comment: I would like to explore creating a small REST endpoint to allow these errors to be marked as reviewed from the editor. As a user, this would allow me to get that badge number down to 0 without leaving. The REST endpoint can also allow these errors to be marked as Kept/Reviewed. This can be a small REST endpoint, likely to be adapted into a more full-featured endpoint in the future. |
Thanks for the feedback @westonruter. I will revisit in detail later, but I wanted to mention I love this idea:
Much better than what I'm doing now with two sections. Also wanted to call on @jwold to take a look at Weston's first paragraph above. I agree that the block icons should be square, but when placed on a white background with no border, the core icons just float there with no apparent shape. This little piece has been challenging for me, so I would appreciate any visual ideas you can share. |
@westonruter happy to play with the icons more. Note that the VS studio logo uses the <> brackets icon: https://d.pr/i/fu7elu. That may make more sense for us to just replicate? |
Yes, that looks good. Using those VSCode icons in a circle, along with the block icon in a square. |
@jwold Based on Weston's feedback above I'm now combining reviewed and unreviewed errors into a single list, with a checkbox to include reviewed errors. Do you think we should visually distinguish new and reviewed errors in some way? Following this model, potentially (if I remember correctly, you proposed this at an early stage): What do you think? While we're at it, I think we should visually distinguish the items that have been marked as Kept because they break AMP-compatibility. |
On my question above, I'm going to try Weston's suggestion:
But I still think we should also have a way to differentiate the errors that are causing AMP invalidity on the page due to their being kept. |
Currently your screenshot shows that the validation error text would be like: But this is not the title for this error type. I mean, “kept” is not part of the string. The string returned would be:
So then each error will need to have something appended to it to indicate the removed/kept status. So this could be appending |
|
Reviewed errors have no highlight. If something is un-reviewed, then it gets the same red/orange styling as non-reviewed.
Perhaps so. But if the reviewed errors are moved to the bottom then the errors won't appear in the order that they occur in the document. Also, if the checkbox is moved down, then when checked would the reviewed errors appear after the checkbox, with the unreviewed errors before the checkbox? |
Agreed. So we'd want to add the styling to the un-reviewed.
What I had in mind was a bit different.
|
A problem with this is content shifting. Toggling the checkbox would cause the vertical position of the checkbox to change. |
@johnwatkins0 @jwold I have a suggestion related to #4668 where the important thing for non-technical users is to highlight incompatible theme/plugins. For users with DevTools turned off, we should probably still show the AMP plugin sidebar to alert them of issues. However, listing all of the validation errors is probably too much information. So here's an idea. When DevTools are turned off, validation errors could be hidden by default in the plugin sidebar. Instead there could be a list of the theme/plugins identified as the sources for those errors in the first section of the sidebar. This could even be relevant when DevTools are enabled: the list of theme/plugins above could serve as a way to filter the list of errors that appear below. |
@jwold Do you think you could mock something up for Weston's suggestion above? There is:
I think this can potentially be done as a follow-up to this issue. |
Will we want to also allow non-technical an option to see these errors if they wish? I realize that's not the intent with this work, but wondering if we want to enable that for the brave. |
I think there are three categories of users:
In cases 1 & 2 for admins, the key is that these are administrators who have the ability to take action on the errors. They have the ability to deactivate/switch themes and plugins. In the case of admins who have DevTools turned off, there should perhaps be the same message as indicated in 3, where there is a way to notify an administrator who does have DevTools turned on. This is referenced in #2316 (nevertheless, there may not be any other administrators on the site). The 3rd point is out of scope for this issue. For non-admins, no indication of any validation error would be shown. The 2nd point may be still controversial. I can imagine some sites wanting everything related to AMP compatibility to be hidden, even for admins with DevTools turned off. There's a balance here of trying to conceal complexity, but at the same time not going to the degree of violating user trust by serving broken pages. |
Feature description
Consider moving the warning notice to the sidebar since inline it will cause problems based on where the block is located in the editor. The block could have some error outline so that when clicked it will show the block sidebar with the validation error information in an expanded panel.
This was taken out of #3664
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: