-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Consider displaying block errors in list view #41747
Comments
Thanks @jameskoster, I quite like this! 🙌 Just to clarify, would we still indicate somehow in the canvas that there is an error with a given block (e.g. by greying them out or adding a red border or something to that effect)? Also, would the pattern you suggest be amenable to adding buttons to resolve a given error (when possible), as discussed in #40614 and explored in #41603? |
Good question. I think anything we do on the canvas is going to be afflicted by the two points above, which makes it tricky. As an alternative could we use a Snackbar to alert the user when an incompatible block has been inserted, and include an action to open List View to investigate? Otherwise I'm inclined to say it doesn't matter too much. It seems more important that the backend / frontend are matching, which hiding the 'broken' blocks will accomplish. Where there any flows in particular that you had in mind?
In most cases I expect the resolution would be to remove the block, which is already possible within the list view UI. I suppose we'd need to figure out a list of potential actions to determine whether the design can / should accommodate them. |
So for the blocks that prompted me to file #40614 and #40617, the underlying problem is typically a post-specific or site-wide setting that would cause the block not to be rendered in the frontend, e.g.:
In those cases, I thought it would make sense to offer the user an "easy fix" -- a button that would change the underlying setting (here: enable avatars site-wide, or enable commenting for the given post, respectively) so that the relevant block will be shown -- rather than suggesting them to remove the block altogether. (If their intent was to have the block there in the first place, it'd be otherwise more complicated to restore it -- they'd need to find the relevant setting, change it, and then come back to re-insert the block.) |
Thanks for sharing the examples. Yeah I agree it seems fair to include actions like beneath the description for situations like these. Such examples also make me wonder whether there should be a severity factor applied to the errors. These feel more like warnings as the blocks are not broken per se. I'm also thinking we might use Snackbars as feedback upon insertion of blocks with errors / warnings. warning.mp4 |
Thanks James for this latest iteration -- looks good to me!
Sounds like a good idea 👍
Also sounds good! Some errors / warnings might occur after the fact, i.e. the block is already part of a post (or template) when a setting is changed. But maybe it's fair to display the snackbar when the user opens the editor the next time? (As long as it's not too many blocks / warnings at once, I guess.) |
Ah yes good point. Disabling comments on a post when the comments form block is already present for example. I think it would be ok to utilise the snackbar there, and to combine multiple errors into a single Snackbar to avoid pollution. It's probably something we'd have to feel out through some experimentation. The Snackbar may not even be necessary if we did something with the notification number on the list view button. |
Leaving a note that this could also be a way to alert users to un-configured or empty blocks within a document. |
I think this is a good solution to stop showing messages in the canvas. Users of assistive tech would still have to know they have broken or unconfigured blocks, so the blocks should still be "present" and focusable so the problems can be announced. This would make for invisible tabstops, and be a bit confusing in navigation mode as you'd move the caret in places that seem empty. How could we mitigate that visually? Also for reasons of cognitive accessibility I think we should stick to snackbars instead of relying solely on the notification count on the list view. |
Not just users of assistive technologies, anyone. List view (or document outline) come to mind, but also the pre-publish flow could have a panel that lists unconfigured blocks. I'd use the default blueberry unread dot we use in a few other places, though, and consider having levels of error, such as "warning" (markup error, missing plugin) vs. "notice" (smaller issues like missing link or what brought us here, no pages which is harmless but good to know). By including it in the pre-publish flow, we not only surface any issues before publishing, we surface it to folks who might not use the list view. |
Agreed on Snackbars, there's a demo including them in this comment. |
Occasionally blocks exist on the canvas that will not render for one reason or another. It was discussed in other issues (#40617) whether we should omit incompatible blocks automatically, but that is tricky because incompatible blocks can be inserted indirectly, like copy/pasting a pattern.
Currently there is no consistent way to handle erroring blocks. Blocks in core tend to throw an error in lieu of their intended rendering:
There are a couple of problems with this:
As an alternative we might consider highlighting errors in List View:
Here we can style rows to indicate errors (IE make them red), and have space to include a message. The button in the top bar can indicate how many errors there are at a glance.
cc @WordPress/gutenberg-design @ockham @c4rl0sbr4v0
The text was updated successfully, but these errors were encountered: